# HG changeset patch # User Igor Sysoev # Date 1060355604 0 # Node ID 1947c683490feefe99287eca15ac63725d793a9d # Parent 4cbe22f9907ffd005b0198b4e996ab4da2f0b1e6 nginx-0.0.1-2003-08-08-19:13:24 import diff --git a/src/core/ngx_alloc.c b/src/core/ngx_alloc.c --- a/src/core/ngx_alloc.c +++ b/src/core/ngx_alloc.c @@ -59,20 +59,25 @@ void ngx_destroy_pool(ngx_pool_t *pool) free(l->alloc); } - /* we can use pool->log so we have to free() pool after all */ + /* + * we could allocate pool->log from this pool + * so we can not use this log while free()ing the pool + */ - for (p = pool->next; p ; p = n) { #if (NGX_DEBUG_ALLOC) + for (p = pool, n = pool->next; /* void */; p = n, n = n->next) { ngx_log_debug(pool->log, "free: %08x" _ p); + } #endif - n = p->next; + + for (p = pool, n = pool->next; /* void */; p = n, n = n->next) { free(p); + + if (n == NULL) { + break; + } } -#if (NGX_DEBUG_ALLOC) - ngx_log_debug(pool->log, "free: %08x" _ pool); -#endif - free(pool); pool = NULL; } 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 @@ -4,8 +4,27 @@ #include +#define NGX_HTTP_SSI_COMMAND_LEN 31 +#define NGX_HTTP_SSI_PARAM_LEN 31 + +#define NGX_HTTP_SSI_DONE 1 +#define NGX_HTTP_SSI_INVALID_COMMAND 2 +#define NGX_HTTP_SSI_INVALID_PARAM 3 +#define NGX_HTTP_SSI_INVALID_VALUE 4 +#define NGX_HTTP_SSI_LONG_VALUE 5 + + typedef struct { -} ngx_http_ssi_filter_ctx_t; + ngx_table_elt_t *param; + ngx_str_t command; + ngx_array_t params; + int state; + int looked; + char *pos; + ngx_chain_t *out; + int new_hunk; + u_int value_len; +} ngx_http_ssi_ctx_t; static int ngx_http_ssi_filter_init(ngx_cycle_t *cycle); @@ -37,12 +56,49 @@ static int (*next_header_filter) (ngx_ht static int (*next_body_filter) (ngx_http_request_t *r, ngx_chain_t *ch); -static comment_string = "