summaryrefslogtreecommitdiff
path: root/lib/sendf.c
diff options
context:
space:
mode:
authorJay Satiro <raysatiro@yahoo.com>2016-12-08 16:32:36 -0500
committerJay Satiro <raysatiro@yahoo.com>2016-12-19 02:26:52 -0500
commitd00f2a8f2e8529024709f70c8ab4c4138dc651a0 (patch)
treeaa867b0c1a2d4f5f3f59541d4990adf8576a27c3 /lib/sendf.c
parentafb57f7b0bfe179b1d31acf652cc136349de32ec (diff)
downloadcurl-d00f2a8f2e8529024709f70c8ab4c4138dc651a0.tar.gz
http_proxy: Fix proxy CONNECT hang on pending data
- Check for pending data before waiting on the socket. Bug: https://github.com/curl/curl/issues/1156 Reported-by: Adam Langley
Diffstat (limited to 'lib/sendf.c')
-rw-r--r--lib/sendf.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/sendf.c b/lib/sendf.c
index 29333e0e2..c3458a2b6 100644
--- a/lib/sendf.c
+++ b/lib/sendf.c
@@ -122,6 +122,13 @@ static size_t convert_lineends(struct Curl_easy *data,
#endif /* CURL_DO_LINEEND_CONV */
#ifdef USE_RECV_BEFORE_SEND_WORKAROUND
+bool Curl_recv_has_postponed_data(struct connectdata *conn, int sockindex)
+{
+ struct postponed_data * const psnd = &(conn->postponed[sockindex]);
+ return psnd->buffer && psnd->allocated_size &&
+ psnd->recv_size > psnd->recv_processed;
+}
+
static void pre_receive_plain(struct connectdata *conn, int num)
{
const curl_socket_t sockfd = conn->sock[num];
@@ -201,6 +208,10 @@ static ssize_t get_pre_recved(struct connectdata *conn, int num, char *buf,
}
#else /* ! USE_RECV_BEFORE_SEND_WORKAROUND */
/* Use "do-nothing" macros instead of functions when workaround not used */
+bool Curl_recv_has_postponed_data(struct connectdata *conn, int sockindex)
+{
+ return false;
+}
#define pre_receive_plain(c,n) do {} WHILE_FALSE
#define get_pre_recved(c,n,b,l) 0
#endif /* ! USE_RECV_BEFORE_SEND_WORKAROUND */