mirror of
https://github.com/vale981/ray
synced 2025-03-09 04:46:38 -04:00
31 lines
791 B
Diff
31 lines
791 B
Diff
![]() |
diff --git deps/hiredis/net.c deps/hiredis/net.c
|
||
|
--- deps/hiredis/net.c
|
||
|
+++ deps/hiredis/net.c
|
||
|
@@ -204,11 +204,24 @@
|
||
|
static int redisContextWaitReady(redisContext *c, long msec) {
|
||
|
+#ifdef _WINSOCKAPI_
|
||
|
+ fd_set wset;
|
||
|
+
|
||
|
+ FD_ZERO(&wset);
|
||
|
+ FD_SET(c->fd, &wset);
|
||
|
+#else
|
||
|
struct pollfd wfd[1];
|
||
|
|
||
|
wfd[0].fd = c->fd;
|
||
|
wfd[0].events = POLLOUT;
|
||
|
+#endif
|
||
|
|
||
|
if (errno == EINPROGRESS) {
|
||
|
int res;
|
||
|
|
||
|
+#ifdef _WINSOCKAPI_
|
||
|
+ struct timeval tv = { msec / 1000, (msec % 1000) * 1000 };
|
||
|
+ res = select(c->fd + 1, NULL, &wset, NULL, msec >= 0 ? &tv : NULL);
|
||
|
+#else
|
||
|
+ res = poll(wfd, 1, msec);
|
||
|
+#endif
|
||
|
- if ((res = poll(wfd, 1, msec)) == -1) {
|
||
|
+ if (res == -1) {
|
||
|
__redisSetErrorFromErrno(c, REDIS_ERR_IO, "poll(2)");
|
||
|
--
|