# HG changeset patch # User Igor Sysoev # Date 1075303357 0 # Node ID 5d4f49dc8de582dad93fe1ea672a34f4ca154a87 # Parent 3bfa496bc22ec2261ce91204aab609e3479e1bb6 nginx-0.0.1-2004-01-28-18:22:37 import diff --git a/auto/types/sizeof b/auto/types/sizeof --- a/auto/types/sizeof +++ b/auto/types/sizeof @@ -7,8 +7,10 @@ ngx_bytes= cat << END > $NGX_AUTOTEST.c +#include #include #include +$NGX_UNISTD_H $NGX_INTTYPES_H $NGX_AUTO_CONFIG diff --git a/src/core/ngx_config.h b/src/core/ngx_config.h --- a/src/core/ngx_config.h +++ b/src/core/ngx_config.h @@ -52,8 +52,6 @@ typedef int ngx_flag_t; /* STUB: autoconf */ #define PTR_FMT "%08X" -/* STUB: autoconf */ -#define ngx_setproctitle setproctitle #include diff --git a/src/core/ngx_connection.c b/src/core/ngx_connection.c --- a/src/core/ngx_connection.c +++ b/src/core/ngx_connection.c @@ -48,7 +48,10 @@ ngx_int_t ngx_set_inherited_sockets(ngx_ return NGX_ERROR; } +/* STUB: autoconf & set sin_len in ls[i].sockaddr in ngx_http.c */ +#if __FreeBSD__ addr_in->sin_len = 0; +#endif ls[i].family = addr_in->sin_family; ls[i].addr_text.len = ngx_sock_ntop(ls[i].family, ls[i].sockaddr, diff --git a/src/event/modules/ngx_kqueue_module.c b/src/event/modules/ngx_kqueue_module.c --- a/src/event/modules/ngx_kqueue_module.c +++ b/src/event/modules/ngx_kqueue_module.c @@ -496,6 +496,8 @@ static int ngx_kqueue_process_events(ngx } +#if 0 + static void ngx_kqueue_thread_handler(ngx_event_t *ev, ngx_log_t *log) { ngx_int_t instance; @@ -518,6 +520,8 @@ static void ngx_kqueue_thread_handler(ng } +#endif + static void *ngx_kqueue_create_conf(ngx_cycle_t *cycle) { diff --git a/src/event/ngx_event.h b/src/event/ngx_event.h --- a/src/event/ngx_event.h +++ b/src/event/ngx_event.h @@ -202,7 +202,7 @@ extern ngx_event_actions_t ngx_event_a /* * The event filter has kqueue features - the eof flag, errno, - * available data, etc + * available data, etc. */ #define NGX_HAVE_KQUEUE_EVENT 0x00000008 diff --git a/src/http/modules/ngx_http_ssi_filter.c b/src/http/modules/ngx_http_ssi_filter.c --- a/src/http/modules/ngx_http_ssi_filter.c +++ b/src/http/modules/ngx_http_ssi_filter.c @@ -21,6 +21,10 @@ typedef struct { typedef struct { +} ngx_http_ssi_command_t; + + +typedef struct { ngx_hunk_t *buf; char *start; @@ -38,10 +42,18 @@ typedef struct { int state; size_t saved; - ngx_int_t err; } ngx_http_ssi_ctx_t; +typedef ngx_int_t (*ngx_http_ssi_opcode_pt) (ngx_http_request_t *r, + ngx_http_ssi_ctx_t *ctx); + +typedef struct { + ngx_str_t name; + ngx_http_ssi_opcode_pt op; +} ngx_http_ssi_op_t; + + typedef enum { ssi_start_state = 0, ssi_tag_state, @@ -58,20 +70,34 @@ typedef enum { ssi_double_quoted_value_quote_state, ssi_quoted_value_state, ssi_quoted_value_quote_state, + ssi_comment_end0_state, + ssi_comment_end1_state, ssi_error_state, - ssi_comment_end0_state, - ssi_comment_end1_state + ssi_error_end0_state, + ssi_error_end1_state } ngx_http_ssi_state_e; +static ngx_int_t ngx_http_ssi_error(ngx_http_request_t *r, + ngx_http_ssi_ctx_t *ctx); static ngx_int_t ngx_http_ssi_parse(ngx_http_request_t *r, ngx_http_ssi_ctx_t *ctx); + +static ngx_int_t ngx_http_ssi_echo(ngx_http_request_t *r, + ngx_http_ssi_ctx_t *ctx); + static void *ngx_http_ssi_create_conf(ngx_conf_t *cf); static char *ngx_http_ssi_merge_conf(ngx_conf_t *cf, void *parent, void *child); static int ngx_http_ssi_filter_init(ngx_cycle_t *cycle); +static ngx_http_ssi_op_t ngx_http_ssi_commands[] = { + { ngx_string("echo"), ngx_http_ssi_echo }, + { ngx_null_string, NULL } +}; + + static ngx_command_t ngx_http_ssi_filter_commands[] = { { ngx_string("ssi"), @@ -111,13 +137,14 @@ ngx_module_t ngx_http_ssi_filter_module static int (*ngx_http_next_header_filter) (ngx_http_request_t *r); -static int (*ngx_http_next_body_filter) (ngx_http_request_t *r, ngx_chain_t *in); - +static int (*ngx_http_next_body_filter) (ngx_http_request_t *r, + ngx_chain_t *in); static char ssi_string[] = "