| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 98eab4a commit 3690a72
4 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -824,7 +824,7 @@ int Http2Session::DoWrite(WriteWrap* req_wrap, | |||
| 824 | 824 | return 0; | |
| 825 | 825 | } | |
| 826 | 826 | ||
| 827 | - void Http2Session::AllocateSend(size_t recommended, uv_buf_t* buf) { | ||
| 827 | + void Http2Session::AllocateSend(uv_buf_t* buf) { | ||
| 828 | 828 | buf->base = stream_alloc(); | |
| 829 | 829 | buf->len = kAllocBufferSize; | |
| 830 | 830 | } | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -331,7 +331,8 @@ class Http2Options { | |||
| 331 | 331 | padding_strategy_type padding_strategy_ = PADDING_STRATEGY_NONE; | |
| 332 | 332 | }; | |
| 333 | 333 | ||
| 334 | - static const size_t kAllocBufferSize = 64 * 1024; | ||
| 334 | + // This allows for 4 default-sized frames with their frame headers | ||
| 335 | + static const size_t kAllocBufferSize = 4 * (16384 + 9); | ||
| 335 | 336 | ||
| 336 | 337 | typedef uint32_t(*get_setting)(nghttp2_session* session, | |
| 337 | 338 | nghttp2_settings_id id); | |
@@ -414,7 +415,7 @@ class Http2Session : public AsyncWrap, | |||
| 414 | 415 | void OnFrameError(int32_t id, uint8_t type, int error_code) override; | |
| 415 | 416 | void OnTrailers(Nghttp2Stream* stream, | |
| 416 | 417 | const SubmitTrailers& submit_trailers) override; | |
| 417 | - void AllocateSend(size_t recommended, uv_buf_t* buf) override; | ||
| 418 | + void AllocateSend(uv_buf_t* buf) override; | ||
| 418 | 419 | ||
| 419 | 420 | int DoWrite(WriteWrap* w, uv_buf_t* bufs, size_t count, | |
| 420 | 421 | uv_stream_t* send_handle) override; | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -490,7 +490,7 @@ inline void Nghttp2Session::SendPendingData() { | |||
| 490 | 490 | return; | |
| 491 | 491 | ||
| 492 | 492 | uv_buf_t dest; | |
| 493 | - AllocateSend(SEND_BUFFER_RECOMMENDED_SIZE, &dest); | ||
| 493 | + AllocateSend(&dest); | ||
| 494 | 494 | size_t destLength = 0; // amount of data stored in dest | |
| 495 | 495 | size_t destRemaining = dest.len; // amount space remaining in dest | |
| 496 | 496 | size_t destOffset = 0; // current write offset of dest | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -42,7 +42,6 @@ class Nghttp2Stream; | |||
| 42 | 42 | struct nghttp2_stream_write_t; | |
| 43 | 43 | ||
| 44 | 44 | #define MAX_BUFFER_COUNT 16 | |
| 45 | - #define SEND_BUFFER_RECOMMENDED_SIZE 4096 | ||
| 46 | 45 | ||
| 47 | 46 | enum nghttp2_session_type { | |
| 48 | 47 | NGHTTP2_SESSION_SERVER, | |
@@ -178,7 +177,7 @@ class Nghttp2Session { | |||
| 178 | 177 | virtual ssize_t GetPadding(size_t frameLength, | |
| 179 | 178 | size_t maxFrameLength) { return 0; } | |
| 180 | 179 | virtual void OnFreeSession() {} | |
| 181 | - virtual void AllocateSend(size_t suggested_size, uv_buf_t* buf) = 0; | ||
| 180 | + virtual void AllocateSend(uv_buf_t* buf) = 0; | ||
| 182 | 181 | ||
| 183 | 182 | virtual bool HasGetPaddingCallback() { return false; } | |
| 184 | 183 | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments