comparison src/http/modules/proxy/ngx_http_proxy_upstream.c @ 191:71ce40b3c37b

nginx-0.0.1-2003-11-19-19:26:41 import
author Igor Sysoev <igor@sysoev.ru>
date Wed, 19 Nov 2003 16:26:41 +0000
parents 02a715e85df1
children 2357fa41738a
comparison
equal deleted inserted replaced
190:02a715e85df1 191:71ce40b3c37b
208 208
209 static void ngx_http_proxy_init_upstream(void *data) 209 static void ngx_http_proxy_init_upstream(void *data)
210 { 210 {
211 ngx_http_proxy_ctx_t *p = data; 211 ngx_http_proxy_ctx_t *p = data;
212 212
213 ngx_chain_t *cl; 213 ngx_chain_t *cl;
214 ngx_http_request_t *r; 214 ngx_http_request_t *r;
215 ngx_output_chain_ctx_t *octx; 215 ngx_output_chain_ctx_t *octx;
216 ngx_chain_writer_ctx_t *wctx; 216 ngx_chain_writer_ctx_t *wctx;
217 ngx_http_proxy_log_ctx_t *lctx;
217 218
218 r = p->request; 219 r = p->request;
219 220
220 ngx_log_debug(r->connection->log, "timer_set: %d" _ 221 ngx_log_debug(r->connection->log, "timer_set: %d" _
221 r->connection->read->timer_set); 222 r->connection->read->timer_set);
250 cl->next = r->request_hunks; 251 cl->next = r->request_hunks;
251 } 252 }
252 253
253 r->request_hunks = cl; 254 r->request_hunks = cl;
254 255
256 if (!(lctx = ngx_pcalloc(r->pool, sizeof(ngx_http_proxy_log_ctx_t)))) {
257 ngx_http_proxy_finalize_request(p, NGX_HTTP_INTERNAL_SERVER_ERROR);
258 return;
259 }
260 lctx->connection = r->connection->number;
261 lctx->proxy = p;
262
255 p->upstream->peer.log = r->connection->log; 263 p->upstream->peer.log = r->connection->log;
256 p->saved_ctx = r->connection->log->data; 264 p->saved_ctx = r->connection->log->data;
257 p->saved_handler = r->connection->log->handler; 265 p->saved_handler = r->connection->log->handler;
258 r->connection->log->data = p; 266 r->connection->log->data = lctx;
259 r->connection->log->handler = ngx_http_proxy_log_error; 267 r->connection->log->handler = ngx_http_proxy_log_error;
260 p->action = "connecting to upstream"; 268 p->action = "connecting to upstream";
261 269
262 if (!(octx = ngx_pcalloc(r->pool, sizeof(ngx_output_chain_ctx_t)))) { 270 if (!(octx = ngx_pcalloc(r->pool, sizeof(ngx_output_chain_ctx_t)))) {
263 ngx_http_proxy_finalize_request(p, NGX_HTTP_INTERNAL_SERVER_ERROR); 271 ngx_http_proxy_finalize_request(p, NGX_HTTP_INTERNAL_SERVER_ERROR);