]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
plugins: fts: tika: Use a private HTTP client.
authorStephan Bosch <stephan.bosch@dovecot.fi>
Fri, 4 Jan 2019 08:55:20 +0000 (09:55 +0100)
committerTimo Sirainen <timo.sirainen@open-xchange.com>
Fri, 19 Feb 2021 10:14:21 +0000 (12:14 +0200)
This is a workaround for problems with the http_client_request_send_payload()
API that occur when several shared HTTP clients use this API at the same time
and payload sending gets interleaved.

src/plugins/fts/fts-parser-tika.c

index a4b8b5c3034f57e22e77caa759c090da6b62f8ba..6355a2fc303c1c59502dc8b2ab26720cd582a01c 100644 (file)
@@ -77,7 +77,14 @@ tika_get_http_client_url(struct mail_user *user, struct http_url **http_url_r)
                http_set.request_timeout_msecs = 60*1000;
                http_set.ssl = &ssl_set;
                http_set.debug = user->mail_debug;
-               tika_http_client = http_client_init(&http_set);
+
+               /* FIXME: We should initialize a shared client instead. However,
+                         this is currently not possible due to an obscure bug
+                         in the blocking HTTP payload API, which causes
+                         conflicts with other HTTP applications like FTS Solr.
+                         Using a private client will provide a quick fix for
+                         now. */
+               tika_http_client = http_client_init_private(&http_set);
        }
        *http_url_r = tuser->http_url;
        return 0;