From 1e0a7c95da5e240c655745d87dc835b5a6a678a3 Mon Sep 17 00:00:00 2001
From: Lorenz Stechauner <lorenz.stechauner@necronda.net>
Date: Mon, 23 Jan 2023 23:33:01 +0100
Subject: [PATCH] Unset prefix at other position in async

---
 src/async.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/async.c b/src/async.c
index c29aef6..0880996 100644
--- a/src/async.c
+++ b/src/async.c
@@ -124,7 +124,6 @@ static int async_exec(evt_listen_t *evt, async_evt_t r_events) {
         ret = -1;
     }
 
-    logger_set_prefix("");
     errno = e;
     return ret;
 }
@@ -254,7 +253,7 @@ void async_thread(void) {
 
         // TODO timeout calculation = O(n)
         // calculate wait timeout
-        min_ts = -1000, cur_ts = clock_micros();;
+        min_ts = -1000, cur_ts = clock_micros();
         for (int i = 0; i < list_size(local); i++) {
             evt_listen_t *evt = local[i];
             if (!evt->socket) continue;
@@ -280,6 +279,7 @@ void async_thread(void) {
             if (!list_contains(local, &evt)) continue;
 
             if (async_exec(evt, async_e2a(events[i].events)) == 0) {
+                logger_set_prefix("");
                 if (epoll_ctl(epoll_fd, EPOLL_CTL_DEL, evt->fd, NULL) == -1) {
                     if (errno == EBADF) {
                         // already closed fd, do not die
@@ -298,6 +298,7 @@ void async_thread(void) {
 
                 free(evt);
             }
+            logger_set_prefix("");
         }
 
         // check, if some socket ran into a timeout