Skip to content

Commit 3ab6732

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

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

src/AppWrapper.h

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -758,7 +758,13 @@ 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+
NativeStringContext nativeStringContext;
762+
NativeString ip(nativeStringContext, isolate, args[1]);
763+
if (ip.isInvalid(args)) {
764+
return;
765+
}
766+
767+
app->adoptSocket(fd, ip.getString());
762768

763769
args.GetReturnValue().Set(args.This());
764770
}

0 commit comments

Comments
 (0)