commit 8e629200ae1e2187eddda70093f75ea5e42426a7
parent 0e3fb410988e339bdf5e3d21383bca11caec548c
Author: Jacki <jacki@thejackimonster.de>
Date: Sun, 21 Jul 2024 04:32:01 +0200
Remove idle task from chat handle in application
Diffstat:
3 files changed, 0 insertions(+), 30 deletions(-)
diff --git a/src/application.c b/src/application.c
@@ -774,9 +774,6 @@ _application_stop_chat(gpointer user_data)
{
MESSENGER_Application *app = user_data;
- if (app->chat.messenger.idle)
- GNUNET_SCHEDULER_cancel(app->chat.messenger.idle);
-
GNUNET_CHAT_disconnect(app->chat.messenger.handle);
GNUNET_CHAT_stop(app->chat.messenger.handle);
app->chat.messenger.handle = NULL;
diff --git a/src/chat/messenger.c b/src/chat/messenger.c
@@ -27,23 +27,6 @@
#include "../event.h"
#include <gnunet/gnunet_chat_lib.h>
-static void
-_chat_messenger_idle(void *cls)
-{
- g_assert(cls);
-
- MESSENGER_Application *app = (MESSENGER_Application*) cls;
-
- // Idling until the application shuts down
- // (required to get events immediately).
- app->chat.messenger.idle = GNUNET_SCHEDULER_add_delayed_with_priority(
- GNUNET_TIME_relative_get_second_(),
- GNUNET_SCHEDULER_PRIORITY_IDLE,
- &_chat_messenger_idle,
- app
- );
-}
-
static int
_chat_messenger_message(void *cls,
struct GNUNET_CHAT_Context *context,
@@ -227,17 +210,9 @@ chat_messenger_run(void *cls,
schedule_load_gnunet(&(app->chat.schedule));
- // Start libgnunetchat handle
app->chat.messenger.handle = GNUNET_CHAT_start(
cfg,
&_chat_messenger_message,
app
);
-
- // The idle callback seems to be necessary to not wait too long for
- // other events
- app->chat.messenger.idle = GNUNET_SCHEDULER_add_now(
- &_chat_messenger_idle,
- app
- );
}
diff --git a/src/chat/messenger.h b/src/chat/messenger.h
@@ -32,8 +32,6 @@ typedef struct MESSENGER_Application MESSENGER_Application;
typedef struct CHAT_MESSENGER_Handle
{
struct GNUNET_CHAT_Handle *handle;
- struct GNUNET_SCHEDULER_Task *quit;
- struct GNUNET_SCHEDULER_Task *idle;
} CHAT_MESSENGER_Handle;
/**