]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
fts-solr: Don't assert-crash if we couldn't connect to Solr.
authorTimo Sirainen <tss@iki.fi>
Sat, 15 Nov 2008 17:03:00 +0000 (19:03 +0200)
committerTimo Sirainen <tss@iki.fi>
Sat, 15 Nov 2008 17:03:00 +0000 (19:03 +0200)
--HG--
branch : HEAD

src/plugins/fts-solr/solr-connection.c

index 9bff0e605103599780700df0e4cb5eb489de352b..c79aadbb501e5a6e1e13de97dbafdd8af9cb8e6f 100644 (file)
@@ -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. */