Sync with trunk r63174.
[reactos.git] / dll / win32 / winhttp / net.c
index 0f5dc7f..225442d 100644 (file)
@@ -705,24 +705,23 @@ BOOL netconn_recv( netconn_t *conn, void *buf, size_t len, int flags, int *recvd
     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 )