]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
plugins: fts-solr: Move solr_lookup_xml_end() from solr-connection.c to solr-response.c.
authorStephan Bosch <stephan.bosch@open-xchange.com>
Tue, 8 Oct 2019 16:56:57 +0000 (18:56 +0200)
committeraki.tuomi <aki.tuomi@open-xchange.com>
Thu, 9 Jan 2020 12:52:43 +0000 (12:52 +0000)
src/plugins/fts-solr/solr-connection.c
src/plugins/fts-solr/solr-response.c

index f6d0639f16bd7f938661341b9398bb9856d2e1aa..375d034ce56194363491fa219f8365bc95b9d471 100644 (file)
@@ -126,39 +126,6 @@ void solr_connection_deinit(struct solr_connection **_conn)
        i_free(conn);
 }
 
-static void solr_lookup_xml_end(void *context, const char *name ATTR_UNUSED)
-{
-       struct solr_lookup_xml_context *ctx = context;
-       int ret;
-
-       if (ctx->content_state == SOLR_XML_CONTENT_STATE_ERROR)
-               return;
-
-       i_assert(ctx->depth >= (int)ctx->state);
-
-       if (ctx->state == SOLR_XML_RESPONSE_STATE_CONTENT &&
-           ctx->content_state == SOLR_XML_CONTENT_STATE_MAILBOX &&
-           ctx->mailbox == NULL) {
-               /* mailbox is namespace prefix */
-               ctx->mailbox = i_strdup("");
-       }
-
-       if (ctx->depth == (int)ctx->state) {
-               ret = 0;
-               if (ctx->state == SOLR_XML_RESPONSE_STATE_DOC) {
-                       T_BEGIN {
-                               ret = solr_lookup_add_doc(ctx);
-                       } T_END;
-               }
-               ctx->state--;
-               if (ret < 0)
-                       ctx->content_state = SOLR_XML_CONTENT_STATE_ERROR;
-               else
-                       ctx->content_state = SOLR_XML_CONTENT_STATE_NONE;
-       }
-       ctx->depth--;
-}
-
 static int uint32_parse(const char *str, int len, uint32_t *value_r)
 {
        uint32_t value = 0;
index baec9f39637a2e3e949c49353353c017543488bf..2a5c4847f93d305e701e1787d2551568faf01b54 100644 (file)
@@ -185,3 +185,36 @@ static int solr_lookup_add_doc(struct solr_lookup_xml_context *ctx)
        }
        return 0;
 }
+
+static void solr_lookup_xml_end(void *context, const char *name ATTR_UNUSED)
+{
+       struct solr_lookup_xml_context *ctx = context;
+       int ret;
+
+       if (ctx->content_state == SOLR_XML_CONTENT_STATE_ERROR)
+               return;
+
+       i_assert(ctx->depth >= (int)ctx->state);
+
+       if (ctx->state == SOLR_XML_RESPONSE_STATE_CONTENT &&
+           ctx->content_state == SOLR_XML_CONTENT_STATE_MAILBOX &&
+           ctx->mailbox == NULL) {
+               /* mailbox is namespace prefix */
+               ctx->mailbox = i_strdup("");
+       }
+
+       if (ctx->depth == (int)ctx->state) {
+               ret = 0;
+               if (ctx->state == SOLR_XML_RESPONSE_STATE_DOC) {
+                       T_BEGIN {
+                               ret = solr_lookup_add_doc(ctx);
+                       } T_END;
+               }
+               ctx->state--;
+               if (ret < 0)
+                       ctx->content_state = SOLR_XML_CONTENT_STATE_ERROR;
+               else
+                       ctx->content_state = SOLR_XML_CONTENT_STATE_NONE;
+       }
+       ctx->depth--;
+}