summaryrefslogtreecommitdiffstats
path: root/pacredir.c
diff options
context:
space:
mode:
authorGravatar Christian Hesse <mail@eworm.de>2016-10-10 10:28:25 +0200
committerGravatar Christian Hesse <mail@eworm.de>2016-10-10 10:28:25 +0200
commit223b1992650c5a871db1f87d4bda53af8748f9d0 (patch)
tree0cf034cf0e92582959c9451e92587004afd9a58d /pacredir.c
parent131b8043bc57e1f98b4eb030e652202df9043c44 (diff)
downloadpacredir-223b1992650c5a871db1f87d4bda53af8748f9d0.tar.gz
pacredir-223b1992650c5a871db1f87d4bda53af8748f9d0.tar.zst
show the more generic information if errbuf is empty
Diffstat (limited to 'pacredir.c')
-rw-r--r--pacredir.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/pacredir.c b/pacredir.c
index 169c49f..9450a83 100644
--- a/pacredir.c
+++ b/pacredir.c
@@ -245,9 +245,10 @@ static void * get_http_code(void * data) {
*errbuf = '\0';
/* perform the request */
- if (curl_easy_perform(curl) != CURLE_OK) {
+ if ((res = curl_easy_perform(curl)) != CURLE_OK) {
write_log(stderr, "Could not connect to server %s on port %d: %s\n",
- request->host, request->service->port, errbuf);
+ request->host, request->service->port,
+ *errbuf != 0 ? errbuf : curl_easy_strerror(res));
request->http_code = 0;
request->last_modified = 0;
request->service->badtime = tv.tv_sec;