Changeset feb0c3 for server/src/http/ngx_http_request_body.c
- Timestamp:
- 02/03/09 19:54:45 (3 years ago)
- Branches:
- master-v0.6, nginx-v0.6
- Children:
- 209e69, 6c857c, e8c363f79fad03918abb189d5a026fd0cd6d14f4
- Parents:
- 60af37
- git-author:
- George Potapov <nephrite@…> (02/03/09 19:54:45)
- git-committer:
- George Potapov <nephrite@…> (02/03/09 19:54:45)
- 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
rb57b1b rfeb0c3 17 17 static void ngx_http_read_discarded_request_body_handler(ngx_http_request_t *r); 18 18 static ngx_int_t ngx_http_read_discarded_request_body(ngx_http_request_t *r); 19 static ngx_int_t ngx_http_test_expect(ngx_http_request_t *r); 19 20 20 21 … … 41 42 post_handler(r); 42 43 return NGX_OK; 44 } 45 46 if (ngx_http_test_expect(r) != NGX_OK) { 47 return NGX_HTTP_INTERNAL_SERVER_ERROR; 43 48 } 44 49 … … 435 440 } 436 441 442 if (ngx_http_test_expect(r) != NGX_OK) { 443 return NGX_HTTP_INTERNAL_SERVER_ERROR; 444 } 445 437 446 rev = r->connection->read; 438 447 … … 583 592 return NGX_AGAIN; 584 593 } 594 595 596 static ngx_int_t 597 ngx_http_test_expect(ngx_http_request_t *r) 598 { 599 ngx_int_t n; 600 ngx_str_t *expect; 601 602 if (r->expect_tested 603 || r->headers_in.expect == NULL 604 || r->http_version < NGX_HTTP_VERSION_11) 605 { 606 return NGX_OK; 607 } 608 609 r->expect_tested = 1; 610 611 expect = &r->headers_in.expect->value; 612 613 if (expect->len != sizeof("100-continue") - 1 614 || ngx_strncasecmp(expect->data, (u_char *) "100-continue", 615 sizeof("100-continue") - 1) 616 != 0) 617 { 618 return NGX_OK; 619 } 620 621 ngx_log_debug0(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, 622 "send 100 Continue"); 623 624 n = r->connection->send(r->connection, 625 (u_char *) "HTTP/1.1 100 Continue" CRLF CRLF, 626 sizeof("HTTP/1.1 100 Continue" CRLF CRLF) - 1); 627 628 if (n == sizeof("HTTP/1.1 100 Continue" CRLF CRLF) - 1) { 629 return NGX_OK; 630 } 631 632 /* we assume that such small packet should be send successfully */ 633 634 return NGX_ERROR; 635 }
Note: See TracChangeset
for help on using the changeset viewer.
