mirror of
https://github.com/asterisk/asterisk.git
synced 2025-11-13 21:39:05 +00:00
Merge "chan_ooh323: Fix infinite loop on read second part of H.225 packet"
This commit is contained in:
@@ -1061,11 +1061,6 @@ int ooH2250Receive(OOH323CallData *call)
|
|||||||
while(total < len)
|
while(total < len)
|
||||||
{
|
{
|
||||||
struct pollfd pfds;
|
struct pollfd pfds;
|
||||||
recvLen = ooSocketRecv (call->pH225Channel->sock, message1, len-total);
|
|
||||||
memcpy(message+total, message1, recvLen);
|
|
||||||
total = total + recvLen;
|
|
||||||
|
|
||||||
if(total == len) break; /* Complete message is received */
|
|
||||||
|
|
||||||
pfds.fd = call->pH225Channel->sock;
|
pfds.fd = call->pH225Channel->sock;
|
||||||
pfds.events = POLLIN;
|
pfds.events = POLLIN;
|
||||||
@@ -1085,8 +1080,9 @@ int ooH2250Receive(OOH323CallData *call)
|
|||||||
}
|
}
|
||||||
return OO_FAILED;
|
return OO_FAILED;
|
||||||
}
|
}
|
||||||
/* If remaining part of the message is not received in 3 seconds
|
|
||||||
exit */
|
/* exit If remaining part of the message is not received in 3 seconds */
|
||||||
|
|
||||||
if(!ooPDRead(&pfds, 1, call->pH225Channel->sock))
|
if(!ooPDRead(&pfds, 1, call->pH225Channel->sock))
|
||||||
{
|
{
|
||||||
OOTRACEERR3("Error: Incomplete H.2250 message received - clearing "
|
OOTRACEERR3("Error: Incomplete H.2250 message received - clearing "
|
||||||
@@ -1099,6 +1095,23 @@ int ooH2250Receive(OOH323CallData *call)
|
|||||||
}
|
}
|
||||||
return OO_FAILED;
|
return OO_FAILED;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
recvLen = ooSocketRecv (call->pH225Channel->sock, message1, len-total);
|
||||||
|
if (recvLen == 0) {
|
||||||
|
OOTRACEERR3("Error in read while receiving H.2250 message - "
|
||||||
|
"clearing call (%s, %s)\n", call->callType,
|
||||||
|
call->callToken);
|
||||||
|
ooFreeQ931Message(pctxt, pmsg);
|
||||||
|
if(call->callState < OO_CALL_CLEAR)
|
||||||
|
{
|
||||||
|
call->callEndReason = OO_REASON_TRANSPORTFAILURE;
|
||||||
|
call->callState = OO_CALL_CLEAR;
|
||||||
|
}
|
||||||
|
return OO_FAILED;
|
||||||
|
}
|
||||||
|
memcpy(message+total, message1, recvLen);
|
||||||
|
total = total + recvLen;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
OOTRACEDBGC3("Received Q.931 message: (%s, %s)\n",
|
OOTRACEDBGC3("Received Q.931 message: (%s, %s)\n",
|
||||||
|
|||||||
Reference in New Issue
Block a user