diff options
author | dartraiden <wowemuh@gmail.com> | 2024-05-24 23:43:03 +0300 |
---|---|---|
committer | dartraiden <wowemuh@gmail.com> | 2024-05-24 23:43:03 +0300 |
commit | ff76fe6c8f1e3b34c5571437612a038077f29860 (patch) | |
tree | 0ae912a13465fa5658253185d4eeab21d6ecdfde /libs/libcurl/src/http_chunks.c | |
parent | 174bf88b63eaf4b49c00894a3f14fbf9194cae02 (diff) |
libcurl: update to 8.8.0
Diffstat (limited to 'libs/libcurl/src/http_chunks.c')
-rw-r--r-- | libs/libcurl/src/http_chunks.c | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/libs/libcurl/src/http_chunks.c b/libs/libcurl/src/http_chunks.c index eb05ea9190..f9c7ad3bab 100644 --- a/libs/libcurl/src/http_chunks.c +++ b/libs/libcurl/src/http_chunks.c @@ -28,6 +28,7 @@ #include "urldata.h" /* it includes http_chunks.h */
#include "curl_printf.h"
+#include "curl_trc.h"
#include "sendf.h" /* for the client write stuff */
#include "dynbuf.h"
#include "content_encoding.h"
@@ -185,8 +186,11 @@ static CURLcode httpchunk_readwrite(struct Curl_easy *data, if(0 == ch->datasize) {
ch->state = CHUNK_TRAILER; /* now check for trailers */
}
- else
+ else {
ch->state = CHUNK_DATA;
+ CURL_TRC_WRITE(data, "http_chunked, chunk start of %"
+ CURL_FORMAT_CURL_OFF_T " bytes", ch->datasize);
+ }
}
buf++;
@@ -221,6 +225,9 @@ static CURLcode httpchunk_readwrite(struct Curl_easy *data, ch->datasize -= piece; /* decrease amount left to expect */
buf += piece; /* move read pointer forward */
blen -= piece; /* decrease space left in this round */
+ CURL_TRC_WRITE(data, "http_chunked, write %zu body bytes, %"
+ CURL_FORMAT_CURL_OFF_T " bytes in chunk remain",
+ piece, ch->datasize);
if(0 == ch->datasize)
/* end of data this round, we now expect a trailing CRLF */
@@ -340,11 +347,14 @@ static CURLcode httpchunk_readwrite(struct Curl_easy *data, even if there's no more chunks to read */
ch->datasize = blen;
ch->state = CHUNK_DONE;
+ CURL_TRC_WRITE(data, "http_chunk, response complete");
return CURLE_OK;
}
else {
ch->state = CHUNK_FAILED;
ch->last_code = CHUNKE_BAD_CHUNK;
+ CURL_TRC_WRITE(data, "http_chunk error, expected 0x0a, seeing 0x%ux",
+ (unsigned int)*buf);
return CURLE_RECV_ERROR;
}
case CHUNK_DONE:
@@ -498,6 +508,7 @@ static CURLcode add_last_chunk(struct Curl_easy *data, int rc;
if(!data->set.trailer_callback) {
+ CURL_TRC_READ(data, "http_chunk, added last, empty chunk");
return Curl_bufq_cwrite(&ctx->chunkbuf, STRCONST("0\r\n\r\n"), &n);
}
@@ -535,6 +546,8 @@ static CURLcode add_last_chunk(struct Curl_easy *data, out:
curl_slist_free_all(trailers);
+ CURL_TRC_READ(data, "http_chunk, added last chunk with trailers "
+ "from client -> %d", result);
return result;
}
@@ -581,6 +594,8 @@ static CURLcode add_chunk(struct Curl_easy *data, result = Curl_bufq_cwrite(&ctx->chunkbuf, buf, nread, &n);
if(!result)
result = Curl_bufq_cwrite(&ctx->chunkbuf, "\r\n", 2, &n);
+ CURL_TRC_READ(data, "http_chunk, made chunk of %zu bytes -> %d",
+ nread, result);
if(result)
return result;
}
|