From: Timo Sirainen Date: Sat, 15 Nov 2008 17:03:00 +0000 (+0200) Subject: fts-solr: Don't assert-crash if we couldn't connect to Solr. X-Git-Tag: 1.2.alpha4~88 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=8a13d19a514bfc316149eda172558d12526f9e4e;p=thirdparty%2Fdovecot%2Fcore.git fts-solr: Don't assert-crash if we couldn't connect to Solr. --HG-- branch : HEAD --- diff --git a/src/plugins/fts-solr/solr-connection.c b/src/plugins/fts-solr/solr-connection.c index 9bff0e6051..c79aadbb50 100644 --- a/src/plugins/fts-solr/solr-connection.c +++ b/src/plugins/fts-solr/solr-connection.c @@ -397,8 +397,9 @@ void solr_connection_post_more(struct solr_connection_post *post, fd_set fdexcep; struct timeval timeout_tv; long timeout; + CURLMsg *msg; CURLMcode merr; - int ret, handles, maxfd; + int ret, handles, maxfd, n; i_assert(post->conn->posting); @@ -423,6 +424,13 @@ void solr_connection_post_more(struct solr_connection_post *post, /* everything sent successfully */ return; } + msg = curl_multi_info_read(post->conn->curlm, &n); + if (msg != NULL && msg->msg == CURLMSG_DONE && + msg->data.result != CURLE_OK) { + i_error("fts_solr: curl post failed: %s", + curl_easy_strerror(msg->data.result)); + break; + } /* everything wasn't sent - wait. just use select, since libcurl interface is easiest with it. */