• Dridi Boukelmoune's avatar
    Start honoring [idle_]send_timeout of h2 streams · e1a1fdc7
    Dridi Boukelmoune authored
    Unlike HTTP/1 that relies on the underlying transport, we can time
    streams out simply by not crediting them. This is our first usage of
    the CANCEL error with the RST frame, even though this change is not
    comprehensive since the window only applies to DATA frames.
    
    In addition to the session send timeouts, we can now kill streams that
    aren't making progress and free the resources they hold onto even when
    the session is continuously active.
    
    There is one caveat though, there is currently no timeout for trying
    to write to the session, so unless a client maintains a stream forever
    by not crediting it we won't catch it.
    
    For that to happen the next step could be to change this pattern:
    
        H2_Send_Get(...);
        /* send something */
        H2_Send_Rel(...);
    
    And instead check a return value:
    
        if (H2_Send_Get(...) == 0) {
            /* send something */
            H2_Send_Rel(...);
        } else {
            /* error handling */
        }
    
    But unfortunately, not all uses of get/rel enclose an attempt to send
    something.
    e1a1fdc7
t02016.vtc 1.12 KB