From 7e67205466e40c1d7916703b38c17f1ea1f72573 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20=C3=96man?= Date: Mon, 3 Aug 2009 19:57:36 +0000 Subject: [PATCH] Retry join of dummy subscriptions if they fail --- src/subscriptions.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/src/subscriptions.c b/src/subscriptions.c index b5df0294..2d45b6b1 100644 --- a/src/subscriptions.c +++ b/src/subscriptions.c @@ -285,6 +285,17 @@ dummy_callback(void *opauqe, streaming_message_t *sm) streaming_msg_free(sm); } +static gtimer_t dummy_sub_timer; + +/** + * + */ +static void +dummy_retry(void *opaque) +{ + subscription_dummy_join(opaque); + free(opaque); +} /** * @@ -297,7 +308,9 @@ subscription_dummy_join(const char *id) if(t == NULL) { tvhlog(LOG_ERR, "subscription", - "Unable to dummy join %s, transport not found", id); + "Unable to dummy join %s, transport not found, retrying...", id); + + gtimer_arm(&dummy_sub_timer, dummy_retry, strdup(id), 1); return; } @@ -305,4 +318,6 @@ subscription_dummy_join(const char *id) streaming_target_init(st, dummy_callback, NULL); subscription_create_from_transport(t, "dummy", st); + tvhlog(LOG_NOTICE, "subscription", + "Dummy join %s ok", id); }