aboutsummaryrefslogtreecommitdiff
path: root/src/util/network.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/util/network.c')
-rw-r--r--src/util/network.c24
1 files changed, 16 insertions, 8 deletions
diff --git a/src/util/network.c b/src/util/network.c
index 54abcaba1..9323389ee 100644
--- a/src/util/network.c
+++ b/src/util/network.c
@@ -508,15 +508,16 @@ GNUNET_NETWORK_socket_recvfrom_amount (const struct GNUNET_NETWORK_Handle *
508 508
509 error = ioctl (desc->fd, FIONREAD, &pending); 509 error = ioctl (desc->fd, FIONREAD, &pending);
510 if (error == 0) 510 if (error == 0)
511 return (ssize_t) pending;
512 return GNUNET_NO;
511#else 513#else
512 u_long pending; 514 u_long pending;
513 515
514 error = ioctlsocket (desc->fd, FIONREAD, &pending); 516 error = ioctlsocket (desc->fd, FIONREAD, &pending);
515 if (error != SOCKET_ERROR) 517 if (error != SOCKET_ERROR)
518 return (ssize_t) pending;
519 return GNUNET_NO;
516#endif 520#endif
517 return pending;
518 else
519 return GNUNET_NO;
520} 521}
521 522
522 523
@@ -1079,7 +1080,6 @@ GNUNET_NETWORK_socket_select (struct GNUNET_NETWORK_FDSet *rfds,
1079 const struct GNUNET_TIME_Relative timeout) 1080 const struct GNUNET_TIME_Relative timeout)
1080{ 1081{
1081 int nfds = 0; 1082 int nfds = 0;
1082
1083#ifdef MINGW 1083#ifdef MINGW
1084 int handles = 0; 1084 int handles = 0;
1085 int ex_handles = 0; 1085 int ex_handles = 0;
@@ -1090,7 +1090,9 @@ GNUNET_NETWORK_socket_select (struct GNUNET_NETWORK_FDSet *rfds,
1090 int retcode = 0; 1090 int retcode = 0;
1091 DWORD ms_total = 0; 1091 DWORD ms_total = 0;
1092 1092
1093 int nsock = 0, nhandles = 0, nSockEvents = 0; 1093 int nsock = 0;
1094 int nhandles = 0;
1095 int nSockEvents = 0;
1094 1096
1095 static HANDLE hEventRead = 0; 1097 static HANDLE hEventRead = 0;
1096 static HANDLE hEventWrite = 0; 1098 static HANDLE hEventWrite = 0;
@@ -1106,12 +1108,18 @@ GNUNET_NETWORK_socket_select (struct GNUNET_NETWORK_FDSet *rfds,
1106 DWORD newretcode = 0; 1108 DWORD newretcode = 0;
1107 int returnedpos = 0; 1109 int returnedpos = 0;
1108 1110
1109 struct GNUNET_CONTAINER_SList *handles_read, *handles_write, *handles_except; 1111 struct GNUNET_CONTAINER_SList *handles_read;
1112 struct GNUNET_CONTAINER_SList *handles_write;
1113 struct GNUNET_CONTAINER_SList *handles_except;
1110 1114
1111 fd_set aread, awrite, aexcept; 1115 fd_set aread;
1116 fd_set awrite;
1117 fd_set except;
1112 1118
1113#if DEBUG_NETWORK 1119#if DEBUG_NETWORK
1114 fd_set bread, bwrite, bexcept; 1120 fd_set bread;
1121 fd_set bwrite;
1122 fd_set bexcept;
1115#endif 1123#endif
1116 1124
1117 /* TODO: Make this growable */ 1125 /* TODO: Make this growable */