Skip to content

Commit 1c6ec13

Browse files
committed
[Squash] address comments
1 parent 125e1b5 commit 1c6ec13

File tree

5 files changed

+9
-9
lines changed

5 files changed

+9
-9
lines changed

src/node_http2.cc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -893,7 +893,7 @@ int Http2Session::DoWrite(WriteWrap* req_wrap,
893893
return 0;
894894
}
895895

896-
size_t Http2Session::AllocateSend(WriteWrap** req) {
896+
WriteWrap* Http2Session::AllocateSend() {
897897
HandleScope scope(env()->isolate());
898898
auto AfterWrite = [](WriteWrap* req, int status) {
899899
req->Dispose();
@@ -906,8 +906,8 @@ size_t Http2Session::AllocateSend(WriteWrap** req) {
906906
nghttp2_session_get_remote_settings(
907907
session(),
908908
NGHTTP2_SETTINGS_MAX_FRAME_SIZE);
909-
*req = WriteWrap::New(env(), obj, this, AfterWrite, size);
910-
return size;
909+
// Max frame size + 9 bytes for the header
910+
return WriteWrap::New(env(), obj, this, AfterWrite, size + 9);
911911
}
912912

913913
void Http2Session::Send(WriteWrap* req, char* buf, size_t length) {

src/node_http2.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -399,7 +399,7 @@ class Http2Session : public AsyncWrap,
399399
const SubmitTrailers& submit_trailers) override;
400400

401401
void Send(WriteWrap* req, char* buf, size_t length) override;
402-
size_t AllocateSend(WriteWrap** req);
402+
WriteWrap* AllocateSend();
403403

404404
int DoWrite(WriteWrap* w, uv_buf_t* bufs, size_t count,
405405
uv_stream_t* send_handle) override;

src/node_http2_core-inl.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -502,7 +502,8 @@ inline void Nghttp2Session::SendPendingData() {
502502
// While srcLength is greater than zero
503503
while ((srcLength = nghttp2_session_mem_send(session_, &src)) > 0) {
504504
if (req == nullptr) {
505-
destRemaining = AllocateSend(&req);
505+
req = AllocateSend();
506+
destRemaining = req->self_size();
506507
dest = req->Extra();
507508
}
508509
DEBUG_HTTP2("Nghttp2Session %s: nghttp2 has %d bytes to send\n",
@@ -523,7 +524,8 @@ inline void Nghttp2Session::SendPendingData() {
523524
destLength = 0;
524525
srcRemaining -= destRemaining;
525526
srcOffset += destRemaining;
526-
destRemaining = AllocateSend(&req);
527+
req = AllocateSend();
528+
destRemaining = req->self_size();
527529
dest = req->Extra();
528530
}
529531

src/node_http2_core.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ class Nghttp2Session {
179179

180180
inline void SendPendingData();
181181
virtual void Send(WriteWrap* req, char* buf, size_t length) = 0;
182-
virtual size_t AllocateSend(WriteWrap** req) = 0;
182+
virtual WriteWrap* AllocateSend() = 0;
183183

184184
virtual bool HasGetPaddingCallback() { return false; }
185185

test/parallel/parallel.status

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,5 @@ test-npm-install: PASS,FLAKY
1818
[$system==solaris] # Also applies to SmartOS
1919

2020
[$system==freebsd]
21-
test-http2-compat-serverrequest-pipe: PASS,FLAKY
22-
test-http2-pipe: PASS,FLAKY
2321

2422
[$system==aix]

0 commit comments

Comments
 (0)