This commit is contained in:
robert engels 2022-11-28 23:52:02 -06:00 committed by GitHub
commit ed22ff0a74
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 17 additions and 2 deletions

View File

@ -53,7 +53,7 @@
(NGHTTP2_FRAME_HDLEN + 1 + NGHTTP2_MAX_PAYLOADLEN)
/* The default length of DATA frame payload. */
#define NGHTTP2_DATA_PAYLOADLEN NGHTTP2_MAX_FRAME_SIZE_MIN
#define NGHTTP2_DATA_PAYLOADLEN 256*1024
/* Maximum headers block size to send, calculated using
nghttp2_hd_deflate_bound(). This is the default value, and can be

View File

@ -7748,6 +7748,21 @@ int nghttp2_session_pack_data(nghttp2_session *session, nghttp2_bufs *bufs,
datamax = (size_t)payloadlen;
}
if ((size_t)datamax > nghttp2_buf_avail(buf)) {
/* Resize the current buffer(s). The reason why we do +1 for
buffer size is for possible padding field. */
rv = nghttp2_bufs_realloc(&session->aob.framebufs,
(size_t)(NGHTTP2_FRAME_HDLEN + 1 + datamax));
if (rv != 0) {
DEBUGF("send: realloc buffer failed rv=%d", rv);
} else {
assert(&session->aob.framebufs == bufs);
buf = &bufs->cur->buf;
}
}
/* Current max DATA length is less then buffer chunk size */
assert(nghttp2_buf_avail(buf) >= datamax);

View File

@ -205,7 +205,7 @@ public:
struct ev_loop *get_loop() const;
using WriteBuf = Buffer<64_k>;
using WriteBuf = Buffer<512_k>; // This needs to be >= largest frame sent, or frame is not sent
WriteBuf *get_wb();