diff options
author | Christian Hesse <mail@eworm.de> | 2016-10-10 10:28:25 +0200 |
---|---|---|
committer | Christian Hesse <mail@eworm.de> | 2016-10-10 10:28:25 +0200 |
commit | 223b1992650c5a871db1f87d4bda53af8748f9d0 (patch) | |
tree | 0cf034cf0e92582959c9451e92587004afd9a58d /pacredir.c | |
parent | 131b8043bc57e1f98b4eb030e652202df9043c44 (diff) | |
download | pacredir-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.c | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -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; |