]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
url.c: fixed DEBUGASSERT() for WinSock workaround
authorKarlson2k <k2k@narod.ru>
Mon, 25 Apr 2016 09:12:26 +0000 (12:12 +0300)
committerDaniel Stenberg <daniel@haxx.se>
Mon, 25 Apr 2016 09:25:18 +0000 (11:25 +0200)
If buffer is allocated, but nothing is received during prereceive
stage, than number of processed bytes must be zero.

Closes #778

lib/url.c

index 792ce777cf1273c95815eee7c6db84a1d6c075c0..1251373c3001e1bd8b0b1766c5d09d1645fd55f2 100644 (file)
--- a/lib/url.c
+++ b/lib/url.c
@@ -2701,7 +2701,9 @@ static void conn_reset_postponed_data(struct connectdata *conn, int num)
   if(psnd->buffer) {
     DEBUGASSERT(psnd->allocated_size > 0);
     DEBUGASSERT(psnd->recv_size <= psnd->allocated_size);
-    DEBUGASSERT(psnd->recv_processed < psnd->recv_size);
+    DEBUGASSERT(psnd->recv_size ?
+                (psnd->recv_processed < psnd->recv_size) :
+                (psnd->recv_processed == 0));
     DEBUGASSERT(psnd->bindsock != CURL_SOCKET_BAD);
     free(psnd->buffer);
     psnd->buffer = NULL;