return TRUE;
}
-BOOL netconn_query_data_available( netconn_t *conn, DWORD *available )
+ULONG netconn_query_data_available( netconn_t *conn )
{
-#ifdef FIONREAD
- int ret;
- ULONG unread;
-#endif
- *available = 0;
- if (!netconn_connected( conn )) return FALSE;
+ if(!netconn_connected(conn))
+ return 0;
- if (conn->secure)
- {
- *available = conn->peek_len;
- return TRUE;
- }
+ if(conn->secure) {
+ return conn->peek_len;
+ }else {
#ifdef FIONREAD
- if (!(ret = ioctlsocket( conn->socket, FIONREAD, &unread ))) *available = unread;
+ ULONG unread;
+
+ if(!ioctlsocket(conn->socket, FIONREAD, &unread))
+ return unread;
#endif
- return TRUE;
+ }
+
+ return 0;
}
DWORD netconn_set_timeout( netconn_t *netconn, BOOL send, int value )