]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
Partial revert of r1934913 in ./modules/http2 to retain
authorJoe Orton <jorton@apache.org>
Fri, 5 Jun 2026 16:38:04 +0000 (16:38 +0000)
committerJoe Orton <jorton@apache.org>
Fri, 5 Jun 2026 16:38:04 +0000 (16:38 +0000)
backwards-compatibility with 2.4.x builds for that module.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1935039 13f79535-47bb-0310-9956-ffa450edef68

modules/http2/h2_c2.c
modules/http2/h2_proxy_session.c
modules/http2/h2_stream.c

index ad30f96d0f51058a374720fcb7811f59a47f29f2..79f76c0a70f8db02384a34bbd7ea6329b61d1966 100644 (file)
@@ -461,8 +461,13 @@ static void check_early_hints(request_rec *r, const char *tag)
           }
           old_status = r->status;
           old_line = r->status_line;
+#ifdef HTTP_EARLY_HINTS
           r->status = HTTP_EARLY_HINTS;
           r->status_line = ap_get_status_line(r->status);
+#else
+          r->status = 103;
+          r->status_line = "103 Early Hints";
+#endif
           ap_send_interim_response(r, 1);
           r->status = old_status;
           r->status_line = old_line;
index f1634eec9b63a9e35bdcd1fcb80c6a2db57a29b2..f5f0f0d63aee8db788f5f62a86cb02a2ec7abfb4 100644 (file)
@@ -293,6 +293,14 @@ static int on_frame_recv(nghttp2_session *ngh2, const nghttp2_frame *frame,
                             forward = 1;
                         } 
                         break;
+#ifndef HTTP_EARLY_HINTS
+                    case 103:
+                        /* workaround until we get this into http protocol base
+                         * parts. without this, unknown codes are converted to
+                         * 500... */
+                        r->status_line = "103 Early Hints";
+                        break;
+#endif
                     default:
                         r->status_line = ap_get_status_line(r->status);
                         break;
index 653af3fb18cfb0159b56e9037f97cc02cd872771..44969cf088184e059d3e4afd667887411c2e9809 100644 (file)
@@ -1709,7 +1709,11 @@ static apr_status_t stream_do_response(h2_stream *stream)
     }
     h2_session_set_prio(stream->session, stream, stream->pref_priority);
 
+#ifdef HTTP_EARLY_HINTS
     if (resp->status == HTTP_EARLY_HINTS
+#else
+    if (resp->status == 103
+#endif
         && !h2_config_sgeti(stream->session->s, H2_CONF_EARLY_HINTS)) {
         /* suppress sending this to the client, it might have triggered
          * pushes and served its purpose nevertheless */