nghttp2_frame: Add assertion to available buffer size in first buffer
This commit is contained in:
parent
56d6784d8d
commit
8289943a58
|
@ -431,6 +431,9 @@ int nghttp2_frame_pack_priority(nghttp2_bufs *bufs, nghttp2_priority *frame)
|
||||||
assert(bufs->head == bufs->cur);
|
assert(bufs->head == bufs->cur);
|
||||||
|
|
||||||
buf = &bufs->head->buf;
|
buf = &bufs->head->buf;
|
||||||
|
|
||||||
|
assert(nghttp2_buf_avail(buf) >= 5);
|
||||||
|
|
||||||
buf->pos -= NGHTTP2_FRAME_HDLEN;
|
buf->pos -= NGHTTP2_FRAME_HDLEN;
|
||||||
|
|
||||||
nghttp2_frame_pack_frame_hd(buf->pos, &frame->hd);
|
nghttp2_frame_pack_frame_hd(buf->pos, &frame->hd);
|
||||||
|
@ -458,6 +461,9 @@ int nghttp2_frame_pack_rst_stream(nghttp2_bufs *bufs,
|
||||||
assert(bufs->head == bufs->cur);
|
assert(bufs->head == bufs->cur);
|
||||||
|
|
||||||
buf = &bufs->head->buf;
|
buf = &bufs->head->buf;
|
||||||
|
|
||||||
|
assert(nghttp2_buf_avail(buf) >= 4);
|
||||||
|
|
||||||
buf->pos -= NGHTTP2_FRAME_HDLEN;
|
buf->pos -= NGHTTP2_FRAME_HDLEN;
|
||||||
|
|
||||||
nghttp2_frame_pack_frame_hd(buf->pos, &frame->hd);
|
nghttp2_frame_pack_frame_hd(buf->pos, &frame->hd);
|
||||||
|
@ -618,6 +624,9 @@ int nghttp2_frame_pack_ping(nghttp2_bufs *bufs, nghttp2_ping *frame)
|
||||||
assert(bufs->head == bufs->cur);
|
assert(bufs->head == bufs->cur);
|
||||||
|
|
||||||
buf = &bufs->head->buf;
|
buf = &bufs->head->buf;
|
||||||
|
|
||||||
|
assert(nghttp2_buf_avail(buf) >= 8);
|
||||||
|
|
||||||
buf->pos -= NGHTTP2_FRAME_HDLEN;
|
buf->pos -= NGHTTP2_FRAME_HDLEN;
|
||||||
|
|
||||||
nghttp2_frame_pack_frame_hd(buf->pos, &frame->hd);
|
nghttp2_frame_pack_frame_hd(buf->pos, &frame->hd);
|
||||||
|
@ -721,6 +730,9 @@ int nghttp2_frame_pack_window_update(nghttp2_bufs *bufs,
|
||||||
assert(bufs->head == bufs->cur);
|
assert(bufs->head == bufs->cur);
|
||||||
|
|
||||||
buf = &bufs->head->buf;
|
buf = &bufs->head->buf;
|
||||||
|
|
||||||
|
assert(nghttp2_buf_avail(buf) >= 4);
|
||||||
|
|
||||||
buf->pos -= NGHTTP2_FRAME_HDLEN;
|
buf->pos -= NGHTTP2_FRAME_HDLEN;
|
||||||
|
|
||||||
nghttp2_frame_pack_frame_hd(buf->pos, &frame->hd);
|
nghttp2_frame_pack_frame_hd(buf->pos, &frame->hd);
|
||||||
|
|
Loading…
Reference in New Issue