mirror of
https://github.com/nghttp2/nghttp2.git
synced 2026-03-25 07:26:14 +08:00
nghttpx: Deal with partial write in API downstream connection
This commit is contained in:
@@ -308,6 +308,8 @@ int APIDownstreamConnection::push_upload_data_chunk(
|
|||||||
}
|
}
|
||||||
|
|
||||||
ssize_t nwrite;
|
ssize_t nwrite;
|
||||||
|
|
||||||
|
for (; !data.empty();) {
|
||||||
while ((nwrite = write(fd_, data.data(), data.size())) == -1 &&
|
while ((nwrite = write(fd_, data.data(), data.size())) == -1 &&
|
||||||
errno == EINTR)
|
errno == EINTR)
|
||||||
;
|
;
|
||||||
@@ -319,6 +321,9 @@ int APIDownstreamConnection::push_upload_data_chunk(
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
data = data.subspan(as_unsigned(nwrite));
|
||||||
|
}
|
||||||
|
|
||||||
// We don't have to call Upstream::resume_read() here, because
|
// We don't have to call Upstream::resume_read() here, because
|
||||||
// request buffer is effectively unlimited. Actually, we cannot
|
// request buffer is effectively unlimited. Actually, we cannot
|
||||||
// call it here since it could recursively call this function again.
|
// call it here since it could recursively call this function again.
|
||||||
|
|||||||
Reference in New Issue
Block a user