Commit e6323133 authored by jan.koester's avatar jan.koester
Browse files

deb

parent 394c6d40
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
libhttppp (20260424+9) unstable; urgency=medium

  * Flush H2 SendData after each stream dispatch to prevent serialised
    preview responses from timing out on multiplexed connections

 -- Jan Koester <jan.koester@tuxist.de>  Thu, 24 Apr 2026 00:00:00 +0200

libhttppp (20260423+8) unstable; urgency=medium

  * Add missing #include <netplus/crypto/tls.h> for TlsSessionCache
+30 −0
Original line number Diff line number Diff line
@@ -993,6 +993,36 @@ done:
        cureq.SendData.append(out.data(), out.size());
    }

    // Flush SendData immediately so H2 responses for completed streams
    // reach the client without waiting for the reprocess loop to finish
    // all remaining dispatches.  Without this, a slow RequestEvent
    // (e.g. on-demand preview rendering) serialises all streams and the
    // client may time out before later streams are served.
    if (cureq.SendData.pos < cureq.SendData.size() && cureq.slots[0].csock) {
        try {
            while (cureq.SendData.pos < cureq.SendData.size()) {
                size_t remaining = cureq.SendData.size() - cureq.SendData.pos;
                size_t sendlen = std::min(remaining, static_cast<size_t>(16384));
                netplus::buffer buf(cureq.SendData.data() + cureq.SendData.pos, sendlen);
                size_t sent = cureq.slots[0].csock->sendData(buf, 0);
                if (sent > 0) {
                    cureq.SendData.pos += sent;
                    if (cureq.slots[0].csock->hasPendingWrite())
                        cureq.slots[0].csock->flush_out();
                } else {
                    break;
                }
            }
        } catch (...) {
            // Socket busy or error — remaining data will be flushed
            // by IoEventHandler's send loop after we return.
        }
        if (cureq.SendData.pos >= cureq.SendData.size()) {
            cureq.SendData.clear();
            cureq.SendData.pos = 0;
        }
    }

    if (off > 0) {
        cureq.RecvData.erase(cureq.RecvData.begin(), cureq.RecvData.begin() + off);
    }