#include <io.h>#include <fcntl.h>#include <sys/stat.h>#include <pro/rfctime.h>#include <pro/uhttp/utils.h>#include <pro/uhttp/modules/mod_cgi_func.h>#include <pro/uhttp/modules/mod_ssi.h>#include <stdlib.h>#include <string.h>#include <ctype.h>#include <stdio.h>| #define SSI_TYPE_FILE 0x01 |
$Id$
| #define SSI_TYPE_VIRTUAL 0x02 |
| #define SSI_TYPE_EXEC 0x03 |
| #define SSI_TYPE_ECHO 0x04 |
| #define HTTP_SSI_CMD_INCLUDE 1 |
| #define HTTP_SSI_CMD_ECHO 2 |
| #define HTTP_SSI_CMD_CONFIG 3 |
| #define HTTP_SSI_CMD_SET 4 |
| #define HTTP_SSI_CMD_IF 5 |
| #define HTTP_SSI_CMD_ELIF 6 |
| #define HTTP_SSI_CMD_ELSE 7 |
| #define HTTP_SSI_CMD_ENDIF 8 |
| #define HTTP_SSI_CMD_BLOCK 9 |
| #define HTTP_SSI_CMD_ENDBLOCK 10 |
| #define HTTP_SSI_NUM_COMMANDS (sizeof(ssiCmdList) / sizeof(HTTP_SSI_COMMAND)) |
Referenced by HttpSsiParse().
| typedef struct _HTTP_SSI_PARAM HTTP_SSI_PARAM |
| typedef int(* HTTP_SSICMD_HANDLER)(HTTPD_SESSION *, HTTP_SSI_PARAM *) |
| typedef struct _HTTP_SSI_COMMAND HTTP_SSI_COMMAND |
| int HttpSsiProcessFile | ( | HTTPD_SESSION * | hs, |
| int | fd | ||
| ) |
References _filelength(), _read(), _seek(), free(), HttpSsiParse(), malloc(), NULL, s_flush(), _HTTPD_SESSION::s_stream, s_write(), SEEK_CUR, and strstr().
Referenced by HttpSsiHandler(), and HttpSsiIncludeHandler().
| int HttpSsiIncludeHandler | ( | HTTPD_SESSION * | hs, |
| HTTP_SSI_PARAM * | prm | ||
| ) |
References _close(), _O_BINARY, _O_RDONLY, _open(), AllocConcatStringLen(), free(), HTTP_ROOT, HttpSsiProcessFile(), _HTTP_SSI_PARAM::ipar_name, _HTTP_SSI_PARAM::ipar_namelen, _HTTP_SSI_PARAM::ipar_value, _HTTP_SSI_PARAM::ipar_valuelen, memcmp(), and NULL.
| int HttpSsiExecHandler | ( | HTTPD_SESSION * | hs, |
| HTTP_SSI_PARAM * | prm | ||
| ) |
References AllocConcatStringLen(), free(), HTTP_METHOD_GET, HttpCgiFunctionHandler(), _HTTP_SSI_PARAM::ipar_name, _HTTP_SSI_PARAM::ipar_namelen, _HTTP_SSI_PARAM::ipar_value, _HTTP_SSI_PARAM::ipar_valuelen, malloc(), memcmp(), memcpy(), NULL, _HTTP_REQUEST::req_length, _HTTP_REQUEST::req_method, _HTTP_REQUEST::req_query, _HTTP_REQUEST::req_version, _HTTPD_SESSION::s_req, strchr(), and strcmp().
| int HttpSsiEchoHandler | ( | HTTPD_SESSION * | hs, |
| HTTP_SSI_PARAM * | prm | ||
| ) |
References _HTTP_SSI_PARAM::ipar_value, _HTTP_SSI_PARAM::ipar_valuelen, memcpy(), NULL, realloc(), and s_puts().
| int HttpSsiParse | ( | HTTPD_SESSION * | hs, |
| const char * | buf, | ||
| int | len | ||
| ) |
{
{ "include", 7, HttpSsiIncludeHandler },
{ "exec", 4, HttpSsiExecHandler },
{ "echo", 4, HttpSsiEchoHandler },
}