]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
hmm still need a way to get rid of connections
authorMatt O'Gorman <mogorman@digium.com>
Tue, 23 May 2006 21:18:07 +0000 (21:18 +0000)
committerMatt O'Gorman <mogorman@digium.com>
Tue, 23 May 2006 21:18:07 +0000 (21:18 +0000)
later on.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@29847 65c4cc65-6c06-0410-ace0-fbb531ad65f3

res/res_jabber.c

index ed7b5e74fc903e3c9ddae0735b8502b594085117..cdd14edd2c13ebd26e9e65d2b813117b0dc3401d 100644 (file)
@@ -1334,25 +1334,23 @@ static void *aji_recv_loop(void *data)
                if (res != IKS_OK) {
                        while(res != IKS_OK) {
                                if(option_verbose > 3) ast_verbose("JABBER: reconnecting.\n");
-                               sleep(4);
                                res = aji_reconnect(client);
+                               sleep(4);
                        }
                }
                res = iks_recv(client->p, 1);
                client->timeout--;
                if (res == IKS_HOOK) {
                        ast_log(LOG_WARNING, "JABBER: Got hook event.\n");
-                       break;
                } else if (res == IKS_NET_TLSFAIL) {
                        ast_log(LOG_WARNING, "JABBER:  Failure in tls.\n");
-                       break;
                } else if (client->timeout == 0 && client->state != AJI_CONNECTED) {
                        res = -1;
                        ast_log(LOG_WARNING, "JABBER:  Network Timeout\n");
                } else if (res == IKS_NET_RWERR) {
                        ast_log(LOG_WARNING, "JABBER: socket read error\n");
                }
-       } while (res == IKS_OK);
+       } while (client);
        ASTOBJ_UNREF(client, aji_client_destroy);
        return 0;
 }