← Commit list

f221cdeabe

Stefan Eissing
Stefan Eissing
2025-10-17
SUCCESS Duration: 155s

Subject

ngtcp2: add a comment explaining write result handling

Binary

No binary (build failed)

Architecture & Compiler Flags

Architecture: x86_64-linux-gnu Compiler: gcc (Ubuntu 11.4.0-1ubuntu1~22.04.3) 11.4.0

—

Build Log

(log yok)

Commit Diff GitHub →

lib/vquic/curl_ngtcp2.c+12 -4
@@ -1018,8 +1018,12 @@ static void h3_xfer_write_resp_hd(struct Curl_cfilter *cf,
struct h3_stream_ctx *stream,
const char *buf, size_t blen, bool eos)
{
-
- /* If we already encountered an error, skip further writes */
+ /* This function returns no error intentionally, but records
+ * the result at the stream, skipping further writes once the
+ * `result` of the transfer is known.
+ * The stream is subsequently cancelled "higher up" in the filter's
+ * send/recv callbacks. Closing the stream here leads to SEND/RECV
+ * errors in other places that then overwrite the transfer's result. */
if(!stream->xfer_result) {
stream->xfer_result = Curl_xfer_write_resp_hd(data, buf, blen, eos);
if(stream->xfer_result)
@@ -1033,8 +1037,12 @@ static void h3_xfer_write_resp(struct Curl_cfilter *cf,
struct h3_stream_ctx *stream,
const char *buf, size_t blen, bool eos)
{
-
- /* If we already encountered an error, skip further writes */
+ /* This function returns no error intentionally, but records
+ * the result at the stream, skipping further writes once the
+ * `result` of the transfer is known.
+ * The stream is subsequently cancelled "higher up" in the filter's
+ * send/recv callbacks. Closing the stream here leads to SEND/RECV
+ * errors in other places that then overwrite the transfer's result. */
if(!stream->xfer_result) {
stream->xfer_result = Curl_xfer_write_resp(data, buf, blen, eos);
/* If the transfer write is errored, we do not want any more data */