Blame SOURCES/httpd-2.4.34-CVE-2020-11993.patch

9364d6
diff --git a/modules/http2/h2_mplx.c b/modules/http2/h2_mplx.c
9364d6
index e67b09d..9a3b4e0 100644
9364d6
--- a/modules/http2/h2_mplx.c
9364d6
+++ b/modules/http2/h2_mplx.c
9364d6
@@ -57,7 +57,7 @@ typedef struct {
9364d6
     apr_size_t count;
9364d6
 } stream_iter_ctx;
9364d6
 
9364d6
-static apr_status_t mplx_be_happy(h2_mplx *m);
9364d6
+static apr_status_t mplx_be_happy(h2_mplx *m, h2_task *task);
9364d6
 static apr_status_t mplx_be_annoyed(h2_mplx *m);
9364d6
 
9364d6
 apr_status_t h2_mplx_child_init(apr_pool_t *pool, server_rec *s)
9364d6
@@ -544,10 +544,10 @@ static apr_status_t out_open(h2_mplx *m, int stream_id, h2_bucket_beam *beam)
9364d6
     stream->output = beam;
9364d6
     
9364d6
     if (APLOGctrace2(m->c)) {
9364d6
-        h2_beam_log(beam, m->c, APLOG_TRACE2, "out_open");
9364d6
+        h2_beam_log(beam, stream->task->c, APLOG_TRACE2, "out_open");
9364d6
     }
9364d6
     else {
9364d6
-        ap_log_cerror(APLOG_MARK, APLOG_TRACE1, status, m->c,
9364d6
+        ap_log_cerror(APLOG_MARK, APLOG_TRACE1, status, stream->task->c,
9364d6
                       "h2_mplx(%s): out open", stream->task->id);
9364d6
     }
9364d6
     
9364d6
@@ -597,10 +597,10 @@ static apr_status_t out_close(h2_mplx *m, h2_task *task)
9364d6
         return APR_ECONNABORTED;
9364d6
     }
9364d6
 
9364d6
-    ap_log_cerror(APLOG_MARK, APLOG_TRACE2, status, m->c,
9364d6
+    ap_log_cerror(APLOG_MARK, APLOG_TRACE2, status, task->c,
9364d6
                   "h2_mplx(%s): close", task->id);
9364d6
     status = h2_beam_close(task->output.beam);
9364d6
-    h2_beam_log(task->output.beam, m->c, APLOG_TRACE2, "out_close");
9364d6
+    h2_beam_log(task->output.beam, task->c, APLOG_TRACE2, "out_close");
9364d6
     output_consumed_signal(m, task);
9364d6
     check_data_for(m, stream, 0);
9364d6
     return status;
9364d6
@@ -793,14 +793,14 @@ static void task_done(h2_mplx *m, h2_task *task, h2_req_engine *ngn)
9364d6
         /* this task was handed over to an engine for processing 
9364d6
          * and the original worker has finished. That means the 
9364d6
          * engine may start processing now. */
9364d6
-        ap_log_cerror(APLOG_MARK, APLOG_TRACE1, 0, m->c,
9364d6
+        ap_log_cerror(APLOG_MARK, APLOG_TRACE1, 0, task->c,
9364d6
                       "h2_mplx(%ld): task(%s) done (frozen)", m->id, task->id);
9364d6
         h2_task_thaw(task);
9364d6
         apr_thread_cond_broadcast(m->task_thawed);
9364d6
         return;
9364d6
     }
9364d6
         
9364d6
-    ap_log_cerror(APLOG_MARK, APLOG_TRACE1, 0, m->c,
9364d6
+    ap_log_cerror(APLOG_MARK, APLOG_TRACE1, 0, task->c,
9364d6
                   "h2_mplx(%ld): task(%s) done", m->id, task->id);
9364d6
     out_close(m, task);
9364d6
     
9364d6
@@ -820,7 +820,7 @@ static void task_done(h2_mplx *m, h2_task *task, h2_req_engine *ngn)
9364d6
     if (task->engine) {
9364d6
         if (!m->aborted && !task->c->aborted 
9364d6
             && !h2_req_engine_is_shutdown(task->engine)) {
9364d6
-            ap_log_cerror(APLOG_MARK, APLOG_DEBUG, 0, m->c, APLOGNO(10022)
9364d6
+            ap_log_cerror(APLOG_MARK, APLOG_DEBUG, 0, task->c, APLOGNO(10022)
9364d6
                           "h2_mplx(%ld): task(%s) has not-shutdown "
9364d6
                           "engine(%s)", m->id, task->id, 
9364d6
                           h2_req_engine_get_id(task->engine));
9364d6
@@ -830,12 +830,12 @@ static void task_done(h2_mplx *m, h2_task *task, h2_req_engine *ngn)
9364d6
     
9364d6
     task->worker_done = 1;
9364d6
     task->done_at = apr_time_now();
9364d6
-    ap_log_cerror(APLOG_MARK, APLOG_TRACE2, 0, m->c,
9364d6
+    ap_log_cerror(APLOG_MARK, APLOG_TRACE2, 0, task->c,
9364d6
                   "h2_mplx(%s): request done, %f ms elapsed", task->id, 
9364d6
                   (task->done_at - task->started_at) / 1000.0);
9364d6
     
9364d6
     if (task->c && !task->c->aborted && task->started_at > m->last_mood_change) {
9364d6
-        mplx_be_happy(m);
9364d6
+        mplx_be_happy(m, task);
9364d6
     }
9364d6
     
9364d6
     ap_assert(task->done_done == 0);
9364d6
@@ -848,13 +848,13 @@ static void task_done(h2_mplx *m, h2_task *task, h2_req_engine *ngn)
9364d6
             task->worker_done = 0;
9364d6
             h2_task_redo(task);
9364d6
             h2_iq_add(m->q, stream->id, NULL, NULL);
9364d6
-            ap_log_cerror(APLOG_MARK, APLOG_INFO, 0, m->c,
9364d6
+            ap_log_cerror(APLOG_MARK, APLOG_INFO, 0, task->c,
9364d6
               		  H2_STRM_MSG(stream, "redo, added to q"));
9364d6
         }
9364d6
         else {
9364d6
             /* stream not cleaned up, stay around */
9364d6
             task->done_done = 1;
9364d6
-            ap_log_cerror(APLOG_MARK, APLOG_TRACE2, 0, m->c,
9364d6
+            ap_log_cerror(APLOG_MARK, APLOG_TRACE2, 0, task->c,
9364d6
 			  H2_STRM_MSG(stream, "task_done, stream open")); 
9364d6
             if (stream->input) {
9364d6
                 h2_beam_leave(stream->input);
9364d6
@@ -867,7 +867,7 @@ static void task_done(h2_mplx *m, h2_task *task, h2_req_engine *ngn)
9364d6
     else if ((stream = h2_ihash_get(m->shold, task->stream_id)) != NULL) {
9364d6
         /* stream is done, was just waiting for this. */
9364d6
         task->done_done = 1;
9364d6
-        ap_log_cerror(APLOG_MARK, APLOG_TRACE2, 0, m->c,
9364d6
+        ap_log_cerror(APLOG_MARK, APLOG_TRACE2, 0, task->c,
9364d6
                       H2_STRM_MSG(stream, "task_done, in hold"));
9364d6
         if (stream->input) {
9364d6
             h2_beam_leave(stream->input);
9364d6
@@ -875,12 +875,12 @@ static void task_done(h2_mplx *m, h2_task *task, h2_req_engine *ngn)
9364d6
         stream_joined(m, stream);
9364d6
     }
9364d6
     else if ((stream = h2_ihash_get(m->spurge, task->stream_id)) != NULL) {
9364d6
-        ap_log_cerror(APLOG_MARK, APLOG_WARNING, 0, m->c,   
9364d6
+        ap_log_cerror(APLOG_MARK, APLOG_WARNING, 0, task->c,   
9364d6
                       H2_STRM_LOG(APLOGNO(03517), stream, "already in spurge"));
9364d6
         ap_assert("stream should not be in spurge" == NULL);
9364d6
     }
9364d6
     else {
9364d6
-        ap_log_cerror(APLOG_MARK, APLOG_WARNING, 0, m->c, APLOGNO(03518)
9364d6
+        ap_log_cerror(APLOG_MARK, APLOG_WARNING, 0, task->c, APLOGNO(03518)
9364d6
                       "h2_mplx(%s): task_done, stream not found", 
9364d6
                       task->id);
9364d6
         ap_assert("stream should still be available" == NULL);
9364d6
@@ -1005,7 +1005,7 @@ static apr_status_t unschedule_slow_tasks(h2_mplx *m)
9364d6
     return rv;
9364d6
 }
9364d6
 
9364d6
-static apr_status_t mplx_be_happy(h2_mplx *m)
9364d6
+static apr_status_t mplx_be_happy(h2_mplx *m, h2_task *task)
9364d6
 {
9364d6
     apr_time_t now;
9364d6
     
9364d6
@@ -1017,7 +1017,7 @@ static apr_status_t mplx_be_happy(h2_mplx *m)
9364d6
         m->limit_active = H2MIN(m->limit_active * 2, m->max_active);
9364d6
         m->last_mood_change = now;
9364d6
         m->irritations_since = 0;
9364d6
-        ap_log_cerror(APLOG_MARK, APLOG_TRACE1, 0, m->c,
9364d6
+        ap_log_cerror(APLOG_MARK, APLOG_TRACE1, 0, task->c,
9364d6
                       "h2_mplx(%ld): mood update, increasing worker limit to %d",
9364d6
                       m->id, m->limit_active);
9364d6
     }