Skip to content

Commit f782159

Browse files
committed
adopt the review changes
1 parent 4bbfec7 commit f782159

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

src/stream_wrap.cc

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ LibuvStreamWrap::LibuvStreamWrap(Environment* env,
118118
provider),
119119
StreamBase(env),
120120
stream_(stream),
121-
recvQSize(STREAM_WRAP_RECVQ_INITIAL) {
121+
recvq_size(STREAM_WRAP_RECVQ_INITIAL) {
122122
StreamBase::AttachToObject(object);
123123
}
124124

@@ -210,7 +210,7 @@ void LibuvStreamWrap::OnUvAlloc(size_t suggested_size, uv_buf_t* buf) {
210210
HandleScope scope(env()->isolate());
211211
Context::Scope context_scope(env()->context());
212212

213-
*buf = EmitAlloc(recvQSize);
213+
*buf = EmitAlloc(recvq_size);
214214
}
215215

216216
template <class WrapType>
@@ -254,10 +254,10 @@ void LibuvStreamWrap::OnUvRead(ssize_t nread, const uv_buf_t* buf) {
254254

255255
if (nread > 0) {
256256
// Adjust the dynamic receive buffer
257-
if (nread == recvQSize && recvQSize < STREAM_WRAP_RECVQ_MAX) {
258-
recvQSize <<= 1;
259-
} else if (nread < recvQSize / 4 && recvQSize > STREAM_WRAP_RECVQ_MIN) {
260-
recvQSize >>= 1;
257+
if (nread == recvq_size && recvq_size < STREAM_WRAP_RECVQ_MAX) {
258+
recvq_size *= 2;
259+
} else if (nread < recvq_size / 4 && recvq_size > STREAM_WRAP_RECVQ_MIN) {
260+
recvq_size /= 2;
261261
}
262262

263263
MaybeLocal<Object> pending_obj;

src/stream_wrap.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ class LibuvStreamWrap : public HandleWrap, public StreamBase {
115115
static void AfterUvShutdown(uv_shutdown_t* req, int status);
116116

117117
uv_stream_t* const stream_;
118-
ssize_t recvQSize;
118+
ssize_t recvq_size;
119119

120120
#ifdef _WIN32
121121
// We don't always have an FD that we could look up on the stream_

0 commit comments

Comments
 (0)