From db28bf04cbc3fa6ce599dce3868c2044af05d516 Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Tue, 16 Apr 2002 05:43:09 +0000 Subject: [PATCH] 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 --- CHANGES | 5 +++++ STATUS | 4 +--- include/http_protocol.h | 6 ++++++ modules/http/http_protocol.c | 3 ++- server/protocol.c | 4 ++-- 5 files changed, 16 insertions(+), 6 deletions(-) diff --git a/CHANGES b/CHANGES index 8e72a5232e..ce1ba2cec5 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,10 @@ Changes with Apache 2.0.36 + *) Add HTTP chunked input trailer support. [Justin Erenkrantz] + + *) Rename and export get_mime_headers as ap_get_mime_headers. + [Justin Erenkrantz] + *) Allow empty Host: header arguments. PR 7441. [Justin Erenkrantz] *) Properly substitute sbindir as httpd's location in apachectl. PR 7840. diff --git a/STATUS b/STATUS index 072563f6a9..127b2fdb4e 100644 --- a/STATUS +++ b/STATUS @@ -1,5 +1,5 @@ APACHE 2.0 STATUS: -*-text-*- -Last modified at [$Date: 2002/04/13 00:50:20 $] +Last modified at [$Date: 2002/04/16 05:43:08 $] Release: @@ -52,8 +52,6 @@ RELEASE SHOWSTOPPERS: * Daedalus segfaults with 2.0.35 Greg and Cliff are working on this. - * HTTP chunk reads fail to read the trailers. - CURRENT VOTES: * Should we always build [support*] binaries statically unless otherwise diff --git a/include/http_protocol.h b/include/http_protocol.h index 5ad071fa8f..28402a1216 100644 --- a/include/http_protocol.h +++ b/include/http_protocol.h @@ -91,6 +91,12 @@ AP_DECLARE_DATA extern ap_filter_rec_t *ap_old_write_func; */ request_rec *ap_read_request(conn_rec *c); +/** + * Read the mime-encoded headers. + * @param r The current request + */ +void ap_get_mime_headers(request_rec *r); + /* Finish up stuff after a request */ /** diff --git a/modules/http/http_protocol.c b/modules/http/http_protocol.c index 119dbfaa8a..f79c0f0773 100644 --- a/modules/http/http_protocol.c +++ b/modules/http/http_protocol.c @@ -766,7 +766,8 @@ apr_status_t ap_http_filter(ap_filter_t *f, apr_bucket_brigade *b, ctx->remaining = get_chunk_size(line); if (!ctx->remaining) { - /* Handle trailers by calling get_mime_headers again! */ + /* Handle trailers by calling ap_get_mime_headers again! */ + ap_get_mime_headers(f->r); e = apr_bucket_eos_create(c->bucket_alloc); APR_BRIGADE_INSERT_TAIL(b, e); return APR_SUCCESS; diff --git a/server/protocol.c b/server/protocol.c index 5ec855ec07..01cbb1a7c6 100644 --- a/server/protocol.c +++ b/server/protocol.c @@ -716,7 +716,7 @@ static int read_request_line(request_rec *r) return 1; } -static void get_mime_headers(request_rec *r) +void ap_get_mime_headers(request_rec *r) { char* field; char *value; @@ -856,7 +856,7 @@ request_rec *ap_read_request(conn_rec *conn) } if (!r->assbackwards) { - get_mime_headers(r); + ap_get_mime_headers(r); if (r->status != HTTP_REQUEST_TIME_OUT) { ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, 0, r, "request failed: error reading the headers"); -- 2.40.0