]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
fts: Code cleanup
authorTimo Sirainen <timo.sirainen@dovecot.fi>
Thu, 14 Dec 2017 19:49:08 +0000 (21:49 +0200)
committerAki Tuomi <aki.tuomi@open-xchange.com>
Fri, 15 Dec 2017 10:34:58 +0000 (12:34 +0200)
src/plugins/fts/fts-build-mail.c

index 1cbaefe68bde24a3d8215eb13756d50513c20830..d98a3d6162c523a44d45b5c27ceb23febad4373f 100644 (file)
@@ -615,12 +615,16 @@ int fts_build_mail(struct fts_backend_update_context *update_ctx,
        bool may_need_retry;
 
        T_BEGIN {
-               for (;;) {
-                       ret = fts_build_mail_real(update_ctx, mail,
-                                                 &retriable_err_msg, &may_need_retry);
-                       if (!may_need_retry || (--attempts == 0)) {
-                               if (may_need_retry)
-                                       i_info("%s - ignoring", retriable_err_msg);
+               while ((ret = fts_build_mail_real(update_ctx, mail,
+                                                 &retriable_err_msg,
+                                                 &may_need_retry)) < 0 &&
+                      may_need_retry) {
+                       if (--attempts == 0) {
+                               /* Log this as info instead of as error,
+                                  because e.g. Tika doesn't differentiate
+                                  between temporary errors and invalid
+                                  document input. */
+                               i_info("%s - ignoring", retriable_err_msg);
                                break;
                        }
                }