summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--content/fetchers/fetch_curl.c8
-rw-r--r--desktop/options.c4
-rw-r--r--desktop/options.h1
3 files changed, 13 insertions, 0 deletions
diff --git a/content/fetchers/fetch_curl.c b/content/fetchers/fetch_curl.c
index 1f889b99d..209f9e062 100644
--- a/content/fetchers/fetch_curl.c
+++ b/content/fetchers/fetch_curl.c
@@ -1288,6 +1288,12 @@ fetch_curl_finalise(const char *scheme)
}
}
+/** Ignore everything given to it.
+ *
+ * Used to ignore cURL debug.
+ */
+int fetch_curl_ignore(void) { return 0; }
+
/**
* Initialise the fetcher.
*
@@ -1331,6 +1337,8 @@ void register_curl_fetchers(void)
SETOPT(CURLOPT_VERBOSE, 0);
}
SETOPT(CURLOPT_ERRORBUFFER, fetch_error_buffer);
+ if (option_suppress_curl_debug)
+ SETOPT(CURLOPT_DEBUGFUNCTION, fetch_curl_ignore);
SETOPT(CURLOPT_WRITEFUNCTION, fetch_curl_data);
SETOPT(CURLOPT_HEADERFUNCTION, fetch_curl_header);
SETOPT(CURLOPT_PROGRESSFUNCTION, fetch_curl_progress);
diff --git a/desktop/options.c b/desktop/options.c
index 12867e00c..ed4af4ccd 100644
--- a/desktop/options.c
+++ b/desktop/options.c
@@ -128,6 +128,9 @@ int option_max_fetchers_per_host = 2;
* is this plus option_max_fetchers.
*/
int option_max_cached_fetch_handles = 6;
+/** Suppress debug output from cURL. */
+bool option_suppress_curl_debug = true;
+
/** Whether to allow target="_blank" */
bool option_target_blank = true;
@@ -181,6 +184,7 @@ struct {
OPTION_INTEGER, &option_max_fetchers_per_host },
{ "max_cached_fetch_handles",
OPTION_INTEGER, &option_max_cached_fetch_handles },
+ { "suppress_curl_debug", OPTION_BOOL, &option_suppress_curl_debug },
{ "target_blank",
OPTION_BOOL, &option_target_blank },
EXTRA_OPTION_TABLE
diff --git a/desktop/options.h b/desktop/options.h
index 8ecc0c407..007605469 100644
--- a/desktop/options.h
+++ b/desktop/options.h
@@ -73,6 +73,7 @@ extern int option_toolbar_status_width;
extern int option_max_fetchers;
extern int option_max_fetchers_per_host;
extern int option_max_cached_fetch_handles;
+extern bool option_suppress_curl_debug;
void options_read(const char *path);