Blame SOURCES/mod_http2-1.15.7-CVE-2020-11993.patch

8c7287
diff --git a/mod_http2/h2_mplx.c b/mod_http2/h2_mplx.c
8c7287
index c3d590d..33ea45e 100644
8c7287
--- a/mod_http2/h2_mplx.c
8c7287
+++ b/mod_http2/h2_mplx.c
8c7287
@@ -56,7 +56,7 @@ typedef struct {
8c7287
     apr_size_t count;
8c7287
 } stream_iter_ctx;
8c7287
 
8c7287
-static apr_status_t mplx_be_happy(h2_mplx *m);
8c7287
+static apr_status_t mplx_be_happy(h2_mplx *m, h2_task *task);
8c7287
 static apr_status_t mplx_be_annoyed(h2_mplx *m);
8c7287
 
8c7287
 apr_status_t h2_mplx_child_init(apr_pool_t *pool, server_rec *s)
8c7287
@@ -526,10 +526,10 @@ static apr_status_t out_open(h2_mplx *m, int stream_id, h2_bucket_beam *beam)
8c7287
     stream->output = beam;
8c7287
     
8c7287
     if (APLOGctrace2(m->c)) {
8c7287
-        h2_beam_log(beam, m->c, APLOG_TRACE2, "out_open");
8c7287
+        h2_beam_log(beam, stream->task->c, APLOG_TRACE2, "out_open");
8c7287
     }
8c7287
     else {
8c7287
-        ap_log_cerror(APLOG_MARK, APLOG_TRACE1, 0, m->c,
8c7287
+        ap_log_cerror(APLOG_MARK, APLOG_TRACE1, 0, stream->task->c,
8c7287
                       "h2_mplx(%s): out open", stream->task->id);
8c7287
     }
8c7287
     
8c7287
@@ -579,10 +579,10 @@ static apr_status_t out_close(h2_mplx *m, h2_task *task)
8c7287
         return APR_ECONNABORTED;
8c7287
     }
8c7287
 
8c7287
-    ap_log_cerror(APLOG_MARK, APLOG_TRACE2, status, m->c,
8c7287
+    ap_log_cerror(APLOG_MARK, APLOG_TRACE2, status, task->c,
8c7287
                   "h2_mplx(%s): close", task->id);
8c7287
     status = h2_beam_close(task->output.beam);
8c7287
-    h2_beam_log(task->output.beam, m->c, APLOG_TRACE2, "out_close");
8c7287
+    h2_beam_log(task->output.beam, task->c, APLOG_TRACE2, "out_close");
8c7287
     output_consumed_signal(m, task);
8c7287
     check_data_for(m, stream, 1);
8c7287
     return status;
8c7287
@@ -782,18 +782,18 @@ static void task_done(h2_mplx *m, h2_task *task)
8c7287
 {
8c7287
     h2_stream *stream;
8c7287
     
8c7287
-    ap_log_cerror(APLOG_MARK, APLOG_TRACE1, 0, m->c,
8c7287
+    ap_log_cerror(APLOG_MARK, APLOG_TRACE1, 0, task->c,
8c7287
                   "h2_mplx(%ld): task(%s) done", m->id, task->id);
8c7287
     out_close(m, task);
8c7287
     
8c7287
     task->worker_done = 1;
8c7287
     task->done_at = apr_time_now();
8c7287
-    ap_log_cerror(APLOG_MARK, APLOG_TRACE2, 0, m->c,
8c7287
+    ap_log_cerror(APLOG_MARK, APLOG_TRACE2, 0, task->c,
8c7287
                   "h2_mplx(%s): request done, %f ms elapsed", task->id, 
8c7287
                   (task->done_at - task->started_at) / 1000.0);
8c7287
     
8c7287
     if (task->c && !task->c->aborted && task->started_at > m->last_mood_change) {
8c7287
-        mplx_be_happy(m);
8c7287
+        mplx_be_happy(m, task);
8c7287
     }
8c7287
     
8c7287
     ap_assert(task->done_done == 0);
8c7287
@@ -805,13 +805,13 @@ static void task_done(h2_mplx *m, h2_task *task)
8c7287
             /* reset and schedule again */
8c7287
             h2_task_redo(task);
8c7287
             h2_iq_add(m->q, stream->id, NULL, NULL);
8c7287
-            ap_log_cerror(APLOG_MARK, APLOG_INFO, 0, m->c,
8c7287
+            ap_log_cerror(APLOG_MARK, APLOG_INFO, 0, task->c,
8c7287
                           H2_STRM_MSG(stream, "redo, added to q")); 
8c7287
         }
8c7287
         else {
8c7287
             /* stream not cleaned up, stay around */
8c7287
             task->done_done = 1;
8c7287
-            ap_log_cerror(APLOG_MARK, APLOG_TRACE2, 0, m->c,
8c7287
+            ap_log_cerror(APLOG_MARK, APLOG_TRACE2, 0, task->c,
8c7287
                           H2_STRM_MSG(stream, "task_done, stream open")); 
8c7287
             if (stream->input) {
8c7287
                 h2_beam_leave(stream->input);
8c7287
@@ -824,7 +824,7 @@ static void task_done(h2_mplx *m, h2_task *task)
8c7287
     else if ((stream = h2_ihash_get(m->shold, task->stream_id)) != NULL) {
8c7287
         /* stream is done, was just waiting for this. */
8c7287
         task->done_done = 1;
8c7287
-        ap_log_cerror(APLOG_MARK, APLOG_TRACE2, 0, m->c,
8c7287
+        ap_log_cerror(APLOG_MARK, APLOG_TRACE2, 0, task->c,
8c7287
                       H2_STRM_MSG(stream, "task_done, in hold"));
8c7287
         if (stream->input) {
8c7287
             h2_beam_leave(stream->input);
8c7287
@@ -832,12 +832,12 @@ static void task_done(h2_mplx *m, h2_task *task)
8c7287
         stream_joined(m, stream);
8c7287
     }
8c7287
     else if ((stream = h2_ihash_get(m->spurge, task->stream_id)) != NULL) {
8c7287
-        ap_log_cerror(APLOG_MARK, APLOG_WARNING, 0, m->c,   
8c7287
+        ap_log_cerror(APLOG_MARK, APLOG_WARNING, 0, task->c,   
8c7287
                       H2_STRM_LOG(APLOGNO(03517), stream, "already in spurge"));
8c7287
         ap_assert("stream should not be in spurge" == NULL);
8c7287
     }
8c7287
     else {
8c7287
-        ap_log_cerror(APLOG_MARK, APLOG_WARNING, 0, m->c, APLOGNO(03518)
8c7287
+        ap_log_cerror(APLOG_MARK, APLOG_WARNING, 0, task->c, APLOGNO(03518)
8c7287
                       "h2_mplx(%s): task_done, stream not found", 
8c7287
                       task->id);
8c7287
         ap_assert("stream should still be available" == NULL);
8c7287
@@ -963,7 +963,7 @@ static apr_status_t unschedule_slow_tasks(h2_mplx *m)
8c7287
     return rv;
8c7287
 }
8c7287
 
8c7287
-static apr_status_t mplx_be_happy(h2_mplx *m)
8c7287
+static apr_status_t mplx_be_happy(h2_mplx *m, h2_task *task)
8c7287
 {
8c7287
     apr_time_t now;            
8c7287
 
8c7287
@@ -975,7 +975,7 @@ static apr_status_t mplx_be_happy(h2_mplx *m)
8c7287
         m->limit_active = H2MIN(m->limit_active * 2, m->max_active);
8c7287
         m->last_mood_change = now;
8c7287
         m->irritations_since = 0;
8c7287
-        ap_log_cerror(APLOG_MARK, APLOG_TRACE1, 0, m->c,
8c7287
+        ap_log_cerror(APLOG_MARK, APLOG_TRACE1, 0, task->c,
8c7287
                       "h2_mplx(%ld): mood update, increasing worker limit to %d",
8c7287
                       m->id, m->limit_active);
8c7287
     }