Skip to content

Commit a059fc6

Browse files
authored
adoptSocket: add optional ip parameter (#1267)
for the ip to be correctly set in the open handler
1 parent 4c83d44 commit a059fc6

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
@@ -750,7 +750,12 @@ void uWS_App_adoptSocket(const FunctionCallbackInfo<Value> &args) {
750750

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

753-
app->adoptSocket(fd);
753+
NativeString ip(isolate, args[1]);
754+
if (ip.isInvalid(args)) {
755+
return;
756+
}
757+
758+
app->adoptSocket(fd, ip.getString());
754759

755760
args.GetReturnValue().Set(args.This());
756761
}

0 commit comments

Comments
 (0)