aboutsummaryrefslogtreecommitdiffstats
path: root/channels
diff options
context:
space:
mode:
authorbbryant <bbryant@f38db490-d61c-443f-a65b-d21fe96a405b>2008-05-27 19:45:41 +0000
committerbbryant <bbryant@f38db490-d61c-443f-a65b-d21fe96a405b>2008-05-27 19:45:41 +0000
commitb9489f3898cbbd646564eccf9953e0d53f02c2d8 (patch)
tree66c62ce229922a74f4a63cae6478dc6881f707e4 /channels
parentddb2d20802fce11364f12b11e42341e367f4972a (diff)
Remove loop from the detection of a sequence number that acknowledges
the receiving of a packet that we've kept in memory just incase the packet needs to be retransmitted. git-svn-id: http://svn.digium.com/svn/asterisk/trunk@118562 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels')
-rw-r--r--channels/chan_iax2.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/channels/chan_iax2.c b/channels/chan_iax2.c
index 5d4a4e084..fcd188214 100644
--- a/channels/chan_iax2.c
+++ b/channels/chan_iax2.c
@@ -8156,12 +8156,11 @@ static int socket_process(struct iax2_thread *thread)
(f.frametype != AST_FRAME_IAX))) {
unsigned char x;
int call_to_destroy;
- /* XXX This code is not very efficient. Surely there is a better way which still
- properly handles boundary conditions? XXX */
/* First we have to qualify that the ACKed value is within our window */
- for (x=iaxs[fr->callno]->rseqno; x != iaxs[fr->callno]->oseqno; x++)
- if (fr->iseqno == x)
- break;
+ if (iaxs[fr->callno]->rseqno >= iaxs[fr->callno]->oseqno || (fr->iseqno >= iaxs[fr->callno]->rseqno && fr->iseqno < iaxs[fr->callno]->oseqno))
+ x = fr->iseqno;
+ else
+ x = iaxs[fr->callno]->oseqno;
if ((x != iaxs[fr->callno]->oseqno) || (iaxs[fr->callno]->oseqno == fr->iseqno)) {
/* The acknowledgement is within our window. Time to acknowledge everything
that it says to */