You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by jo...@apache.org on 2024/03/19 08:38:01 UTC

svn commit: r1916413 - in /httpd/httpd/branches/2.4.x: ./ changes-entries/h2_date_and_bucket_leak.txt modules/http2/h2_headers.c modules/http2/h2_request.c

Author: jorton
Date: Tue Mar 19 08:38:00 2024
New Revision: 1916413

URL: http://svn.apache.org/viewvc?rev=1916413&view=rev
Log:
Merge r1915281 from trunk:

  *) mod_http2: v2.0.26 with the following fixes:
     - Fixed `Date` header on requests upgraded from HTTP/1.1 (h2c). Fixes
       <https://github.com/icing/mod_h2/issues/272>.
     - Fixed small memory leak in h2 header bucket free. Thanks to
       Michael Kaufmann for finding this and providing the fix.

Submitted by: icing
Reviewed by: icing, gbechis, jorton

Added:
    httpd/httpd/branches/2.4.x/changes-entries/h2_date_and_bucket_leak.txt
      - copied unchanged from r1915281, httpd/httpd/trunk/changes-entries/h2_date_and_bucket_leak.txt
Modified:
    httpd/httpd/branches/2.4.x/   (props changed)
    httpd/httpd/branches/2.4.x/modules/http2/h2_headers.c
    httpd/httpd/branches/2.4.x/modules/http2/h2_request.c

Propchange: httpd/httpd/branches/2.4.x/
------------------------------------------------------------------------------
  Merged /httpd/httpd/trunk:r1915281

Modified: httpd/httpd/branches/2.4.x/modules/http2/h2_headers.c
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.4.x/modules/http2/h2_headers.c?rev=1916413&r1=1916412&r2=1916413&view=diff
==============================================================================
--- httpd/httpd/branches/2.4.x/modules/http2/h2_headers.c (original)
+++ httpd/httpd/branches/2.4.x/modules/http2/h2_headers.c Tue Mar 19 08:38:00 2024
@@ -90,9 +90,18 @@ h2_headers *h2_bucket_headers_get(apr_bu
     return NULL;
 }
 
+static void bucket_destroy(void *data)
+{
+    h2_bucket_headers *h = data;
+
+    if (apr_bucket_shared_destroy(h)) {
+        apr_bucket_free(h);
+    }
+}
+
 const apr_bucket_type_t h2_bucket_type_headers = {
     "H2HEADERS", 5, APR_BUCKET_METADATA,
-    apr_bucket_destroy_noop,
+    bucket_destroy,
     bucket_read,
     apr_bucket_setaside_noop,
     apr_bucket_split_notimpl,

Modified: httpd/httpd/branches/2.4.x/modules/http2/h2_request.c
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.4.x/modules/http2/h2_request.c?rev=1916413&r1=1916412&r2=1916413&view=diff
==============================================================================
--- httpd/httpd/branches/2.4.x/modules/http2/h2_request.c (original)
+++ httpd/httpd/branches/2.4.x/modules/http2/h2_request.c Tue Mar 19 08:38:00 2024
@@ -120,6 +120,7 @@ apr_status_t h2_request_rcreate(h2_reque
     req->path        = path;
     req->headers     = apr_table_make(pool, 10);
     req->http_status = H2_HTTP_STATUS_UNSET;
+    req->request_time = apr_time_now();
 
     x.pool = pool;
     x.headers = req->headers;