Mercurial > hg > nginx
comparison src/http/modules/proxy/ngx_http_proxy_handler.c @ 298:4a3f18406832
nginx-0.0.3-2004-03-30-10:27:36 import
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Tue, 30 Mar 2004 06:27:36 +0000 |
parents | a472bfb778b3 |
children | 00c5660d2707 |
comparison
equal
deleted
inserted
replaced
297:ee394e997c77 | 298:4a3f18406832 |
---|---|
372 | 372 |
373 #endif | 373 #endif |
374 } | 374 } |
375 | 375 |
376 | 376 |
377 void ngx_http_proxy_check_broken_connection(ngx_event_t *wev) | 377 void ngx_http_proxy_check_broken_connection(ngx_event_t *ev) |
378 { | 378 { |
379 ngx_connection_t *c; | 379 ngx_connection_t *c; |
380 ngx_http_request_t *r; | 380 ngx_http_request_t *r; |
381 ngx_http_proxy_ctx_t *p; | 381 ngx_http_proxy_ctx_t *p; |
382 | 382 |
383 ngx_log_debug0(NGX_LOG_DEBUG_HTTP, wev->log, 0, "http proxy check client"); | 383 ngx_log_debug1(NGX_LOG_DEBUG_HTTP, ev->log, 0, |
384 | 384 "http proxy check client, write event:%d", ev->write); |
385 c = wev->data; | 385 |
386 c = ev->data; | |
386 r = c->data; | 387 r = c->data; |
387 p = ngx_http_get_module_ctx(r, ngx_http_proxy_module); | 388 p = ngx_http_get_module_ctx(r, ngx_http_proxy_module); |
388 | 389 |
389 #if (HAVE_KQUEUE) | 390 #if (HAVE_KQUEUE) |
390 if (wev->kq_eof) { | 391 if (ev->kq_eof) { |
391 wev->eof = 1; | 392 ev->eof = 1; |
392 | 393 |
393 if (wev->kq_errno) { | 394 if (ev->kq_errno) { |
394 wev->error = 1; | 395 ev->error = 1; |
395 } | 396 } |
396 | 397 |
397 if (!p->cachable && p->upstream->peer.connection) { | 398 if (!p->cachable && p->upstream->peer.connection) { |
398 ngx_log_error(NGX_LOG_INFO, wev->log, wev->kq_errno, | 399 ngx_log_error(NGX_LOG_INFO, ev->log, ev->kq_errno, |
399 "kevent() reported that client have closed " | 400 "kevent() reported that client have closed " |
400 "prematurely connection, " | 401 "prematurely connection, " |
401 "so upstream connection is closed too"); | 402 "so upstream connection is closed too"); |
402 ngx_http_proxy_finalize_request(p, NGX_HTTP_CLIENT_CLOSED_REQUEST); | 403 ngx_http_proxy_finalize_request(p, NGX_HTTP_CLIENT_CLOSED_REQUEST); |
403 return; | 404 return; |
404 } | 405 } |
405 | 406 |
406 ngx_log_error(NGX_LOG_INFO, wev->log, wev->kq_errno, | 407 ngx_log_error(NGX_LOG_INFO, ev->log, ev->kq_errno, |
407 "kevent() reported that client have closed " | 408 "kevent() reported that client have closed " |
408 "prematurely connection"); | 409 "prematurely connection"); |
409 | 410 |
410 if (p->upstream == NULL || p->upstream->peer.connection == NULL) { | 411 if (p->upstream == NULL || p->upstream->peer.connection == NULL) { |
411 ngx_http_proxy_finalize_request(p, NGX_HTTP_CLIENT_CLOSED_REQUEST); | 412 ngx_http_proxy_finalize_request(p, NGX_HTTP_CLIENT_CLOSED_REQUEST); |