Skip to content

Commit

Permalink
Update raw.cc
Browse files Browse the repository at this point in the history
  • Loading branch information
splitice committed Feb 20, 2024
1 parent d543dd9 commit ab49308
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/raw.cc
Original file line number Diff line number Diff line change
Expand Up @@ -682,9 +682,9 @@ NAN_METHOD(SocketWrap::Recv) {
#endif

if (socket->family_ == AF_INET6) {
sin_length = sizeof (sin6_address);
sin_length = sizeof (sockaddr_in6);
} else if (socket->family_ == AF_INET) {
sin_length = sizeof (sin_address);
sin_length = sizeof (sockaddr_in);
} else {
sin_length = sizeof(sockaddr_ll);
}
Expand Down Expand Up @@ -712,7 +712,8 @@ NAN_METHOD(SocketWrap::Recv) {
return;
}


const unsigned argc = 3;
Local<Value> argv[argc];
Local<Function> cb = Local<Function>::Cast (info[1]);
argv[0] = info[0];

Expand All @@ -736,8 +737,6 @@ NAN_METHOD(SocketWrap::Recv) {
uv_ip4_name ((sockaddr_in*)&sin_storage, addr, 50);
else
addr[0] = 0; /* TODO */
const unsigned argc = 3;
Local<Value> argv[argc];
argv[1] = Nan::New<Number>(rc);
argv[2] = Nan::New(addr).ToLocalChecked();
cb->Call (context, socket->handle(), argc, argv);
Expand Down

0 comments on commit ab49308

Please sign in to comment.