• Dag Haavi Finstad's avatar
    Use a separate condvar for connection-level flow control updates · a6533c74
    Dag Haavi Finstad authored
    The current flow control code's use of h2->cond is racy.
    
    h2->cond is already used for handing over a DATA frame to a stream
    thread. In the event that we have both streams waiting on this condvar
    for window updates and at the same time the rxthread gets signaled for a
    DATA frame, we could end up waking up the wrong thread and the rxthread
    gets stuck forever.
    
    This commit addresses this by using a separate condvar for window
    updates.
    
    An alternative would be to always issue a broadcast on h2->cond instead
    of signal, but I found this approach much cleaner.
    
    Probably fixes: #2623
    a6533c74
cache_http2_session.c 11.7 KB