Skip to content

Commit

Permalink
adopt the review changes
Browse files Browse the repository at this point in the history
  • Loading branch information
mmomtchev committed Jun 26, 2021
1 parent 4bbfec7 commit f782159
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
12 changes: 6 additions & 6 deletions src/stream_wrap.cc
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ LibuvStreamWrap::LibuvStreamWrap(Environment* env,
provider),
StreamBase(env),
stream_(stream),
recvQSize(STREAM_WRAP_RECVQ_INITIAL) {
recvq_size(STREAM_WRAP_RECVQ_INITIAL) {
StreamBase::AttachToObject(object);
}

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

*buf = EmitAlloc(recvQSize);
*buf = EmitAlloc(recvq_size);
}

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

if (nread > 0) {
// Adjust the dynamic receive buffer
if (nread == recvQSize && recvQSize < STREAM_WRAP_RECVQ_MAX) {
recvQSize <<= 1;
} else if (nread < recvQSize / 4 && recvQSize > STREAM_WRAP_RECVQ_MIN) {
recvQSize >>= 1;
if (nread == recvq_size && recvq_size < STREAM_WRAP_RECVQ_MAX) {
recvq_size *= 2;
} else if (nread < recvq_size / 4 && recvq_size > STREAM_WRAP_RECVQ_MIN) {
recvq_size /= 2;
}

MaybeLocal<Object> pending_obj;
Expand Down
2 changes: 1 addition & 1 deletion src/stream_wrap.h
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ class LibuvStreamWrap : public HandleWrap, public StreamBase {
static void AfterUvShutdown(uv_shutdown_t* req, int status);

uv_stream_t* const stream_;
ssize_t recvQSize;
ssize_t recvq_size;

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

0 comments on commit f782159

Please sign in to comment.