Skip to content

Commit db28bf0

Browse files
author
Justin Erenkrantz
committed
Adds support for reading trailers on input by exporting get_mime_headers
to ap_get_mime_headers and calling it in the appropriate place in ap_http_filter. showstoppers--; git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94667 13f79535-47bb-0310-9956-ffa450edef68
1 parent 2663fac commit db28bf0

5 files changed

Lines changed: 16 additions & 6 deletions

File tree

CHANGES

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
Changes with Apache 2.0.36
22

3+
*) Add HTTP chunked input trailer support. [Justin Erenkrantz]
4+
5+
*) Rename and export get_mime_headers as ap_get_mime_headers.
6+
[Justin Erenkrantz]
7+
38
*) Allow empty Host: header arguments. PR 7441. [Justin Erenkrantz]
49

510
*) Properly substitute sbindir as httpd's location in apachectl. PR 7840.

STATUS

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
APACHE 2.0 STATUS: -*-text-*-
2-
Last modified at [$Date: 2002/04/13 00:50:20 $]
2+
Last modified at [$Date: 2002/04/16 05:43:08 $]
33

44
Release:
55

@@ -52,8 +52,6 @@ RELEASE SHOWSTOPPERS:
5252
* Daedalus segfaults with 2.0.35
5353
Greg and Cliff are working on this.
5454

55-
* HTTP chunk reads fail to read the trailers.
56-
5755
CURRENT VOTES:
5856

5957
* Should we always build [support*] binaries statically unless otherwise

include/http_protocol.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,12 @@ AP_DECLARE_DATA extern ap_filter_rec_t *ap_old_write_func;
9191
*/
9292
request_rec *ap_read_request(conn_rec *c);
9393

94+
/**
95+
* Read the mime-encoded headers.
96+
* @param r The current request
97+
*/
98+
void ap_get_mime_headers(request_rec *r);
99+
94100
/* Finish up stuff after a request */
95101

96102
/**

modules/http/http_protocol.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -766,7 +766,8 @@ apr_status_t ap_http_filter(ap_filter_t *f, apr_bucket_brigade *b,
766766
ctx->remaining = get_chunk_size(line);
767767

768768
if (!ctx->remaining) {
769-
/* Handle trailers by calling get_mime_headers again! */
769+
/* Handle trailers by calling ap_get_mime_headers again! */
770+
ap_get_mime_headers(f->r);
770771
e = apr_bucket_eos_create(c->bucket_alloc);
771772
APR_BRIGADE_INSERT_TAIL(b, e);
772773
return APR_SUCCESS;

server/protocol.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -716,7 +716,7 @@ static int read_request_line(request_rec *r)
716716
return 1;
717717
}
718718

719-
static void get_mime_headers(request_rec *r)
719+
void ap_get_mime_headers(request_rec *r)
720720
{
721721
char* field;
722722
char *value;
@@ -856,7 +856,7 @@ request_rec *ap_read_request(conn_rec *conn)
856856
}
857857

858858
if (!r->assbackwards) {
859-
get_mime_headers(r);
859+
ap_get_mime_headers(r);
860860
if (r->status != HTTP_REQUEST_TIME_OUT) {
861861
ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, 0, r,
862862
"request failed: error reading the headers");

0 commit comments

Comments
 (0)