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