Welcome to little lamb

Code » anopa » commit 705ac0e

Fix per-service timeout value not being used

author Olivier Brunel
2018-02-22 18:01:05 UTC
committer Olivier Brunel
2018-02-22 18:02:25 UTC
parent 2857e6e42e32f614a0eae92da9a278f58e1e4a13

Fix per-service timeout value not being used

We did read the value from SERVICEDIR/timeout, but then didn't do
anything with it! So per-service timeouts weren't actually working.

src/libanopa/service.c +3 -2

diff --git a/src/libanopa/service.c b/src/libanopa/service.c
index dd46578..df5d30f 100644
--- a/src/libanopa/service.c
+++ b/src/libanopa/service.c
@@ -407,9 +407,10 @@ aa_ensure_service_loaded (int si, aa_mode mode, int no_wants, aa_autoload_cb al_
             }
             /* in STOP_ALL the default is also a maximum */
             else if ((mode & AA_MODE_STOP_ALL)
-                    && (aa_service (si)->secs_timeout > aa_secs_timeout
-                        || aa_service (si)->secs_timeout == 0))
+                    && (i > aa_secs_timeout || i == 0))
                 aa_service (si)->secs_timeout = aa_secs_timeout;
+            else
+                aa_service (si)->secs_timeout = i;
         }
         else
             aa_service (si)->secs_timeout = aa_secs_timeout;