ASF Bugzilla – Attachment 24461 Details for
Bug 47087
Incorrect request body handling with Expect: 100-continue if the client does not receive a transmitted 300 or 400 response prior to sending its body
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Amended experimental patch
47087.patch (text/plain), 2.53 KB, created by
Nick Kew
on 2009-11-02 08:13:22 UTC
(
hide
)
Description:
Amended experimental patch
Filename:
MIME Type:
Creator:
Nick Kew
Created:
2009-11-02 08:13:22 UTC
Size:
2.53 KB
patch
obsolete
>Index: server/protocol.c >=================================================================== >--- server/protocol.c (revision 831907) >+++ server/protocol.c (working copy) >@@ -1682,6 +1682,7 @@ > { > hdr_ptr x; > char *status_line = NULL; >+ request_rec *rr; > > if (r->proto_num < 1001) { > /* don't send interim response to HTTP/1.0 Client */ >@@ -1701,6 +1702,14 @@ > return; > } > >+ /* if we send an interim response, we're no longer in a state of >+ * expecting one. Also, this could feasibly be in a subrequest, >+ * so we need to propagate the fact that we responded. >+ */ >+ for (rr = r; rr != NULL; rr = rr->main) { >+ rr->expecting_100 = 0; >+ } >+ > status_line = apr_pstrcat(r->pool, AP_SERVER_PROTOCOL, " ", r->status_line, CRLF, NULL); > ap_xlate_proto_to_ascii(status_line, strlen(status_line)); > >Index: modules/http/http_protocol.c >=================================================================== >--- modules/http/http_protocol.c (revision 831907) >+++ modules/http/http_protocol.c (working copy) >@@ -180,6 +180,9 @@ > * body should use the HTTP/1.1 chunked transfer-coding. In English, > * > * IF we have not marked this connection as errored; >+ * and the client isn't expecting 100-continue (PR47087 - more >+ * input here could be the client continuing when we're >+ * closing the request). > * and the response body has a defined length due to the status code > * being 304 or 204, the request method being HEAD, already > * having defined Content-Length or Transfer-Encoding: chunked, or >@@ -201,6 +204,7 @@ > * Note that the condition evaluation order is extremely important. > */ > if ((r->connection->keepalive != AP_CONN_CLOSE) >+ && !r->expecting_100 > && ((r->status == HTTP_NOT_MODIFIED) > || (r->status == HTTP_NO_CONTENT) > || r->header_only >Index: modules/http/http_filters.c >=================================================================== >--- modules/http/http_filters.c (revision 831907) >+++ modules/http/http_filters.c (working copy) >@@ -330,6 +330,10 @@ > char *tmp; > int len; > >+ /* if we send an interim response, we're no longer >+ * in a state of expecting one. >+ */ >+ f->r->expecting_100 = 0; > tmp = apr_pstrcat(f->r->pool, AP_SERVER_PROTOCOL, " ", > ap_get_status_line(HTTP_CONTINUE), CRLF CRLF, > NULL);
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 47087
:
24460
| 24461