From: Sergey Kitov Date: Tue, 12 Dec 2017 14:06:14 +0000 (+0200) Subject: plugins/fts: Retry all 5xx tika http statuses, not only 500 X-Git-Tag: 2.3.0.rc1~127 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=71b43772aac29df97a0aebc819afa67ce6098973;p=thirdparty%2Fdovecot%2Fcore.git plugins/fts: Retry all 5xx tika http statuses, not only 500 --- diff --git a/src/plugins/fts/fts-parser-tika.c b/src/plugins/fts/fts-parser-tika.c index 1e75121f82..19ea80fa82 100644 --- a/src/plugins/fts/fts-parser-tika.c +++ b/src/plugins/fts/fts-parser-tika.c @@ -109,21 +109,21 @@ fts_tika_parser_response(const struct http_response *response, } parser->payload = i_stream_create_from_data("", 0); break; - case 500: - parser->parser.may_need_retry = TRUE; - i_free(parser->parser.retriable_error_msg); - parser->parser.retriable_error_msg = - i_strdup_printf("fts_tika: PUT %s failed: %s", - mail_user_plugin_getenv(parser->user, "fts_tika"), - http_response_get_message(response)); - parser->payload = i_stream_create_from_data("", 0); - break; - default: - i_error("fts_tika: PUT %s failed: %s", - mail_user_plugin_getenv(parser->user, "fts_tika"), - http_response_get_message(response)); - parser->failed = TRUE; + if (response->status / 100 == 5) { + parser->parser.may_need_retry = TRUE; + i_free(parser->parser.retriable_error_msg); + parser->parser.retriable_error_msg = + i_strdup_printf("fts_tika: PUT %s failed: %s", + mail_user_plugin_getenv(parser->user, "fts_tika"), + http_response_get_message(response)); + parser->payload = i_stream_create_from_data("", 0); + } else { + i_error("fts_tika: PUT %s failed: %s", + mail_user_plugin_getenv(parser->user, "fts_tika"), + http_response_get_message(response)); + parser->failed = TRUE; + } break; } parser->http_req = NULL;