On 9/30/21 3:18 PM, ste...@eissing.org wrote:

> 
> RĂ¼diger's "H2StreamTimeout" has been added and test cases gave some
> surprises. Turns out ap_die() behaves different depending on the
> presence of the H1 header filter in the out filter chain. Who knew?
> 

If the H1 header filter is still there it means:

1. I have sent any response yet.
2. I could still sent a response (at least an internal server error) and I 
should do this.

How can the filter be away when in ap_die()?

1. ap_die happens after the status code and the header were already sent for 
the request. Then there is nothing to add and to do.
   In this case r->sent_bodyct for the top request (unwinding subrequest) is 
set.
2. ap_die happens after a brigade with an EOC bucket has passed the H1 header 
filter. In this case r->sent_bodyct is still unset.

Hence r->sent_bodyct cannot be used as a detection if the filter is still in 
place or not as a replacement for the current check.
I assume that in for HTTP/2 you want to remove the H1 filter?

Maybe the following would fix your problem?

Index: http_request.c
===================================================================
--- http_request.c      (revision 1893605)
+++ http_request.c      (working copy)
@@ -101,8 +101,12 @@
         /*
          * If next != NULL then we left the while above because of
          * next->frec == ap_http_header_filter
+         *
+         * If we are on a HTTP/2 stream let the master connection decide 
whether
+         * an error response needs to be send or not and give it an
+         * internal server error.
          */
-        if (next) {
+        if (next || r->connection->master) {
             if (type != AP_FILTER_ERROR) {
                 ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, APLOGNO(01579)
                               "Invalid response status %i", type);



Regards

RĂ¼diger

Reply via email to