mirror of
https://github.com/lunarmodules/luasocket.git
synced 2024-12-26 04:28:20 +01:00
Corrected connect in windows. Wasn't setting errno...
This commit is contained in:
parent
3a7ac1e043
commit
68d57dc931
@ -87,8 +87,14 @@ int sock_connect(p_sock ps, SA *addr, socklen_t addr_len, int timeout)
|
||||
/* if select returned due to an event */
|
||||
if (err > 0 ) {
|
||||
/* the sets tell whether it was a sucess or failure */
|
||||
if (FD_ISSET(sock,&efds) || !FD_ISSET(sock,&wfds)) return IO_ERROR;
|
||||
else return IO_DONE;
|
||||
if (FD_ISSET(sock,&efds) || !FD_ISSET(sock,&wfds)) {
|
||||
int why;
|
||||
int len = sizeof(why);
|
||||
/* find out why it failed */
|
||||
getsockopt(sock, SOL_SOCKET, SO_ERROR, (char *)&why, &len);
|
||||
WSASetLastError(why);
|
||||
return IO_ERROR;
|
||||
} else return IO_DONE;
|
||||
/* if nothing happened, we timed out */
|
||||
} else if (err == 0) return IO_TIMEOUT;
|
||||
/* otherwise, I don't know what happened */
|
||||
|
@ -4,7 +4,7 @@ local qptest = "qptest.bin"
|
||||
local eqptest = "qptest.bin2"
|
||||
local dqptest = "qptest.bin3"
|
||||
|
||||
local b64test = "luasocket"
|
||||
local b64test = "luasocket.exe"
|
||||
local eb64test = "b64test.bin"
|
||||
local db64test = "b64test.bin2"
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user