Commit 956e213d authored by jan.koester's avatar jan.koester
Browse files

debug

parent dd6806a9
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -818,6 +818,8 @@ void libhttppp::HttpEvent::Http3StreamEvent(netplus::socket *sock,

    // Read structured response info from :res-* pseudo-headers
    auto *resValid = tempreq.getHeaderData(":res-valid");
    fprintf(stderr, "[H3-RESP] resValid=%p stream=%llu\n",
            (void*)resValid, (unsigned long long)stream_id);
    if (resValid && resValid->getfirstValue()) {
        // Extract status code
        uint16_t status_code = 200;
@@ -889,6 +891,8 @@ void libhttppp::HttpEvent::Http3StreamEvent(netplus::socket *sock,
        std::vector<uint8_t> response = h3BuildResponse(
            status_code, body,
            content_type.empty() ? "text/html" : content_type, extra);
        fprintf(stderr, "[H3-RESP] sending %zu bytes on stream=%llu status=%u\n",
                response.size(), (unsigned long long)stream_id, status_code);
        q->sendStreamData(stream_id, response, true);

        // Clean up :res-* pseudo-headers
@@ -896,6 +900,9 @@ void libhttppp::HttpEvent::Http3StreamEvent(netplus::socket *sock,
        tempreq.deldata(":res-status");
        tempreq.deldata(":res-content-type");
        tempreq.deldata(":res-content-length");
    } else {
        fprintf(stderr, "[H3-RESP] NO :res-valid header — no response sent for stream=%llu\n",
                (unsigned long long)stream_id);
    }
}