diff options
author | Minun Dragonation <minun@mewmew.cn> | 2019-05-05 21:58:34 +0800 |
---|---|---|
committer | Minun Dragonation <minun@mewmew.cn> | 2019-05-05 21:58:34 +0800 |
commit | f5454d509f9eafef35714c4e5e23af066e80f4f6 (patch) | |
tree | 26d1588c1fcf2c861b2fdf33a95656d485b996fb | |
parent | 4a94ce6326c51a2071025e929a3ab2a5263206f7 (diff) |
fix bugs on socket timeout tv usec calculation
-rw-r--r-- | sockcompat.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sockcompat.c b/sockcompat.c index 38cb9e5..c3b6f66 100644 --- a/sockcompat.c +++ b/sockcompat.c @@ -197,7 +197,7 @@ int win32_getsockopt(SOCKET sockfd, int level, int optname, void *optval, sockle socklen_t dwlen = 0; ret = getsockopt(sockfd, level, optname, (char *)&timeout, &dwlen); tv->tv_sec = timeout / 1000; - tv->tv_usec = timeout * 1000; + tv->tv_usec = (timeout * 1000) % 1000000; } else { ret = WSAEFAULT; } |