nghttpx: Deal with partial write in API downstream connection

This commit is contained in:
Tatsuhiro Tsujikawa
2026-03-23 23:05:48 +09:00
parent 99065afe91
commit d4b813b862

View File

@@ -308,6 +308,8 @@ int APIDownstreamConnection::push_upload_data_chunk(
}
ssize_t nwrite;
for (; !data.empty();) {
while ((nwrite = write(fd_, data.data(), data.size())) == -1 &&
errno == EINTR)
;
@@ -319,6 +321,9 @@ int APIDownstreamConnection::push_upload_data_chunk(
return 0;
}
data = data.subspan(as_unsigned(nwrite));
}
// We don't have to call Upstream::resume_read() here, because
// request buffer is effectively unlimited. Actually, we cannot
// call it here since it could recursively call this function again.