aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/libs/curl/lib/http_chunks.h
diff options
context:
space:
mode:
authorshadchin <shadchin@yandex-team.ru>2022-04-08 17:59:41 +0300
committershadchin <shadchin@yandex-team.ru>2022-04-08 17:59:41 +0300
commit3ddbfb08ff9f73d895488293e6a83b4ba68b3c5a (patch)
treee9250668656f42d41807809160f7919ef3630ee9 /contrib/libs/curl/lib/http_chunks.h
parent61f0d7ab77dad7c33fb4d2570d36e4e76f672bbf (diff)
downloadydb-3ddbfb08ff9f73d895488293e6a83b4ba68b3c5a.tar.gz
CONTRIB-2513 Update contrib/libs/curl to 7.75.0
ref:7c8de2c266b810de3b31604360c6ad878fa166ab
Diffstat (limited to 'contrib/libs/curl/lib/http_chunks.h')
-rw-r--r--contrib/libs/curl/lib/http_chunks.h21
1 files changed, 10 insertions, 11 deletions
diff --git a/contrib/libs/curl/lib/http_chunks.h b/contrib/libs/curl/lib/http_chunks.h
index c8f072a2de..741a9a3bc3 100644
--- a/contrib/libs/curl/lib/http_chunks.h
+++ b/contrib/libs/curl/lib/http_chunks.h
@@ -7,7 +7,7 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
- * Copyright (C) 1998 - 2020, Daniel Stenberg, <daniel@haxx.se>, et al.
+ * Copyright (C) 1998 - 2021, Daniel Stenberg, <daniel@haxx.se>, et al.
*
* This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms
@@ -26,10 +26,10 @@ struct connectdata;
/*
* The longest possible hexadecimal number we support in a chunked transfer.
- * Weird enough, RFC2616 doesn't set a maximum size! Since we use strtoul()
- * to convert it, we "only" support 2^32 bytes chunk data.
+ * Neither RFC2616 nor the later HTTP specs define a maximum chunk size.
+ * For 64 bit curl_off_t we support 16 digits. For 32 bit, 8 digits.
*/
-#define MAXNUM_SIZE 16
+#define CHUNK_MAXNUM_LEN (SIZEOF_CURL_OFF_T * 2)
typedef enum {
/* await and buffer all hexadecimal digits until we get one that isn't a
@@ -48,7 +48,7 @@ typedef enum {
big deal. */
CHUNK_POSTLF,
- /* Used to mark that we're out of the game. NOTE: that there's a 'dataleft'
+ /* Used to mark that we're out of the game. NOTE: that there's a 'datasize'
field in the struct that will tell how many bytes that were not passed to
the client in the end of the last buffer! */
CHUNK_STOP,
@@ -83,16 +83,15 @@ typedef enum {
const char *Curl_chunked_strerror(CHUNKcode code);
struct Curl_chunker {
- char hexbuffer[ MAXNUM_SIZE + 1];
- int hexindex;
- ChunkyState state;
curl_off_t datasize;
- size_t dataleft; /* untouched data amount at the end of the last buffer */
+ ChunkyState state;
+ unsigned char hexindex;
+ char hexbuffer[ CHUNK_MAXNUM_LEN + 1]; /* +1 for null-terminator */
};
/* The following functions are defined in http_chunks.c */
-void Curl_httpchunk_init(struct connectdata *conn);
-CHUNKcode Curl_httpchunk_read(struct connectdata *conn, char *datap,
+void Curl_httpchunk_init(struct Curl_easy *data);
+CHUNKcode Curl_httpchunk_read(struct Curl_easy *data, char *datap,
ssize_t length, ssize_t *wrote,
CURLcode *passthru);