From 91189ca77aac1f8fd470a53a0eea24fc9b084fbf Mon Sep 17 00:00:00 2001 From: Stefan Eissing Date: Wed, 17 Jul 2019 13:54:47 +0000 Subject: [PATCH] mod_http2: update log tags, log field len errors at INFO level (via mkaufmann) mod_proxy_http2: udpate log tags git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1863221 13f79535-47bb-0310-9956-ffa450edef68 --- docs/log-message-tags/next-number | 2 +- modules/http2/h2_proxy_session.c | 2 +- modules/http2/h2_stream.c | 26 ++++++++++++++++++-------- modules/http2/h2_stream.h | 4 ++++ modules/http2/h2_version.h | 4 ++-- 5 files changed, 26 insertions(+), 12 deletions(-) diff --git a/docs/log-message-tags/next-number b/docs/log-message-tags/next-number index 4dbfac81bb..f82ef2950c 100644 --- a/docs/log-message-tags/next-number +++ b/docs/log-message-tags/next-number @@ -1 +1 @@ -10178 +10183 diff --git a/modules/http2/h2_proxy_session.c b/modules/http2/h2_proxy_session.c index 3246ce1af4..97a4a2a784 100644 --- a/modules/http2/h2_proxy_session.c +++ b/modules/http2/h2_proxy_session.c @@ -557,7 +557,7 @@ static ssize_t stream_request_data(nghttp2_session *ngh2, int32_t stream_id, " total, flags=%d", stream->id, (long)readlen, (long)stream->data_sent, (int)*data_flags); if ((*data_flags & NGHTTP2_DATA_FLAG_EOF) && !apr_is_empty_table(stream->r->trailers_in)) { - ap_log_rerror(APLOG_MARK, APLOG_DEBUG, status, stream->r, APLOGNO(03468) + ap_log_rerror(APLOG_MARK, APLOG_DEBUG, status, stream->r, APLOGNO(10179) "h2_proxy_stream(%d): submit trailers", stream->id); *data_flags |= NGHTTP2_DATA_FLAG_NO_END_STREAM; submit_trailers(stream); diff --git a/modules/http2/h2_stream.c b/modules/http2/h2_stream.c index 0b2fdb1f6a..ddbf73b1e5 100644 --- a/modules/http2/h2_stream.c +++ b/modules/http2/h2_stream.c @@ -397,7 +397,7 @@ apr_status_t h2_stream_send_frame(h2_stream *stream, int ftype, int flags, size_ /* start pushed stream */ ap_assert(stream->request == NULL); ap_assert(stream->rtmp != NULL); - status = h2_request_end_headers(stream->rtmp, stream->pool, 1, 0); + status = h2_stream_end_headers(stream, 1, 0); if (status != APR_SUCCESS) { return status; } @@ -455,7 +455,7 @@ apr_status_t h2_stream_recv_frame(h2_stream *stream, int ftype, int flags, size_ * to abort the connection here, since this is clearly a protocol error */ return APR_EINVAL; } - status = h2_request_end_headers(stream->rtmp, stream->pool, eos, frame_len); + status = h2_stream_end_headers(stream, eos, frame_len); if (status != APR_SUCCESS) { return status; } @@ -704,15 +704,19 @@ apr_status_t h2_stream_add_header(h2_stream *stream, if (name[0] == ':') { if ((vlen) > session->s->limit_req_line) { /* pseudo header: approximation of request line size check */ - ap_log_cerror(APLOG_MARK, APLOG_TRACE1, 0, session->c, - H2_STRM_MSG(stream, "pseudo %s too long"), name); + ap_log_cerror(APLOG_MARK, APLOG_INFO, 0, session->c, + H2_STRM_LOG(APLOGNO(10178), stream, + "Request pseudo header exceeds " + "LimitRequestFieldSize: %s"), name); error = HTTP_REQUEST_URI_TOO_LARGE; } } else if ((nlen + 2 + vlen) > session->s->limit_req_fieldsize) { /* header too long */ - ap_log_cerror(APLOG_MARK, APLOG_TRACE1, 0, session->c, - H2_STRM_MSG(stream, "header %s too long"), name); + ap_log_cerror(APLOG_MARK, APLOG_INFO, 0, session->c, + H2_STRM_LOG(APLOGNO(10180), stream,"Request header exceeds " + "LimitRequestFieldSize: %.*s"), + (int)H2MIN(nlen, 80), name); error = HTTP_REQUEST_HEADER_FIELDS_TOO_LARGE; } @@ -724,8 +728,9 @@ apr_status_t h2_stream_add_header(h2_stream *stream, h2_stream_rst(stream, H2_ERR_ENHANCE_YOUR_CALM); return APR_ECONNRESET; } - ap_log_cerror(APLOG_MARK, APLOG_TRACE1, 0, session->c, - H2_STRM_MSG(stream, "too many header lines")); + ap_log_cerror(APLOG_MARK, APLOG_INFO, 0, session->c, + H2_STRM_LOG(APLOGNO(10181), stream, "Number of request headers " + "exceeds LimitRequestFields")); error = HTTP_REQUEST_HEADER_FIELDS_TOO_LARGE; } @@ -756,6 +761,11 @@ apr_status_t h2_stream_add_header(h2_stream *stream, return status; } +apr_status_t h2_stream_end_headers(h2_stream *stream, int eos, size_t raw_bytes) +{ + return h2_request_end_headers(stream->rtmp, stream->pool, eos, raw_bytes); +} + static apr_bucket *get_first_headers_bucket(apr_bucket_brigade *bb) { if (bb) { diff --git a/modules/http2/h2_stream.h b/modules/http2/h2_stream.h index 7ecc0ad6bc..79cb39dd41 100644 --- a/modules/http2/h2_stream.h +++ b/modules/http2/h2_stream.h @@ -198,6 +198,10 @@ apr_status_t h2_stream_set_request_rec(h2_stream *stream, apr_status_t h2_stream_add_header(h2_stream *stream, const char *name, size_t nlen, const char *value, size_t vlen); + +/* End the contruction of request headers */ +apr_status_t h2_stream_end_headers(h2_stream *stream, int eos, size_t raw_bytes); + apr_status_t h2_stream_send_frame(h2_stream *stream, int frame_type, int flags, size_t frame_len); apr_status_t h2_stream_recv_frame(h2_stream *stream, int frame_type, int flags, size_t frame_len); diff --git a/modules/http2/h2_version.h b/modules/http2/h2_version.h index e5a9dca3fd..ac7db08b91 100644 --- a/modules/http2/h2_version.h +++ b/modules/http2/h2_version.h @@ -27,7 +27,7 @@ * @macro * Version number of the http2 module as c string */ -#define MOD_HTTP2_VERSION "1.15.3" +#define MOD_HTTP2_VERSION "1.15.4" /** * @macro @@ -35,7 +35,7 @@ * release. This is a 24 bit number with 8 bits for major number, 8 bits * for minor and 8 bits for patch. Version 1.2.3 becomes 0x010203. */ -#define MOD_HTTP2_VERSION_NUM 0x010f03 +#define MOD_HTTP2_VERSION_NUM 0x010f04 #endif /* mod_h2_h2_version_h */ -- 2.50.1