aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorroot <root@f38db490-d61c-443f-a65b-d21fe96a405b>2006-05-23 19:05:12 +0000
committerroot <root@f38db490-d61c-443f-a65b-d21fe96a405b>2006-05-23 19:05:12 +0000
commit185e38a3d280c73dff927d98d9707852ff22f668 (patch)
tree4b955ac219775b0c33a57d5930dd1360b6e56f93
parente005dbccdff80ceb02ce7cc8576852c80e520e56 (diff)
automerge commit
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.2-netsec@29798 f38db490-d61c-443f-a65b-d21fe96a405b
-rw-r--r--channels/chan_sip.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index 9a3f9983a..12e4ad24d 100644
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -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");