Skip to content
Snippets Groups Projects
Commit 5ac2c66c authored by Deucе's avatar Deucе :ok_hand_tone4:
Browse files

Set Socket.type correctly on accept() from multisock

parent 39cfd9f8
No related branches found
No related tags found
No related merge requests found
Pipeline #8108 passed
......@@ -871,6 +871,12 @@ js_accept(JSContext *cx, uintN argc, jsval *arglist)
}
new_p->type = p->type;
if (new_p->type == 0) {
union xp_sockaddr addr;
socklen_t len = sizeof(addr);
if (getsockname(new_socket, &addr.addr, &len) == 0)
new_p->type = addr.addr.sa_family;
}
new_p->debug = p->debug;
new_p->nonblocking = p->nonblocking;
new_p->external = false; /* let destructor close socket */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment