From c64a91cdafd1bafd9bc365418c07e64e00430d44 Mon Sep 17 00:00:00 2001
From: Philippe PITTOLI
Date: Tue, 13 Sep 2016 22:13:33 +0200
Subject: [PATCH] pubsubd: code removal
---
pubsub/pubsubd.c | 47 -----------------------------------------------
1 file changed, 47 deletions(-)
diff --git a/pubsub/pubsubd.c b/pubsub/pubsubd.c
index 0ab5a37..8d3e8d9 100644
--- a/pubsub/pubsubd.c
+++ b/pubsub/pubsubd.c
@@ -67,53 +67,6 @@ void * pubsubd_worker_thread (void *params)
}
pubsubd_msg_free (&m);
}
-#if 0
-#endif
-
-#if 0
- while (1) {
- // each chan has a list of subscribers
- // someone who only push a msg doesn't need to be registered
- // if (wp->ale->action == PUBSUB_BOTH || wp->ale->action == PUBSUB_PUB) {
- if (wp->ale->action == PUBSUB_PUB) {
- // publish a message
- printf ("publish to chan %s\n", wp->chan->chan);
-
- struct pubsub_msg m;
- memset (&m, 0, sizeof (struct pubsub_msg));
-
- sleep (5); // TODO DEBUG
- pubsubd_msg_recv (wp->ale->p, &m);
-
- pubsubd_msg_print (&m);
-
- if (m.type == PUBSUB_TYPE_DISCONNECT) {
- // TODO remove the application from the subscribers
- if ( 0 != pubsubd_subscriber_del (wp->chan->alh, wp->ale)) {
- fprintf (stderr, "err : subscriber not registered\n");
- }
- break;
- }
- else {
- struct channel *chan = pubsubd_channel_get (wp->chans, wp->chan);
- pubsubd_msg_send (chan->alh, &m);
- }
- }
- else if (wp->ale->action == PUBSUB_SUB) {
- // subscribe to a channel, no need to loop
- // already subscribed
- // printf ("subscribe to %s\n", wp->chan->chan);
- // pubsubd_subscriber_add (wp->chan->alh, wp->ale);
- break;
- }
- else {
- // unrecognized command, no need to loop
- printf ("\033[31mdo not know what you want to do\033[00m\n");
- printf ("\tale->p : %p\n", (void*) wp->ale->p);
- break;
- }
- }
-#endif
pubsubd_app_list_elm_free (ale);