Commit ae0df7fe authored by zhujiashun's avatar zhujiashun

fix h2 big response not sending bug

parent 45938762
......@@ -1672,8 +1672,15 @@ H2UnsentResponse::AppendAndDestroySelf(butil::IOBuf* out, Socket* socket) {
// NOTE: Currently the stream context is definitely removed and updating
// window size is useless, however it's not true when progressive request
// is supported.
// TODO(zhujiashun): Instead of just returning error to client, a better
// solution to handle not enough window size is to wait until WINDOW_UPDATE
// is received, and then retry those failed response again.
if (!MinusWindowSize(&ctx->_remote_window_left, _data.size())) {
return butil::Status(ELIMIT, "Remote window size is not enough");
char rstbuf[FRAME_HEAD_SIZE + 4];
SerializeFrameHead(rstbuf, 4, H2_FRAME_RST_STREAM, 0, _stream_id);
SaveUint32(rstbuf + FRAME_HEAD_SIZE, H2_FLOW_CONTROL_ERROR);
out->append(rstbuf, sizeof(rstbuf));
return butil::Status::OK();
}
HPacker& hpacker = ctx->hpacker();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment