comparison src/http/ngx_http_request.c @ 146:36af50a5582d NGINX_0_3_20

nginx 0.3.20 *) Bugfix: in SSI handling. *) Bugfix: the ngx_http_memcached_module did not support the keys in the "/usr?args" form.
author Igor Sysoev <http://sysoev.ru>
date Wed, 11 Jan 2006 00:00:00 +0300
parents 84910468f6de
children bb61aa162c6b
comparison
equal deleted inserted replaced
145:85a84f8da62b 146:36af50a5582d
1421 if (rc == NGX_HTTP_CLOSE) { 1421 if (rc == NGX_HTTP_CLOSE) {
1422 ngx_http_close_request(r, rc); 1422 ngx_http_close_request(r, rc);
1423 return; 1423 return;
1424 } 1424 }
1425 1425
1426 if (r->main == r) { 1426 if (r == r->main) {
1427 if (r->connection->read->timer_set) { 1427 if (r->connection->read->timer_set) {
1428 ngx_del_timer(r->connection->read); 1428 ngx_del_timer(r->connection->read);
1429 } 1429 }
1430 1430
1431 if (r->connection->write->timer_set) { 1431 if (r->connection->write->timer_set) {
1436 ngx_http_finalize_request(r, ngx_http_special_response_handler(r, rc)); 1436 ngx_http_finalize_request(r, ngx_http_special_response_handler(r, rc));
1437 1437
1438 return; 1438 return;
1439 } 1439 }
1440 1440
1441 if (r->main != r || rc == NGX_AGAIN) { 1441 if (r != r->main || rc == NGX_AGAIN) {
1442 if (ngx_http_set_write_handler(r) != NGX_OK) { 1442 if (ngx_http_set_write_handler(r) != NGX_OK) {
1443 return; 1443 return;
1444 } 1444 }
1445 } 1445 }
1446 1446
1451 "http finalize non-active request: \"%V?%V\"", 1451 "http finalize non-active request: \"%V?%V\"",
1452 &r->uri, &r->args); 1452 &r->uri, &r->args);
1453 return; 1453 return;
1454 } 1454 }
1455 1455
1456 if (r->main != r) { 1456 if (r != r->main) {
1457 1457
1458 pr = r->parent; 1458 pr = r->parent;
1459 1459
1460 ngx_log_debug2(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, 1460 ngx_log_debug2(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
1461 "http parent request: \"%V?%V\"", &pr->uri, &pr->args); 1461 "http parent request: \"%V?%V\"", &pr->uri, &pr->args);
1462 1462
1463 if (rc != NGX_AGAIN) { 1463 if (rc != NGX_AGAIN) {
1464 pr->connection->data = pr; 1464 r->connection->data = pr;
1465 } 1465 }
1466 1466
1467 if (pr->postponed) { 1467 if (pr->postponed) {
1468 1468
1469 ngx_log_debug2(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, 1469 ngx_log_debug2(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
1470 "http request: \"%V?%V\" has postponed", 1470 "http request: \"%V?%V\" has postponed",
1471 &pr->uri, &pr->args); 1471 &pr->uri, &pr->args);
1472 1472
1473 if (rc != NGX_AGAIN && pr->postponed->request == r) { 1473 if (rc != NGX_AGAIN && pr->postponed->request == r) {
1474 pr->postponed = pr->postponed->next; 1474 pr->postponed = pr->postponed->next;
1475 1475 }
1476 if (pr->postponed == NULL) { 1476
1477 return; 1477 if (r->fast_subrequest) {
1478 } 1478 ngx_log_debug2(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
1479 } 1479 "http fast subrequest: \"%V?%V\" done",
1480 1480 &r->uri, &r->args);
1481 return;
1482 }
1483
1484 ngx_log_debug2(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
1485 "http wake parent request: \"%V?%V\"",
1486 &pr->uri, &pr->args);
1487
1488 pr->write_event_handler(pr);
1489
1490 #if 0
1481 ngx_log_debug2(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, 1491 ngx_log_debug2(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
1482 "http request: \"%V?%V\" still has postponed", 1492 "http request: \"%V?%V\" still has postponed",
1483 &pr->uri, &pr->args); 1493 &pr->uri, &pr->args);
1484 1494
1485 if (pr->done || pr->postponed->out) { 1495 if (pr->done || pr->postponed->out) {
1487 "http wake parent request: \"%V?%V\"", 1497 "http wake parent request: \"%V?%V\"",
1488 &pr->uri, &pr->args); 1498 &pr->uri, &pr->args);
1489 1499
1490 pr->write_event_handler(pr); 1500 pr->write_event_handler(pr);
1491 } 1501 }
1502 #endif
1503
1492 } 1504 }
1493 1505
1494 return; 1506 return;
1495 } 1507 }
1496 1508
1497 if (rc == NGX_AGAIN) { 1509 if (rc == NGX_AGAIN) {
1498 return; 1510 return;
1499 } 1511 }
1500 1512
1501 if (r->out) { 1513 if (r->connection->buffered) {
1502 (void) ngx_http_set_write_handler(r); 1514 (void) ngx_http_set_write_handler(r);
1503 return; 1515 return;
1504 } 1516 }
1505 1517
1506 clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module); 1518 clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module);
1653 1665
1654 if (ngx_handle_write_event(wev, clcf->send_lowat) == NGX_ERROR) { 1666 if (ngx_handle_write_event(wev, clcf->send_lowat) == NGX_ERROR) {
1655 ngx_http_close_request(r, 0); 1667 ngx_http_close_request(r, 0);
1656 } 1668 }
1657 1669
1658 return; 1670 if (r == r->main) {
1671 return;
1672 }
1673
1674 rc = NGX_OK;
1659 } 1675 }
1660 1676
1661 ngx_log_debug2(NGX_LOG_DEBUG_HTTP, wev->log, 0, 1677 ngx_log_debug2(NGX_LOG_DEBUG_HTTP, wev->log, 0,
1662 "http writer done: \"%V?%V\"", &r->uri, &r->args); 1678 "http writer done: \"%V?%V\"", &r->uri, &r->args);
1663 1679
1689 ngx_http_discard_body(ngx_http_request_t *r) 1705 ngx_http_discard_body(ngx_http_request_t *r)
1690 { 1706 {
1691 ssize_t size; 1707 ssize_t size;
1692 ngx_event_t *rev; 1708 ngx_event_t *rev;
1693 1709
1694 if (r->main != r) { 1710 if (r != r->main) {
1695 return NGX_OK; 1711 return NGX_OK;
1696 } 1712 }
1697 1713
1698 rev = r->connection->read; 1714 rev = r->connection->read;
1699 1715