diff options
author | dartraiden <wowemuh@gmail.com> | 2019-05-22 15:38:52 +0300 |
---|---|---|
committer | dartraiden <wowemuh@gmail.com> | 2019-05-22 15:38:52 +0300 |
commit | 2dc913b65c76e8f51989cc20ce0ce8b1b087db37 (patch) | |
tree | 6b44ea975bd3fac9562ac10213aa67c1b95da03a /libs/libcurl/src/sendf.c | |
parent | 06eb563066b96fc1c4931f3a5dcf17c4f6fa32c5 (diff) |
libcurl: update to 7.65
Diffstat (limited to 'libs/libcurl/src/sendf.c')
-rw-r--r-- | libs/libcurl/src/sendf.c | 40 |
1 files changed, 6 insertions, 34 deletions
diff --git a/libs/libcurl/src/sendf.c b/libs/libcurl/src/sendf.c index 5008d9333d..5913ea4060 100644 --- a/libs/libcurl/src/sendf.c +++ b/libs/libcurl/src/sendf.c @@ -595,7 +595,10 @@ static CURLcode chop_write(struct connectdata *conn, size_t chunklen = len <= CURL_MAX_WRITE_SIZE? len: CURL_MAX_WRITE_SIZE; if(writebody) { - size_t wrote = writebody(ptr, 1, chunklen, data->set.out); + size_t wrote; + Curl_set_in_callback(data, true); + wrote = writebody(ptr, 1, chunklen, data->set.out); + Curl_set_in_callback(data, false); if(CURL_WRITEFUNC_PAUSE == wrote) { if(conn->handler->flags & PROTOPT_NONETWORK) { @@ -724,10 +727,6 @@ CURLcode Curl_read(struct connectdata *conn, /* connection data */ char *buffertofill = NULL; struct Curl_easy *data = conn->data; - /* if HTTP/1 pipelining is both wanted and possible */ - bool pipelining = Curl_pipeline_wanted(data->multi, CURLPIPE_HTTP1) && - (conn->bundle->multiuse == BUNDLE_PIPELINING); - /* Set 'num' to 0 or 1, depending on which socket that has been sent here. If it is the second socket, we set num to 1. Otherwise to 0. This lets us use the correct ssl handle. */ @@ -735,40 +734,13 @@ CURLcode Curl_read(struct connectdata *conn, /* connection data */ *n = 0; /* reset amount to zero */ - /* If session can pipeline, check connection buffer */ - if(pipelining) { - size_t bytestocopy = CURLMIN(conn->buf_len - conn->read_pos, - sizerequested); - - /* Copy from our master buffer first if we have some unread data there*/ - if(bytestocopy > 0) { - memcpy(buf, conn->master_buffer + conn->read_pos, bytestocopy); - conn->read_pos += bytestocopy; - conn->bits.stream_was_rewound = FALSE; - - *n = (ssize_t)bytestocopy; - return CURLE_OK; - } - /* If we come here, it means that there is no data to read from the buffer, - * so we read from the socket */ - bytesfromsocket = CURLMIN(sizerequested, MASTERBUF_SIZE); - buffertofill = conn->master_buffer; - } - else { - bytesfromsocket = CURLMIN(sizerequested, (size_t)data->set.buffer_size); - buffertofill = buf; - } + bytesfromsocket = CURLMIN(sizerequested, (size_t)data->set.buffer_size); + buffertofill = buf; nread = conn->recv[num](conn, num, buffertofill, bytesfromsocket, &result); if(nread < 0) return result; - if(pipelining) { - memcpy(buf, conn->master_buffer, nread); - conn->buf_len = nread; - conn->read_pos = nread; - } - *n += nread; return CURLE_OK; |