Merge ec5bc12836
into 5195e8be6a
This commit is contained in:
commit
ed22ff0a74
|
@ -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
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
|
@ -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();
|
||||
|
||||
|
|
Loading…
Reference in New Issue