[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[gnurl] 66/264: getinfo: provide CURLINFO_HEADER_SIZE and CURLINFO_REQUE
From: |
gnunet |
Subject: |
[gnurl] 66/264: getinfo: provide CURLINFO_HEADER_SIZE and CURLINFO_REQUEST_SIZE override |
Date: |
Thu, 30 Apr 2020 16:06:09 +0200 |
This is an automated email from the git hooks/post-receive script.
nikita pushed a commit to branch master
in repository gnurl.
commit c448c4840eafcac9eb3e7af355821f9394888466
Author: Daniel Stenberg <address@hidden>
AuthorDate: Sun Mar 22 12:25:46 2020 +0100
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
---
lib/getinfo.c | 13 +++++++++++++
tests/data/test970 | 3 ++-
2 files changed, 15 insertions(+), 1 deletion(-)
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) {
diff --git a/tests/data/test970 b/tests/data/test970
index 3496a2a73..04a663bc9 100644
--- a/tests/data/test970
+++ b/tests/data/test970
@@ -36,6 +36,7 @@ debug
</features>
<setenv>
CURL_TIME=13
+CURL_DEBUG_SIZE=4019
CURL_VERSION=curl-unit-test-fake-version
</setenv>
<name>
@@ -59,7 +60,7 @@ Accept: */*
</protocol>
<stdout nonewline="yes">
-{"url_effective":"http://%HOSTIP:%HTTPPORT/970","http_code":200,"response_code":200,"http_connect":0,"time_total":0.000013,"time_namelookup":0.000013,"time_connect":0.000013,"time_appconnect":0.000013,"time_pretransfer":0.000013,"time_starttransfer":0.000013,"size_header":252,"size_request":85,"size_download":445,"size_upload":0,"speed_download":0.000013,"speed_upload":0.000013,"content_type":"text/html","num_connects":1,"time_redirect":0.000013,"num_redirects":0,"ssl_verify_result":0,"p
[...]
+{"url_effective":"http://%HOSTIP:%HTTPPORT/970","http_code":200,"response_code":200,"http_connect":0,"time_total":0.000013,"time_namelookup":0.000013,"time_connect":0.000013,"time_appconnect":0.000013,"time_pretransfer":0.000013,"time_starttransfer":0.000013,"size_header":4019,"size_request":4019,"size_download":445,"size_upload":0,"speed_download":0.000013,"speed_upload":0.000013,"content_type":"text/html","num_connects":1,"time_redirect":0.000013,"num_redirects":0,"ssl_verify_result":0
[...]
</stdout>
</verify>
</testcase>
--
To stop receiving notification emails like this one, please contact
address@hidden.
- [gnurl] 49/264: gnutls: remove the BACKEND define kludge, (continued)
- [gnurl] 49/264: gnutls: remove the BACKEND define kludge, gnunet, 2020/04/30
- [gnurl] 44/264: RELEASE-NOTES: synced, gnunet, 2020/04/30
- [gnurl] 51/264: wolfssl: remove the BACKEND define kludge, gnunet, 2020/04/30
- [gnurl] 33/264: ci/tests: increase timeouts for torture builds on Azure Pipelines, gnunet, 2020/04/30
- [gnurl] 59/264: ci/tests: fix Azure Pipelines not running Windows containers, gnunet, 2020/04/30
- [gnurl] 54/264: secure transport: remove the BACKEND define kludge, gnunet, 2020/04/30
- [gnurl] 57/264: cmdline: fix handling of OperationConfig linked list (--next), gnunet, 2020/04/30
- [gnurl] 43/264: http2: Fix erroneous debug message that h2 connection closed, gnunet, 2020/04/30
- [gnurl] 52/264: bearssl: remove the BACKEND define kludge, gnunet, 2020/04/30
- [gnurl] 64/264: CURLINFO_NUM_CONNECTS: improve accuracy, gnunet, 2020/04/30
- [gnurl] 66/264: getinfo: provide CURLINFO_HEADER_SIZE and CURLINFO_REQUEST_SIZE override,
gnunet <=
- [gnurl] 16/264: ci/tests: install test suite dependencies stunnel and impacket, gnunet, 2020/04/30
- [gnurl] 69/264: cirrus: make freebsd ignore the tests instead of skipping, gnunet, 2020/04/30
- [gnurl] 71/264: RELEASE-NOTES: synced, gnunet, 2020/04/30
- [gnurl] 21/264: select: add 'timeout_ms' wrap-around precaution to Curl_select, gnunet, 2020/04/30
- [gnurl] 79/264: travis: update the ngtcp2 build to use the latest OpenSSL patch, gnunet, 2020/04/30
- [gnurl] 70/264: OS400: Update strings for ccsid-ifier, gnunet, 2020/04/30
- [gnurl] 73/264: packages: add OS400/chkstrings.c to the dist, gnunet, 2020/04/30
- [gnurl] 50/264: nss: remove the BACKEND define kludge, gnunet, 2020/04/30
- [gnurl] 62/264: lib/curl_setup: adjust the copyright year range, gnunet, 2020/04/30
- [gnurl] 78/264: CI: remove default Ubuntu build from GitHub Actions, gnunet, 2020/04/30