diff --git a/auto/types/sizeof b/auto/types/sizeof index d015aeaec..4baf3d755 100644 --- 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 index e6772bd84..3039d58f5 100644 --- 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 index 6298ff160..8833c2bce 100644 --- a/src/core/ngx_connection.c +++ b/src/core/ngx_connection.c @@ -48,7 +48,10 @@ ngx_int_t ngx_set_inherited_sockets(ngx_cycle_t *cycle) 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 index 4b35aab68..b261e1be6 100644 --- 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_log_t *log) } +#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(ngx_event_t *ev, ngx_log_t *log) } +#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 index 04da4d38e..0e7939209 100644 --- a/src/event/ngx_event.h +++ b/src/event/ngx_event.h @@ -202,7 +202,7 @@ extern ngx_event_actions_t ngx_event_actions; /* * 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 index 0972523d6..b6dc637ac 100644 --- a/src/http/modules/ngx_http_ssi_filter.c +++ b/src/http/modules/ngx_http_ssi_filter.c @@ -20,6 +20,10 @@ typedef struct { } ngx_http_ssi_conf_t; +typedef struct { +} ngx_http_ssi_command_t; + + typedef struct { ngx_hunk_t *buf; @@ -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_error_state, ssi_comment_end0_state, - ssi_comment_end1_state + ssi_comment_end1_state, + ssi_error_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[] = "