Use 4086 as max DATA payload size to make DATA frame fit into 4K buffer

This commit is contained in:
Tatsuhiro Tsujikawa
2014-03-05 22:48:17 +09:00
parent 382024a180
commit 547d6d1fb5
3 changed files with 17 additions and 16 deletions

View File

@@ -42,8 +42,10 @@
/* The maximum payload length of a frame */
#define NGHTTP2_MAX_FRAME_LENGTH ((1 << 14) - 1)
/* The maximum length of DATA frame payload. */
#define NGHTTP2_DATA_PAYLOAD_LENGTH 4096
/* The maximum length of DATA frame payload. To fit entire DATA frame
into 4096K buffer, we use subtract header size (8 bytes) + 2 bytes
padding. See nghttp2_session_pack_data(). */
#define NGHTTP2_DATA_PAYLOAD_LENGTH 4086
/* The number of bytes of frame header. */
#define NGHTTP2_FRAME_HEAD_LENGTH 8

View File

@@ -74,9 +74,8 @@ typedef struct {
/* Buffer length for inbound raw byte stream. */
#define NGHTTP2_INBOUND_BUFFER_LENGTH 16384
#define NGHTTP2_INITIAL_OUTBOUND_FRAMEBUF_LENGTH (NGHTTP2_DATA_PAYLOAD_LENGTH+8)
#define NGHTTP2_INITIAL_INBOUND_FRAMEBUF_LENGTH \
NGHTTP2_INITIAL_OUTBOUND_FRAMEBUF_LENGTH
#define NGHTTP2_INITIAL_OUTBOUND_FRAMEBUF_LENGTH 4096
#define NGHTTP2_INITIAL_NV_BUFFER_LENGTH 4096
/* Internal state when receiving incoming frame */