[poe-commits] SF.net SVN: poe: [2196] trunk/poe/lib/POE/Component/Server/TCP.pm
Brought to you by:
rcaputo
From: <rc...@us...> - 2007-07-21 07:04:58
|
Revision: 2196 http://svn.sourceforge.net/poe/?rev=2196&view=rev Author: rcaputo Date: 2007-07-21 00:04:55 -0700 (Sat, 21 Jul 2007) Log Message: ----------- Resolve rt.cpan.org ticket 27833. Philip Gwyn found a case where the connection count for a server could go negative. Not-shutting-down hilarity ensues in this case. I've just applied his patch. Modified Paths: -------------- trunk/poe/lib/POE/Component/Server/TCP.pm Modified: trunk/poe/lib/POE/Component/Server/TCP.pm =================================================================== --- trunk/poe/lib/POE/Component/Server/TCP.pm 2007-07-21 06:52:55 UTC (rev 2195) +++ trunk/poe/lib/POE/Component/Server/TCP.pm 2007-07-21 07:04:55 UTC (rev 2196) @@ -372,6 +372,13 @@ "$$: $_[HEAP]->{alias} Connection closed ", "($_[HEAP]->{connections} open)" ); + if ($_[HEAP]->{connections} < 0) { + warn( + "Excessive 'disconnected' event ", + "from $_[CALLER_FILE] at line $_[CALLER_LINE]\n" + ); + $_[HEAP]->{connections} = 0; + } if( $_[HEAP]->{concurrency} != -1 and $_[HEAP]->{listener} ) { if( $_[HEAP]->{connections} == ($_[HEAP]->{concurrency}-1) ) { DEBUG and warn( This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |