libcurl-env-dbg.md (5046B)
1 --- 2 c: Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al. 3 SPDX-License-Identifier: curl 4 Title: libcurl-env-dbg 5 Section: 3 6 Source: libcurl 7 See-also: 8 - libcurl-env (3) 9 Protocol: 10 - All 11 Added-in: n/a 12 --- 13 14 # NAME 15 16 libcurl-env-dbg - environment variables libcurl DEBUGBUILD understands 17 18 # DESCRIPTION 19 20 This is a set of variables only recognized and used if libcurl was built 21 "debug enabled", which should never be true for a library used in production. 22 These variables are intended for internal use only, subject to change and have 23 many effects on the behavior of libcurl. Refer to the source code to determine 24 how exactly they are being used. 25 26 ## `CURL_ALTSVC_HTTP` 27 28 Bypass the AltSvc HTTPS protocol restriction if this variable exists. 29 30 ## `CURL_DBG_SOCK_RBLOCK` 31 32 The percentage of recv() calls that should be answered with an EAGAIN at 33 random. For TCP/UNIX sockets. 34 35 ## `CURL_DBG_SOCK_RMAX` 36 37 The maximum data that shall be received from the network in one recv() call. 38 For TCP/UNIX sockets. This is applied to every recv. 39 40 Example: **CURL_DBG_SOCK_RMAX=400** means recv buffer size is limited to a 41 maximum of 400 bytes. 42 43 ## `CURL_DBG_SOCK_WBLOCK` 44 45 The percentage of send() calls that should be answered with an EAGAIN at 46 random. For TCP/UNIX sockets. 47 48 ## `CURL_DBG_SOCK_WPARTIAL` 49 50 The percentage of data that shall be written to the network. For TCP/UNIX 51 sockets. This is applied to every send. 52 53 Example: **CURL_DBG_SOCK_WPARTIAL=80** means a send with 1000 bytes would 54 only send 800. 55 56 ## `CURL_DBG_QUIC_WBLOCK` 57 58 The percentage of send() calls that should be answered with EAGAIN at random. 59 QUIC only. 60 61 ## `CURL_DEBUG` 62 63 Trace logging behavior as an alternative to calling curl_global_trace(3). 64 65 Example: **CURL_DEBUG=http/2** means trace details about HTTP/2 handling. 66 67 In the curl command line tool, built with `--enable-debug`, this environment 68 variable adds to arguments like `--verbose`, `-vvv`. At least a single `-v` 69 is needed to make the run emit trace output, but when it does, the contents 70 of `CURL_DEBUG` are added and can override existing options. 71 72 Example: **CURL_DEBUG=tcp,-http/2 curl -vv url** means trace protocol details, 73 triggered by `-vv`, add tracing of TCP in addition and remove tracing of 74 HTTP/2. 75 76 ## `CURL_DEBUG_SIZE` 77 78 Fake the size returned by CURLINFO_HEADER_SIZE and CURLINFO_REQUEST_SIZE. 79 80 ## `CURL_DNS_SERVER` 81 82 When built with c-ares for name resolving, setting this environment variable 83 to `[IP:port]` makes libcurl use that DNS server instead of the system 84 default. This is used by the curl test suite. 85 86 ## `CURL_FTP_PWD_STOP` 87 88 When set, the first transfer - when using ftp: - returns before sending 89 the `PWD` command and stop any further progress. This is used to test 90 an edge case 91 92 ## `CURL_GETHOSTNAME` 93 94 Fake the local machine's unqualified hostname for NTLM and SMTP. 95 96 ## `CURL_HSTS_HTTP` 97 98 Bypass the HSTS HTTPS protocol restriction if this variable exists. 99 100 ## `CURL_FORCETIME` 101 102 A time of 0 is used for AWS signatures and NTLM if this variable exists. 103 104 ## `CURL_ENTROPY` 105 106 A fixed faked value to use instead of a proper random number so that functions 107 in libcurl that are otherwise getting random outputs can be tested for what 108 they generate. 109 110 ## `CURL_SMALLREQSEND` 111 112 An alternative size of HTTP data to be sent at a time only if smaller than the 113 current. 114 115 ## `CURL_SMALLSENDS` 116 117 An alternative size of socket data to be sent at a time only if smaller than 118 the current. 119 120 ## `CURL_TIME` 121 122 Fake Unix timestamp to use for AltSvc, HSTS and CURLINFO variables that are 123 time related. 124 125 This variable can also be used to fake the data returned by some CURLINFO 126 variables that are not time-related (such as CURLINFO_LOCAL_PORT), and in that 127 case the value is not a timestamp. 128 129 ## `CURL_TRACE` 130 131 LDAP tracing is enabled if this variable exists and its value is 1 or greater. 132 133 OpenLDAP tracing is separate. Refer to CURL_OPENLDAP_TRACE. 134 135 ## `CURL_OPENLDAP_TRACE` 136 137 OpenLDAP tracing is enabled if this variable exists and its value is 1 or 138 greater. There is a number of debug levels, refer to *openldap.c* comments. 139 140 ## `CURL_WS_CHUNK_SIZE` 141 142 Used to influence the buffer chunk size used for WebSocket encoding and 143 decoding. 144 145 ## `CURL_WS_CHUNK_EAGAIN` 146 147 Used to simulate blocking sends after this chunk size for WebSocket 148 connections. 149 150 ## `CURL_WS_FORCE_ZERO_MASK` 151 152 Used to set the bitmask of all sent WebSocket frames to zero. The value of the 153 environment variable does not matter. 154 155 ## `CURL_FORBID_REUSE` 156 157 Used to set the CURLOPT_FORBID_REUSE flag on each transfer initiated 158 by the curl command line tool. The value of the environment variable 159 does not matter. 160 161 ## `CURL_GRACEFUL_SHUTDOWN` 162 163 Make a blocking, graceful shutdown of all remaining connections when 164 a multi handle is destroyed. This implicitly triggers for easy handles 165 that are run via easy_perform. The value of the environment variable 166 gives the shutdown timeout in milliseconds. 167 168 ## `CURL_H2_STREAM_WIN_MAX` 169 170 Set to a positive 32-bit number to override the HTTP/2 stream window's 171 default of 10MB. Used in testing to verify correct window update handling.