aboutsummaryrefslogtreecommitdiff
path: root/lib/getinfo.c
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2020-03-22 12:25:46 +0100
committerDaniel Stenberg <daniel@haxx.se>2020-03-22 23:32:57 +0100
commitc448c4840eafcac9eb3e7af355821f9394888466 (patch)
tree2e55c9338525161fee45c9cbe25ae5879e5ae20c /lib/getinfo.c
parent9a7e62e7c32b4324bd80047765d03b3a3c42465b (diff)
getinfo: provide CURLINFO_HEADER_SIZE and CURLINFO_REQUEST_SIZE override
To let debug-builds return fake values, like in test 970. Ref: #5131 Closes #5136
Diffstat (limited to 'lib/getinfo.c')
-rw-r--r--lib/getinfo.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/getinfo.c b/lib/getinfo.c
index 9aac5e2b8..18274e964 100644
--- a/lib/getinfo.c
+++ b/lib/getinfo.c
@@ -159,6 +159,19 @@ static CURLcode getinfo_long(struct Curl_easy *data, CURLINFO info,
break;
}
}
+ /* use another variable for this to allow different values */
+ timestr = getenv("CURL_DEBUG_SIZE");
+ if(timestr) {
+ unsigned long val = strtol(timestr, NULL, 10);
+ switch(info) {
+ case CURLINFO_HEADER_SIZE:
+ case CURLINFO_REQUEST_SIZE:
+ *param_longp = (long)val;
+ return CURLE_OK;
+ default:
+ break;
+ }
+ }
#endif
switch(info) {