From 1f6a2d4b1cc7c1a9aef1cfe817f721309f77d8d8 Mon Sep 17 00:00:00 2001 From: Antoine Cellerier Date: Thu, 31 May 2007 21:18:59 +0000 Subject: [PATCH] "[PATCH] audioscrobbler plugin connection check" by Ilkka Ollakka --- modules/misc/audioscrobbler.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/modules/misc/audioscrobbler.c b/modules/misc/audioscrobbler.c index fa5ee98f90..d55d936e83 100644 --- a/modules/misc/audioscrobbler.c +++ b/modules/misc/audioscrobbler.c @@ -394,6 +394,16 @@ static void Run( intf_thread_t *p_this ) i_post_socket = net_ConnectTCP( p_this, p_sys->psz_submit_host, p_sys->i_submit_port); + if ( i_post_socket == -1 ) + { + /* If connection fails, we assume we must handshake again */ + time( &p_sys->time_next_exchange ); + p_sys->time_next_exchange += DEFAULT_INTERVAL; + p_sys->b_handshaked = VLC_FALSE; + vlc_mutex_unlock( &p_sys->lock ); + continue; + } + /* we transmit the data */ i_net_ret = net_Printf( VLC_OBJECT(p_this), i_post_socket, NULL, -- 2.39.2