Mercurial > hg > nginx-vendor-0-7
comparison src/http/ngx_http_copy_filter_module.c @ 132:91372f004adf NGINX_0_3_13
nginx 0.3.13
*) Feature: the IMAP/POP3 proxy supports STARTTLS and STLS.
*) Bugfix: the IMAP/POP3 proxy did not work with the select, poll, and
/dev/poll methods.
*) Bugfix: in SSI handling.
*) Bugfix: now Solaris sendfilev() is not used to transfer the client
request body to FastCGI-server via the unix domain socket.
*) Bugfix: the "auth_basic" directive did not disable the
authorization; bug appeared in 0.3.11.
author | Igor Sysoev <http://sysoev.ru> |
---|---|
date | Mon, 05 Dec 2005 00:00:00 +0300 |
parents | 644a7935144b |
children | fa32d59d9a15 |
comparison
equal
deleted
inserted
replaced
131:add6b1e86d38 | 132:91372f004adf |
---|---|
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_connection_t *c; | |
73 ngx_output_chain_ctx_t *ctx; | 75 ngx_output_chain_ctx_t *ctx; |
74 ngx_http_copy_filter_conf_t *conf; | 76 ngx_http_copy_filter_conf_t *conf; |
75 | 77 |
76 ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, | 78 c = r->connection; |
77 "copy filter: \"%V\"", &r->uri); | 79 |
80 ngx_log_debug2(NGX_LOG_DEBUG_HTTP, c->log, 0, | |
81 "copy filter: \"%V?%V\"", &r->uri, &r->args); | |
78 | 82 |
79 ctx = ngx_http_get_module_ctx(r, ngx_http_copy_filter_module); | 83 ctx = ngx_http_get_module_ctx(r, ngx_http_copy_filter_module); |
80 | 84 |
81 if (ctx == NULL) { | 85 if (ctx == NULL) { |
82 conf = ngx_http_get_module_loc_conf(r, ngx_http_copy_filter_module); | 86 conf = ngx_http_get_module_loc_conf(r, ngx_http_copy_filter_module); |
86 return NGX_ERROR; | 90 return NGX_ERROR; |
87 } | 91 } |
88 | 92 |
89 ngx_http_set_ctx(r, ctx, ngx_http_copy_filter_module); | 93 ngx_http_set_ctx(r, ctx, ngx_http_copy_filter_module); |
90 | 94 |
91 ctx->sendfile = r->connection->sendfile; | 95 ctx->sendfile = c->sendfile; |
92 ctx->need_in_memory = r->main_filter_need_in_memory | 96 ctx->need_in_memory = r->main_filter_need_in_memory |
93 || r->filter_need_in_memory; | 97 || r->filter_need_in_memory; |
94 ctx->need_in_temp = r->filter_need_temporary; | 98 ctx->need_in_temp = r->filter_need_temporary; |
95 | 99 |
96 ctx->pool = r->pool; | 100 ctx->pool = r->pool; |
100 ctx->output_filter = (ngx_output_chain_filter_pt) ngx_http_next_filter; | 104 ctx->output_filter = (ngx_output_chain_filter_pt) ngx_http_next_filter; |
101 ctx->filter_ctx = r; | 105 ctx->filter_ctx = r; |
102 | 106 |
103 } | 107 } |
104 | 108 |
105 /* the request pool may be already destroyed after ngx_output_chain()*/ | 109 rc = ngx_output_chain(ctx, in); |
106 | 110 |
107 return ngx_output_chain(ctx, in); | 111 #if (NGX_DEBUG) |
112 if (!c->destroyed) { | |
113 ngx_log_debug3(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, | |
114 "copy filter: %i \"%V?%V\"", rc, &r->uri, &r->args); | |
115 } | |
116 #endif | |
117 | |
118 return rc; | |
108 } | 119 } |
109 | 120 |
110 | 121 |
111 static void * | 122 static void * |
112 ngx_http_copy_filter_create_conf(ngx_conf_t *cf) | 123 ngx_http_copy_filter_create_conf(ngx_conf_t *cf) |