Changeset e7b311 for server/src/http/ngx_http_core_module.c
- Timestamp:
- 02/03/09 19:41:37 (3 years ago)
- Branches:
- master-v0.7, nginx-v0.7, nginx-v0.8, upstream_count_limit
- Children:
- 2ac4f5
- Parents:
- 2240a4
- git-author:
- George Potapov <nephrite@…> (02/03/09 19:41:37)
- git-committer:
- George Potapov <nephrite@…> (02/03/09 19:41:37)
- File:
-
- 1 edited
-
server/src/http/ngx_http_core_module.c (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
server/src/http/ngx_http_core_module.c
r814e69 re7b311 24 24 static ngx_int_t ngx_http_core_find_static_location(ngx_http_request_t *r, 25 25 ngx_http_location_tree_node_t *node); 26 static ngx_int_t ngx_http_core_send_continue(ngx_http_request_t *r);27 26 28 27 static ngx_int_t ngx_http_core_preconfiguration(ngx_conf_t *cf); … … 819 818 u_char *p; 820 819 size_t len; 821 ngx_int_t rc , expect;820 ngx_int_t rc; 822 821 ngx_http_core_loc_conf_t *clcf; 823 822 … … 861 860 ngx_http_finalize_request(r, NGX_HTTP_REQUEST_ENTITY_TOO_LARGE); 862 861 return NGX_OK; 863 }864 865 if (r->headers_in.expect && r->http_version > NGX_HTTP_VERSION_10) {866 expect = ngx_http_core_send_continue(r);867 868 if (expect != NGX_OK) {869 ngx_http_finalize_request(r, expect);870 return NGX_OK;871 }872 862 } 873 863 … … 1183 1173 } 1184 1174 1175 if (!of.is_file) { 1176 continue; 1177 } 1178 1185 1179 path.len -= root; 1186 1180 path.data += root; … … 1491 1485 1492 1486 1493 static ngx_int_t1494 ngx_http_core_send_continue(ngx_http_request_t *r)1495 {1496 ngx_int_t n;1497 ngx_str_t *expect;1498 1499 if (r->expect_tested) {1500 return NGX_OK;1501 }1502 1503 r->expect_tested = 1;1504 1505 expect = &r->headers_in.expect->value;1506 1507 if (expect->len != sizeof("100-continue") - 11508 || ngx_strncasecmp(expect->data, (u_char *) "100-continue",1509 sizeof("100-continue") - 1)1510 != 0)1511 {1512 return NGX_OK;1513 }1514 1515 ngx_log_debug0(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,1516 "send 100 Continue");1517 1518 n = r->connection->send(r->connection,1519 (u_char *) "HTTP/1.1 100 Continue" CRLF CRLF,1520 sizeof("HTTP/1.1 100 Continue" CRLF CRLF) - 1);1521 1522 if (n == sizeof("HTTP/1.1 100 Continue" CRLF CRLF) - 1) {1523 return NGX_OK;1524 }1525 1526 /* we assume that such small packet should be send successfully */1527 1528 return NGX_HTTP_INTERNAL_SERVER_ERROR;1529 }1530 1531 1532 1487 void * 1533 1488 ngx_http_test_content_type(ngx_http_request_t *r, ngx_hash_t *types_hash) … … 2126 2081 2127 2082 sr->discard_body = r->discard_body; 2083 sr->expect_tested = 1; 2128 2084 sr->main_filter_need_in_memory = r->main_filter_need_in_memory; 2129 2085
Note: See TracChangeset
for help on using the changeset viewer.
