File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change 2424#include "mongoc-socket.h"
2525#include "mongoc-trace.h"
2626
27-
2827#undef MONGOC_LOG_DOMAIN
2928#define MONGOC_LOG_DOMAIN "socket"
3029
@@ -148,14 +147,18 @@ _mongoc_socket_wait (int sd, /* IN */
148147 ret = WSAPoll (& pfd , 1 , timeout );
149148 if (ret == SOCKET_ERROR ) {
150149 MONGOC_WARNING ("WSAGetLastError(): %d" , WSAGetLastError ());
151- ret = -1 ;
150+ ret = false ;
152151 }
153152#else
154153 ret = poll (& pfd , 1 , timeout );
155154#endif
156155
157156 if (ret > 0 ) {
157+ #ifdef _WIN32
158+ RETURN (0 != (pfd .revents & (events | POLLHUP | POLLERR )));
159+ #else
158160 RETURN (0 != (pfd .revents & events ));
161+ #endif
159162 }
160163
161164 RETURN (false);
@@ -412,6 +415,7 @@ mongoc_socket_close (mongoc_socket_t *sock) /* IN */
412415
413416#ifdef _WIN32
414417 if (sock -> sd != INVALID_SOCKET ) {
418+ shutdown (sock -> sd , SD_BOTH );
415419 ret = closesocket (sock -> sd );
416420 }
417421#else
You can’t perform that action at this time.
0 commit comments