cURL: put error description into the status message.
authorWilfried Goesgens <dothebart@citadel.org>
Sat, 15 Jun 2013 13:00:14 +0000 (15:00 +0200)
committerWilfried Goesgens <dothebart@citadel.org>
Sat, 15 Jun 2013 13:00:14 +0000 (15:00 +0200)
citadel/event_client.h
citadel/modules/eventclient/serv_eventclient.c
citadel/modules/rssclient/serv_rssclient.c

index b136c2e..99d4259 100644 (file)
@@ -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;
 
index d0951ee..79b0eeb 100644 (file)
@@ -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;
index fffe6d8..f9e2a31 100644 (file)
@@ -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",