mirror of
https://github.com/moparisthebest/curl
synced 2024-12-22 08:08:50 -05:00
pingpong: Check SSL library buffers for already read data
Otherwise the connection can get stuck during various phases, waiting for new data on the socket using select() etc., but it will never be received as the data has already been read into SSL library.
This commit is contained in:
parent
e20e48cbf2
commit
6d9cddc513
@ -33,6 +33,7 @@
|
|||||||
#include "pingpong.h"
|
#include "pingpong.h"
|
||||||
#include "multiif.h"
|
#include "multiif.h"
|
||||||
#include "non-ascii.h"
|
#include "non-ascii.h"
|
||||||
|
#include "sslgen.h"
|
||||||
|
|
||||||
#define _MPRINTF_REPLACE /* use our functions only */
|
#define _MPRINTF_REPLACE /* use our functions only */
|
||||||
#include <curl/mprintf.h>
|
#include <curl/mprintf.h>
|
||||||
@ -105,6 +106,9 @@ CURLcode Curl_pp_statemach(struct pingpong *pp, bool block)
|
|||||||
if(Curl_pp_moredata(pp))
|
if(Curl_pp_moredata(pp))
|
||||||
/* We are receiving and there is data in the cache so just read it */
|
/* We are receiving and there is data in the cache so just read it */
|
||||||
rc = 1;
|
rc = 1;
|
||||||
|
else if(!pp->sendleft && Curl_ssl_data_pending(conn, FIRSTSOCKET))
|
||||||
|
/* We are receiving and there is data ready in the SSL library */
|
||||||
|
rc = 1;
|
||||||
else
|
else
|
||||||
rc = Curl_socket_ready(pp->sendleft?CURL_SOCKET_BAD:sock, /* reading */
|
rc = Curl_socket_ready(pp->sendleft?CURL_SOCKET_BAD:sock, /* reading */
|
||||||
pp->sendleft?sock:CURL_SOCKET_BAD, /* writing */
|
pp->sendleft?sock:CURL_SOCKET_BAD, /* writing */
|
||||||
|
Loading…
Reference in New Issue
Block a user