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

Fix Socket.connect()

Broken with the poll() update
parent 643e3b21
No related branches found
No related tags found
1 merge request!463MRC mods by Codefenix (2024-10-20)
Pipeline #1753 passed
...@@ -865,7 +865,7 @@ js_connect(JSContext *cx, uintN argc, jsval *arglist) ...@@ -865,7 +865,7 @@ js_connect(JSContext *cx, uintN argc, jsval *arglist)
result = ERROR_VALUE; result = ERROR_VALUE;
if(result == EWOULDBLOCK || result == EINPROGRESS) { if(result == EWOULDBLOCK || result == EINPROGRESS) {
result = ETIMEDOUT; result = ETIMEDOUT;
if (socket_readable(p->sock, timeout)) { if (socket_writable(p->sock, timeout)) {
int so_error = -1; int so_error = -1;
socklen_t optlen = sizeof(so_error); socklen_t optlen = sizeof(so_error);
if(getsockopt(p->sock, SOL_SOCKET, SO_ERROR, (void*)&so_error, &optlen) == 0 && so_error == 0) if(getsockopt(p->sock, SOL_SOCKET, SO_ERROR, (void*)&so_error, &optlen) == 0 && so_error == 0)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment