Permalink
Browse files

Very large select() timeouts can trigger EINVAL on Mac OSX.

Sérgio Bernardino reported that POE::Component::Server::IRC's synopsis
would go into a busy loop when a client tried to connect.  It turns
out that POE::Loop::Select would fail when the component set a timeout
for a very long time in the future.  Cap select() timeouts to an hour
to avoid the problem.
  • Loading branch information...
1 parent 476c7e5 commit 6f719e9175695d8a456c37bf907a08d32f730d06 @rcaputo committed Mar 23, 2012
Showing with 3 additions and 0 deletions.
  1. +3 −0 lib/POE/Loop/Select.pm
View
@@ -160,6 +160,9 @@ sub loop_do_timeslice {
if (defined $timeout) {
$timeout -= $now;
$timeout = 0 if $timeout < 0;
+
+ # Very large timeouts can trigger EINVAL on Mac OSX.
+ $timeout = 3600 if $timeout > 3600;
}
else {
die "shouldn't happen" if ASSERT_DATA;

0 comments on commit 6f719e9

Please sign in to comment.