From 224238491102ec54173eb1e3e3b5cfe16806a770 Mon Sep 17 00:00:00 2001 From: Karlson2k Date: Mon, 25 Apr 2016 12:12:26 +0300 Subject: url.c: fixed DEBUGASSERT() for WinSock workaround If buffer is allocated, but nothing is received during prereceive stage, than number of processed bytes must be zero. Closes #778 --- lib/url.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/url.c b/lib/url.c index 792ce777c..1251373c3 100644 --- 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; -- cgit v1.2.3