xref: /curl/docs/libcurl/libcurl-env-dbg.md (revision e3fe0200)
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
11---
12
13# NAME
14
15libcurl-env-dbg - environment variables libcurl DEBUGBUILD understands
16
17# DESCRIPTION
18
19This is a set of variables only recognized and used if libcurl was built
20"debug enabled", which should never be true for a library used in production.
21These variables are intended for internal use only, subject to change and have
22many effects on the behavior of libcurl. Refer to the source code to determine
23how exactly they are being used.
24
25## CURL_ALTSVC_HTTP
26
27Bypass the AltSvc HTTPS protocol restriction if this variable exists.
28
29## CURL_DBG_SOCK_RBLOCK
30
31The percentage of recv() calls that should be answered with a EAGAIN at random.
32For TCP/UNIX sockets.
33
34## CURL_DBG_SOCK_RMAX
35
36The maximum data that shall be received from the network in one recv() call.
37For TCP/UNIX sockets. This is applied to every recv.
38
39Example: **CURL_DBG_SOCK_RMAX=400** means recv buffer size is limited to a
40maximum of 400 bytes.
41
42## CURL_DBG_SOCK_WBLOCK
43
44The percentage of send() calls that should be answered with a EAGAIN at random.
45For TCP/UNIX sockets.
46
47## CURL_DBG_SOCK_WPARTIAL
48
49The percentage of data that shall be written to the network. For TCP/UNIX
50sockets. This is applied to every send.
51
52Example: **CURL_DBG_SOCK_WPARTIAL=80** means a send with 1000 bytes would
53only send 800.
54
55## CURL_DBG_QUIC_WBLOCK
56
57The percentage of send() calls that should be answered with EAGAIN at random.
58QUIC only.
59
60## CURL_DEBUG
61
62Trace logging behavior as an alternative to calling curl_global_trace(3).
63
64Example: **CURL_DEBUG=http/2** means trace details about HTTP/2 handling.
65
66## CURL_DEBUG_SIZE
67
68Fake the size returned by CURLINFO_HEADER_SIZE and CURLINFO_REQUEST_SIZE.
69
70## CURL_GETHOSTNAME
71
72Fake the local machine's unqualified hostname for NTLM and SMTP.
73
74## CURL_HSTS_HTTP
75
76Bypass the HSTS HTTPS protocol restriction if this variable exists.
77
78## CURL_FORCETIME
79
80A time of 0 is used for AWS signatures and NTLM if this variable exists.
81
82## CURL_ENTROPY
83
84A fixed faked value to use instead of a proper random number so that functions
85in libcurl that are otherwise getting random outputs can be tested for what
86they generate.
87
88## CURL_SMALLREQSEND
89
90An alternative size of HTTP data to be sent at a time only if smaller than the
91current.
92
93## CURL_SMALLSENDS
94
95An alternative size of socket data to be sent at a time only if smaller than
96the current.
97
98## CURL_TIME
99
100Fake unix timestamp to use for AltSvc, HSTS and CURLINFO variables that are
101time related.
102
103This variable can also be used to fake the data returned by some CURLINFO
104variables that are not time-related (such as CURLINFO_LOCAL_PORT), and in that
105case the value is not a timestamp.
106
107## CURL_TRACE
108
109LDAP tracing is enabled if this variable exists and its value is 1 or greater.
110
111OpenLDAP tracing is separate. Refer to CURL_OPENLDAP_TRACE.
112
113## CURL_NTLM_WB_FILE
114
115Debug-version of the *ntlm-wb* executable.
116
117## CURL_OPENLDAP_TRACE
118
119OpenLDAP tracing is enabled if this variable exists and its value is 1 or
120greater. There is a number of debug levels, refer to *openldap.c* comments.
121
122## CURL_WS_CHUNK_SIZE
123
124Used to influence the buffer chunk size used for WebSocket encoding and
125decoding.
126