# HG changeset patch # User Timo Sirainen # Date 1226768580 -7200 # Node ID 83cad8a5bf155658118644d4d1939bd1db4f9b99 # Parent ce4779b95fc819dcd09d0fb3b0d6eb78aa637ff6 fts-solr: Don't assert-crash if we couldn't connect to Solr. diff -r ce4779b95fc8 -r 83cad8a5bf15 src/plugins/fts-solr/solr-connection.c --- a/src/plugins/fts-solr/solr-connection.c Sat Nov 15 18:48:52 2008 +0200 +++ b/src/plugins/fts-solr/solr-connection.c Sat Nov 15 19:03:00 2008 +0200 @@ -397,8 +397,9 @@ 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 @@ /* 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. */