File tree 1 file changed +6
-2
lines changed
1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change 24
24
#include "mongoc-socket.h"
25
25
#include "mongoc-trace.h"
26
26
27
-
28
27
#undef MONGOC_LOG_DOMAIN
29
28
#define MONGOC_LOG_DOMAIN "socket"
30
29
@@ -148,14 +147,18 @@ _mongoc_socket_wait (int sd, /* IN */
148
147
ret = WSAPoll (& pfd , 1 , timeout );
149
148
if (ret == SOCKET_ERROR ) {
150
149
MONGOC_WARNING ("WSAGetLastError(): %d" , WSAGetLastError ());
151
- ret = -1 ;
150
+ ret = false ;
152
151
}
153
152
#else
154
153
ret = poll (& pfd , 1 , timeout );
155
154
#endif
156
155
157
156
if (ret > 0 ) {
157
+ #ifdef _WIN32
158
+ RETURN (0 != (pfd .revents & (events | POLLHUP | POLLERR )));
159
+ #else
158
160
RETURN (0 != (pfd .revents & events ));
161
+ #endif
159
162
}
160
163
161
164
RETURN (false);
@@ -412,6 +415,7 @@ mongoc_socket_close (mongoc_socket_t *sock) /* IN */
412
415
413
416
#ifdef _WIN32
414
417
if (sock -> sd != INVALID_SOCKET ) {
418
+ shutdown (sock -> sd , SD_BOTH );
415
419
ret = closesocket (sock -> sd );
416
420
}
417
421
#else
You can’t perform that action at this time.
0 commit comments