From 223b1992650c5a871db1f87d4bda53af8748f9d0 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Mon, 10 Oct 2016 10:28:25 +0200 Subject: show the more generic information if errbuf is empty --- pacredir.c | 5 +++-- 1 file 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; -- cgit v1.2.3-54-g00ecf