Skip to content

Commit fe37797

Browse files
tcl3trflynn89
authored andcommitted
RequestServer: Add a CURL_DEBUG flag
This sets `CURLOPT_VERBOSE` to 1, which enables detailed logging of all cURL connections to stderr.
1 parent 61a0898 commit fe37797

File tree

3 files changed

+8
-0
lines changed

3 files changed

+8
-0
lines changed

AK/Debug.h.in

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,10 @@
5454
# cmakedefine01 CSS_TRANSITIONS_DEBUG
5555
#endif
5656

57+
#ifndef CURL_DEBUG
58+
# cmakedefine01 CURL_DEBUG
59+
#endif
60+
5761
#ifndef DEVTOOLS_DEBUG
5862
# cmakedefine01 DEVTOOLS_DEBUG
5963
#endif

Meta/CMake/all_the_debug_macros.cmake

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ set(CSS_LOADER_DEBUG ON)
99
set(CSS_PARSER_DEBUG ON)
1010
set(CSS_TOKENIZER_DEBUG ON)
1111
set(CSS_TRANSITIONS_DEBUG ON)
12+
set(CURL_DEBUG ON)
1213
set(DEVTOOLS_DEBUG ON)
1314
set(DNS_DEBUG ON)
1415
set(EDITOR_DEBUG ON)

Services/RequestServer/Request.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -339,6 +339,9 @@ void Request::handle_fetch_state()
339339

340340
set_option(CURLOPT_CUSTOMREQUEST, m_method.characters());
341341
set_option(CURLOPT_FOLLOWLOCATION, 0);
342+
if constexpr (CURL_DEBUG) {
343+
set_option(CURLOPT_VERBOSE, 1);
344+
}
342345

343346
#if defined(AK_OS_WINDOWS)
344347
// Without explicitly using the OS Native CA cert store on Windows, https requests timeout with CURLE_PEER_FAILED_VERIFICATION

0 commit comments

Comments
 (0)