comparison src/http/ngx_http_copy_filter_module.c @ 118:644a7935144b NGINX_0_3_6

nginx 0.3.6 *) Change: now the IMAP/POP3 proxy do not send the empty login to authorization server. *) Feature: the "log_format" supports the variables in the $name form. *) Bugfix: if at least in one server was no the "listen" directive, then nginx did not listen on the 80 port; bug appeared in 0.3.3. *) Bugfix: if the URI part is omitted in "proxy_pass" directive, the the 80 port was always used.
author Igor Sysoev <http://sysoev.ru>
date Mon, 24 Oct 2005 00:00:00 +0400
parents 71c46860eb55
children 91372f004adf
comparison
equal deleted inserted replaced
117:0821ea4ccfc5 118:644a7935144b
68 68
69 69
70 static ngx_int_t 70 static ngx_int_t
71 ngx_http_copy_filter(ngx_http_request_t *r, ngx_chain_t *in) 71 ngx_http_copy_filter(ngx_http_request_t *r, ngx_chain_t *in)
72 { 72 {
73 ngx_int_t rc;
74 ngx_output_chain_ctx_t *ctx; 73 ngx_output_chain_ctx_t *ctx;
75 ngx_http_copy_filter_conf_t *conf; 74 ngx_http_copy_filter_conf_t *conf;
76 75
77 ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, 76 ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
78 "copy filter: \"%V\"", &r->uri); 77 "copy filter: \"%V\"", &r->uri);
79
80 if (r->connection->closed) {
81 rc = ngx_http_next_filter(r, in);
82
83 ngx_log_debug2(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
84 "copy closed filter: %i \"%V\"", rc, &r->uri);
85 return rc;
86 }
87 78
88 ctx = ngx_http_get_module_ctx(r, ngx_http_copy_filter_module); 79 ctx = ngx_http_get_module_ctx(r, ngx_http_copy_filter_module);
89 80
90 if (ctx == NULL) { 81 if (ctx == NULL) {
91 conf = ngx_http_get_module_loc_conf(r, ngx_http_copy_filter_module); 82 conf = ngx_http_get_module_loc_conf(r, ngx_http_copy_filter_module);
109 ctx->output_filter = (ngx_output_chain_filter_pt) ngx_http_next_filter; 100 ctx->output_filter = (ngx_output_chain_filter_pt) ngx_http_next_filter;
110 ctx->filter_ctx = r; 101 ctx->filter_ctx = r;
111 102
112 } 103 }
113 104
114 rc = ngx_output_chain(ctx, in); 105 /* the request pool may be already destroyed after ngx_output_chain()*/
115 106
116 ngx_log_debug2(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, 107 return ngx_output_chain(ctx, in);
117 "copy filter: %i \"%V\"", rc, &r->uri);
118
119 return rc;
120 } 108 }
121 109
122 110
123 static void * 111 static void *
124 ngx_http_copy_filter_create_conf(ngx_conf_t *cf) 112 ngx_http_copy_filter_create_conf(ngx_conf_t *cf)