Commit 6043035f authored by jan.koester's avatar jan.koester
Browse files

test

parent 86205cec
Loading
Loading
Loading
Loading
+17 −12
Original line number Diff line number Diff line
@@ -860,6 +860,23 @@ void libhttppp::HttpEvent::Http3StreamEvent(netplus::socket *sock,
                                            uint64_t stream_id,
                                            const std::vector<uint8_t> &data,
                                            bool fin) {
    // Send H3 control / QPACK streams once per connection, immediately
    // on the first stream callback — before waiting for a complete request.
    // Chrome requires these before it considers the H3 connection valid.
    {
        auto *q = dynamic_cast<netplus::quic*>(sock);
        if (q) {
            bool need_init = false;
            {
                std::lock_guard<std::mutex> lock(_h3BufferMutex);
                need_init = _h3ControlStreamsSent.insert(sock).second;
            }
            if (need_init) {
                _initH3ControlStreams(q);
            }
        }
    }

    if (data.empty() && !fin) {
        return;
    }
@@ -896,18 +913,6 @@ void libhttppp::HttpEvent::Http3StreamEvent(netplus::socket *sock,
        return;
    }

    // Send H3 control / QPACK streams once per connection
    {
        bool need_init = false;
        {
            std::lock_guard<std::mutex> lock(_h3BufferMutex);
            need_init = _h3ControlStreamsSent.insert(sock).second;
        }
        if (need_init) {
            _initH3ControlStreams(q);
        }
    }

    // Two-pass approach: first collect HEADERS and DATA payloads,
    // then dispatch.  This ensures POST body data is available
    // in RecvData when RequestEvent is called.