summaryrefslogtreecommitdiff
path: root/content/fetchers
diff options
context:
space:
mode:
authorMichael Drake <tlsa@netsurf-browser.org>2015-11-11 10:38:17 +0000
committerMichael Drake <tlsa@netsurf-browser.org>2015-11-11 10:39:12 +0000
commit401cc36924585ce8292212c73dc8aab372056620 (patch)
tree790d9fa5128fbcbfc061efbaba350208652471bf /content/fetchers
parent4d1ef3bac4ba09423a51af809ef0c9220402f050 (diff)
downloadnetsurf-401cc36924585ce8292212c73dc8aab372056620.tar.gz
netsurf-401cc36924585ce8292212c73dc8aab372056620.tar.bz2
Add extra logging to curl poll fn when not suppressing curl debug.
Diffstat (limited to 'content/fetchers')
-rw-r--r--content/fetchers/curl.c38
1 files changed, 38 insertions, 0 deletions
diff --git a/content/fetchers/curl.c b/content/fetchers/curl.c
index 624cdbf41..4f5da3cf6 100644
--- a/content/fetchers/curl.c
+++ b/content/fetchers/curl.c
@@ -1006,6 +1006,44 @@ static void fetch_curl_poll(lwc_string *scheme_ignored)
CURLMcode codem;
CURLMsg *curl_msg;
+ if (nsoption_bool(suppress_curl_debug) == false) {
+ fd_set read_fd_set, write_fd_set, exc_fd_set;
+ int max_fd = -1;
+ int i;
+
+ FD_ZERO(&read_fd_set);
+ FD_ZERO(&write_fd_set);
+ FD_ZERO(&exc_fd_set);
+
+ codem = curl_multi_fdset(fetch_curl_multi,
+ &read_fd_set, &write_fd_set,
+ &exc_fd_set, &max_fd);
+ assert(codem == CURLM_OK);
+
+ LOG("Curl file descriptor states (maxfd=%i):", max_fd);
+ for (i = 0; i <= max_fd; i++) {
+ bool read = false;
+ bool write = false;
+ bool error = false;
+
+ if (FD_ISSET(i, &read_fd_set)) {
+ read = true;
+ }
+ if (FD_ISSET(i, &write_fd_set)) {
+ write = true;
+ }
+ if (FD_ISSET(i, &exc_fd_set)) {
+ error = true;
+ }
+ if (read || write || error) {
+ LOG(" fd %*i: %s %s %s", max_fd / 10 + 1, i,
+ read ? "read" : " ",
+ write ? "write" : " ",
+ error ? "error" : " ");
+ }
+ }
+ }
+
/* do any possible work on the current fetches */
do {
codem = curl_multi_perform(fetch_curl_multi, &running);