Changeset e7b311 for server/src/http/ngx_http_request_body.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_request_body.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
server/src/http/ngx_http_request_body.c
rb82943 re7b311 16 16 static void ngx_http_read_discarded_request_body_handler(ngx_http_request_t *r); 17 17 static ngx_int_t ngx_http_read_discarded_request_body(ngx_http_request_t *r); 18 static ngx_int_t ngx_http_test_expect(ngx_http_request_t *r); 18 19 19 20 … … 40 41 post_handler(r); 41 42 return NGX_OK; 43 } 44 45 if (ngx_http_test_expect(r) != NGX_OK) { 46 return NGX_HTTP_INTERNAL_SERVER_ERROR; 42 47 } 43 48 … … 434 439 } 435 440 441 if (ngx_http_test_expect(r) != NGX_OK) { 442 return NGX_HTTP_INTERNAL_SERVER_ERROR; 443 } 444 436 445 rev = r->connection->read; 437 446 … … 582 591 return NGX_AGAIN; 583 592 } 593 594 595 static ngx_int_t 596 ngx_http_test_expect(ngx_http_request_t *r) 597 { 598 ngx_int_t n; 599 ngx_str_t *expect; 600 601 if (r->expect_tested 602 || r->headers_in.expect == NULL 603 || r->http_version < NGX_HTTP_VERSION_11) 604 { 605 return NGX_OK; 606 } 607 608 r->expect_tested = 1; 609 610 expect = &r->headers_in.expect->value; 611 612 if (expect->len != sizeof("100-continue") - 1 613 || ngx_strncasecmp(expect->data, (u_char *) "100-continue", 614 sizeof("100-continue") - 1) 615 != 0) 616 { 617 return NGX_OK; 618 } 619 620 ngx_log_debug0(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, 621 "send 100 Continue"); 622 623 n = r->connection->send(r->connection, 624 (u_char *) "HTTP/1.1 100 Continue" CRLF CRLF, 625 sizeof("HTTP/1.1 100 Continue" CRLF CRLF) - 1); 626 627 if (n == sizeof("HTTP/1.1 100 Continue" CRLF CRLF) - 1) { 628 return NGX_OK; 629 } 630 631 /* we assume that such small packet should be send successfully */ 632 633 return NGX_ERROR; 634 }
Note: See TracChangeset
for help on using the changeset viewer.
