]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
automerge commit
authorAutomerge script <automerge@asterisk.org>
Tue, 23 May 2006 19:05:12 +0000 (19:05 +0000)
committerAutomerge script <automerge@asterisk.org>
Tue, 23 May 2006 19:05:12 +0000 (19:05 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.2-netsec@29798 65c4cc65-6c06-0410-ace0-fbb531ad65f3

channels/chan_sip.c

index 9a3f9983ac24acf7d517181aa4ac6cb7d8605996..12e4ad24d922c229604f92e39bfa3d5db3474f12 100644 (file)
@@ -11309,7 +11309,7 @@ static int sipsock_read(int *id, int fd, short events, void *ignore)
        int nounlock;
        int recount = 0;
        char iabuf[INET_ADDRSTRLEN];
-       int lockretrycount = 0;
+       unsigned int lockretry = 100;
 
        len = sizeof(sin);
        memset(&req, 0, sizeof(req));
@@ -11362,13 +11362,12 @@ retrylock:
                        ast_log(LOG_DEBUG, "Failed to grab lock, trying again...\n");
                        ast_mutex_unlock(&p->lock);
                        ast_mutex_unlock(&netlock);
-                       /* Sleep infintismly short amount of time */
+                       /* Sleep for a very short amount of time */
                        usleep(1);
-                       lockretrycount++;
-                       if (lockretrycount < 100)
+                       if (--lockretry)
                                goto retrylock;
                }
-               if (lockretrycount > 100) {
+               if (!lockretry) {
                        ast_log(LOG_ERROR, "We could NOT get the channel lock for %s! \n", p->owner->name);
                        ast_log(LOG_ERROR, "SIP MESSAGE JUST IGNORED: %s \n", req.data);
                        ast_log(LOG_ERROR, "BAD! BAD! BAD!\n");