Skip to content

Commit

Permalink
limit bulk recvs
Browse files Browse the repository at this point in the history
  • Loading branch information
splitice committed Feb 20, 2024
1 parent 5492c3f commit c4f3197
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/raw.cc
Original file line number Diff line number Diff line change
Expand Up @@ -714,7 +714,7 @@ NAN_METHOD(SocketWrap::Recv) {

Local<Value> argv[2];
Local<Function> cb = Local<Function>::Cast (info[1]);

int remaining = 4;
do {
//memset (&sin_storage, 0, sin_length);
rc = recvfrom (socket->poll_fd_, node::Buffer::Data (buffer),
Expand Down Expand Up @@ -745,7 +745,7 @@ NAN_METHOD(SocketWrap::Recv) {
break;
}
buffer = argv[0]->ToObject(context).ToLocalChecked();
} while(true);
} while(remaining-- != 0);

info.GetReturnValue().Set(info.This());
}
Expand Down

0 comments on commit c4f3197

Please sign in to comment.