Commit f5454d50 authored by Minun Dragonation's avatar Minun Dragonation
Browse files

fix bugs on socket timeout tv usec calculation

parent 4a94ce63
...@@ -197,7 +197,7 @@ int win32_getsockopt(SOCKET sockfd, int level, int optname, void *optval, sockle ...@@ -197,7 +197,7 @@ int win32_getsockopt(SOCKET sockfd, int level, int optname, void *optval, sockle
socklen_t dwlen = 0; socklen_t dwlen = 0;
ret = getsockopt(sockfd, level, optname, (char *)&timeout, &dwlen); ret = getsockopt(sockfd, level, optname, (char *)&timeout, &dwlen);
tv->tv_sec = timeout / 1000; tv->tv_sec = timeout / 1000;
tv->tv_usec = timeout * 1000; tv->tv_usec = (timeout * 1000) % 1000000;
} else { } else {
ret = WSAEFAULT; ret = WSAEFAULT;
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment