mirror of
https://github.com/curl/curl.git
synced 2026-06-17 02:05:43 +03:00
David Byron identified the lack of SSL_pending() use, and this is my take
at fixing this issue.
This commit is contained in:
parent
61a1e3cd01
commit
8c83422fe2
1 changed files with 14 additions and 1 deletions
|
|
@ -242,6 +242,19 @@ CURLcode Curl_readrewind(struct connectdata *conn)
|
|||
return CURLE_OK;
|
||||
}
|
||||
|
||||
#ifdef USE_SSLEAY
|
||||
static int data_pending(struct connectdata *conn)
|
||||
{
|
||||
if(conn->ssl[FIRSTSOCKET].handle)
|
||||
/* SSL is in use */
|
||||
return SSL_pending(conn->ssl[FIRSTSOCKET].handle);
|
||||
|
||||
return 0; /* nothing */
|
||||
}
|
||||
#else
|
||||
/* non-SSL never have pending data */
|
||||
#define data_pending(x) 0
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Curl_readwrite() is the low-level function to be called when data is to
|
||||
|
|
@ -1147,7 +1160,7 @@ CURLcode Curl_readwrite(struct connectdata *conn,
|
|||
k->keepon &= ~KEEP_READ;
|
||||
}
|
||||
|
||||
} while(0);
|
||||
} while(data_pending(conn));
|
||||
|
||||
} /* if( read from socket ) */
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue