Skip to content

Commit c1e0e89

Browse files
committed
adoptSocket: add optional ip parameter
for the ip to be correctly set in the open handler
1 parent 638267b commit c1e0e89

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

src/AppWrapper.h

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -758,7 +758,12 @@ void uWS_App_adoptSocket(const FunctionCallbackInfo<Value> &args) {
758758

759759
int32_t fd = args[0]->Int32Value(isolate->GetCurrentContext()).ToChecked();
760760

761-
app->adoptSocket(fd);
761+
NativeString ip(isolate, args[1]);
762+
if (ip.isInvalid(args)) {
763+
return;
764+
}
765+
766+
app->adoptSocket(fd, ip.getString());
762767

763768
args.GetReturnValue().Set(args.This());
764769
}

0 commit comments

Comments
 (0)