Skip to content

Commit 103c0a1

Browse files
author
cap60552
committed
Fixed potential endless loop condition if a connection was lost in the middle of a transaction.
git-svn-id: http://php-sip2.googlecode.com/svn/trunk@27 ce44ba49-5d48-0410-be41-89220e6c249e
1 parent a564aa2 commit 103c0a1

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

sip2.class.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@
1717
*/
1818

1919
/**
20+
* 2010.10.08
21+
* Fixed a potential endless loop condition if a socket lost connection in the middle of a transaction.
22+
*
2023
* 2008.04.11
2124
* Encorported a bug fix submitted by Bob Wicksall
2225
*
@@ -670,7 +673,7 @@ function get_message ($message)
670673

671674
$this->_debugmsg('SIP2: Request Sent, Reading response');
672675

673-
while ($terminator != "\x0D") {
676+
while ($terminator != "\x0D" && $nr !== FALSE) {
674677
$nr = socket_recv($this->socket,$terminator,1,0);
675678
$result = $result . $terminator;
676679
}

0 commit comments

Comments
 (0)