You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by ic...@apache.org on 2016/03/24 17:36:37 UTC

svn commit: r1736463 - in /httpd/httpd/trunk: CHANGES modules/http2/h2_io.c modules/http2/h2_mplx.c modules/http2/h2_task.c modules/http2/h2_task_output.c modules/http2/h2_version.h

Author: icing
Date: Thu Mar 24 16:36:37 2016
New Revision: 1736463

URL: http://svn.apache.org/viewvc?rev=1736463&view=rev
Log:
mod_http2: fix for scoreboard updates missing, mem leak fix for slave connections

Modified:
    httpd/httpd/trunk/CHANGES
    httpd/httpd/trunk/modules/http2/h2_io.c
    httpd/httpd/trunk/modules/http2/h2_mplx.c
    httpd/httpd/trunk/modules/http2/h2_task.c
    httpd/httpd/trunk/modules/http2/h2_task_output.c
    httpd/httpd/trunk/modules/http2/h2_version.h

Modified: httpd/httpd/trunk/CHANGES
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/CHANGES?rev=1736463&r1=1736462&r2=1736463&view=diff
==============================================================================
--- httpd/httpd/trunk/CHANGES [utf-8] (original)
+++ httpd/httpd/trunk/CHANGES [utf-8] Thu Mar 24 16:36:37 2016
@@ -1,6 +1,9 @@
                                                          -*- coding: utf-8 -*-
 Changes with Apache 2.5.0
 
+  *) mod_http2: fix for missing score board updates on request count, fix for
+     memory leak on slave connection reuse.
+     
   *) mod_http2: disabling PUSH when client sends GOAWAY.
   
   *) mod_proxy_http2: using HTTP/2 flow control for backend streams by 

Modified: httpd/httpd/trunk/modules/http2/h2_io.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/http2/h2_io.c?rev=1736463&r1=1736462&r2=1736463&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/http2/h2_io.c (original)
+++ httpd/httpd/trunk/modules/http2/h2_io.c Thu Mar 24 16:36:37 2016
@@ -425,16 +425,6 @@ apr_status_t h2_io_out_write(h2_io *io,
         return APR_ECONNABORTED;
     }
 
-    if (io->eos_out) {
-        apr_off_t len = 0;
-        /* We have already delivered an EOS bucket to a reader, no
-         * sense in storing anything more here.
-         */
-        apr_brigade_length(bb, 0, &len);
-        apr_brigade_cleanup(bb);
-        return (len > 0)? APR_EOF : APR_SUCCESS;
-    }
-
     /* Filter the EOR bucket and set it aside. We prefer to tear down
      * the request when the whole h2 stream is done */
     for (b = APR_BRIGADE_FIRST(bb);

Modified: httpd/httpd/trunk/modules/http2/h2_mplx.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/http2/h2_mplx.c?rev=1736463&r1=1736462&r2=1736463&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/http2/h2_mplx.c (original)
+++ httpd/httpd/trunk/modules/http2/h2_mplx.c Thu Mar 24 16:36:37 2016
@@ -279,6 +279,8 @@ static int io_out_consumed_signal(h2_mpl
 
 static void io_destroy(h2_mplx *m, h2_io *io, int events)
 {
+    int reuse_slave;
+    
     /* cleanup any buffered input */
     h2_io_in_shutdown(io);
     if (events) {
@@ -297,12 +299,16 @@ static void io_destroy(h2_mplx *m, h2_io
         h2_io_set_remove(m->redo_ios, io);
     }
 
+    reuse_slave = ((m->spare_slaves->nelts < m->spare_slaves->nalloc)
+                    && !io->rst_error && io->eor);
     if (io->task) {
         conn_rec *slave = io->task->c;
         h2_task_destroy(io->task);
         io->task = NULL;
         
-        if (m->spare_slaves->nelts < m->spare_slaves->nalloc) {
+        if (reuse_slave) {
+            apr_bucket_delete(io->eor);
+            io->eor = NULL;
             APR_ARRAY_PUSH(m->spare_slaves, conn_rec*) = slave;
         }
         else {
@@ -310,10 +316,6 @@ static void io_destroy(h2_mplx *m, h2_io
         }
     }
 
-    if (io->eor) {
-        apr_bucket_delete(io->eor);
-        io->eor = NULL;
-    }
     if (io->pool) {
         apr_pool_destroy(io->pool);
     }
@@ -1119,6 +1121,8 @@ h2_task *h2_mplx_pop_task(h2_mplx *m, in
 static void task_done(h2_mplx *m, h2_task *task, h2_req_engine *ngn)
 {
     if (task) {
+        h2_io *io = h2_io_set_get(m->stream_ios, task->stream_id);
+        
         if (task->frozen) {
             /* this task was handed over to an engine for processing 
              * and the original worker has finished. That means the 
@@ -1131,8 +1135,6 @@ static void task_done(h2_mplx *m, h2_tas
             apr_thread_cond_broadcast(m->task_thawed);
         }
         else {
-            h2_io *io = h2_io_set_get(m->stream_ios, task->stream_id);
-            
             ap_log_cerror(APLOG_MARK, APLOG_TRACE1, 0, m->c,
                           "h2_mplx(%ld): task(%s) done", m->id, task->id);
             /* clean our references and report request as done. Signal

Modified: httpd/httpd/trunk/modules/http2/h2_task.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/http2/h2_task.c?rev=1736463&r1=1736462&r2=1736463&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/http2/h2_task.c (original)
+++ httpd/httpd/trunk/modules/http2/h2_task.c Thu Mar 24 16:36:37 2016
@@ -245,7 +245,6 @@ static apr_status_t h2_task_process_requ
                       "h2_task(%s): create request_rec failed, r->status=%d", 
                       task->id, r->status);
     }
-    c->sbh = NULL;
 
     return APR_SUCCESS;
 }

Modified: httpd/httpd/trunk/modules/http2/h2_task_output.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/http2/h2_task_output.c?rev=1736463&r1=1736462&r2=1736463&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/http2/h2_task_output.c (original)
+++ httpd/httpd/trunk/modules/http2/h2_task_output.c Thu Mar 24 16:36:37 2016
@@ -20,6 +20,7 @@
 #include <http_core.h>
 #include <http_log.h>
 #include <http_connection.h>
+#include <http_request.h>
 
 #include "h2_private.h"
 #include "h2_conn.h"
@@ -136,6 +137,7 @@ static apr_status_t write_brigade_raw(h2
 apr_status_t h2_task_output_write(h2_task_output *output,
                                   ap_filter_t* f, apr_bucket_brigade* bb)
 {
+    apr_bucket *b;
     apr_status_t status = APR_SUCCESS;
     
     if (APR_BRIGADE_EMPTY(bb)) {
@@ -147,6 +149,16 @@ apr_status_t h2_task_output_write(h2_tas
     if (output->task->frozen) {
         h2_util_bb_log(output->task->c, output->task->stream_id, APLOG_TRACE2,
                        "frozen task output write, ignored", bb);
+        while (!APR_BRIGADE_EMPTY(bb)) {
+            b = APR_BRIGADE_FIRST(bb);
+            if (AP_BUCKET_IS_EOR(b)) {
+                /* TODO: keep it */
+                APR_BUCKET_REMOVE(b);
+            }
+            else {
+                apr_bucket_delete(b);
+            }
+        }
         return APR_SUCCESS;
     }
     

Modified: httpd/httpd/trunk/modules/http2/h2_version.h
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/http2/h2_version.h?rev=1736463&r1=1736462&r2=1736463&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/http2/h2_version.h (original)
+++ httpd/httpd/trunk/modules/http2/h2_version.h Thu Mar 24 16:36:37 2016
@@ -26,7 +26,7 @@
  * @macro
  * Version number of the http2 module as c string
  */
-#define MOD_HTTP2_VERSION "1.4.4-DEV"
+#define MOD_HTTP2_VERSION "1.4.5-DEV"
 
 /**
  * @macro
@@ -34,7 +34,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 0x010404
+#define MOD_HTTP2_VERSION_NUM 0x010405
 
 
 #endif /* mod_h2_h2_version_h */