changeset 2934:f1a9098091c7

handle BADSESSION
author Tomasz Mon <desowin@gmail.com>
date Sat, 30 Aug 2008 18:36:12 +0200
parents 581bec6e2d33
children 6f0eccec978e
files src/scrobbler/scrobbler.c
diffstat 1 files changed, 9 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/scrobbler/scrobbler.c	Fri Aug 29 02:14:51 2008 +0300
+++ b/src/scrobbler/scrobbler.c	Sat Aug 30 18:36:12 2008 +0200
@@ -604,6 +604,15 @@
         return -1;
     }
 
+    if(!strncmp(sc_srv_res, "BADSESSION", 10)) {
+        pdebug("Invalid session, re-handshaking", DEBUG);
+
+        sc_free_res();
+        sc_handshake();
+
+        return -1;
+    }
+
     if (!strncmp(sc_srv_res, "FAILED", 6))  {
         if ((ch = strstr(sc_srv_res, "INTERVAL"))) {
             sc_submit_interval = strtol(ch + 8, NULL, 10);