From 5a93ba97b8d1f2b7da8392977ea2e452870e4ad4 Mon Sep 17 00:00:00 2001 From: Wilfried Goesgens Date: Sat, 15 Jun 2013 15:00:14 +0200 Subject: [PATCH] cURL: put error description into the status message. --- citadel/event_client.h | 1 + citadel/modules/eventclient/serv_eventclient.c | 3 ++- citadel/modules/rssclient/serv_rssclient.c | 11 ++++++++++- 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/citadel/event_client.h b/citadel/event_client.h index b136c2e67..99d4259f6 100644 --- a/citadel/event_client.h +++ b/citadel/event_client.h @@ -124,6 +124,7 @@ typedef struct _evcurl_request_data CURL *chnd; struct curl_slist *headers; char errdesc[CURL_ERROR_SIZE]; + const char *CurlError; int attached; diff --git a/citadel/modules/eventclient/serv_eventclient.c b/citadel/modules/eventclient/serv_eventclient.c index d0951eea8..79b0eeb30 100644 --- a/citadel/modules/eventclient/serv_eventclient.c +++ b/citadel/modules/eventclient/serv_eventclient.c @@ -161,9 +161,10 @@ gotstatus(int nnrun) EVCURL_syslog(LOG_ERR, "error description: %s\n", IO->HttpReq.errdesc); + IO->HttpReq.CurlError = curl_easy_strerror(sta); EVCURL_syslog(LOG_ERR, "error performing request: %s\n", - curl_easy_strerror(sta)); + IO->HttpReq.CurlError); if (sta == CURLE_OPERATION_TIMEDOUT) { IO->SendBuf.fd = 0; diff --git a/citadel/modules/rssclient/serv_rssclient.c b/citadel/modules/rssclient/serv_rssclient.c index fffe6d8e1..f9e2a312a 100644 --- a/citadel/modules/rssclient/serv_rssclient.c +++ b/citadel/modules/rssclient/serv_rssclient.c @@ -515,14 +515,23 @@ eNextState RSSAggregator_AnalyseReply(AsyncIO *IO) strs[1] = ChrPtr(Ctx->rooms); lens[1] = StrLength(Ctx->rooms); + + if (IO->HttpReq.CurlError == NULL) + IO->HttpReq.CurlError = ""; + StrBufPrintf(ErrMsg, "Error while RSS-Aggregation Run of %s\n" " need a 200, got a %ld !\n" + " Curl Error message: \n%s / %s\n" " Response text was: \n" " \n %s\n", ChrPtr(Ctx->Url), IO->HttpReq.httpcode, - ChrPtr(IO->HttpReq.ReplyData)); + IO->HttpReq.errdesc, + IO->HttpReq.CurlError, + ChrPtr(IO->HttpReq.ReplyData) + ); + CtdlAideFPMessage( ChrPtr(ErrMsg), "RSS Aggregation run failure", -- 2.30.2