From: erickson Date: Fri, 24 Jul 2009 21:00:01 +0000 (+0000) Subject: reset the alarm with each socket read so that we only time out after a period of... X-Git-Tag: sprint4-merge-nov22~9612 X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=00bf1bebe3d7ad2bc0bf6e066a44b60b7df9b541;p=working%2FEvergreen.git reset the alarm with each socket read so that we only time out after a period of inactivity git-svn-id: svn://svn.open-ils.org/ILS/trunk@13740 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- diff --git a/Open-ILS/src/support-scripts/marc_stream_importer.pl b/Open-ILS/src/support-scripts/marc_stream_importer.pl index c15efcc312..ceb6cd5740 100644 --- a/Open-ILS/src/support-scripts/marc_stream_importer.pl +++ b/Open-ILS/src/support-scripts/marc_stream_importer.pl @@ -82,10 +82,11 @@ sub process_request { # and pull the data directly from the socket eval { local $SIG{ALRM} = sub { die "alarm\n" }; - alarm $wait_time; - while(my $n = $socket->sysread($buf, $bufsize)) { + do { + alarm $wait_time; + last unless $socket->sysread($buf, $bufsize); $data .= $buf; - } + } while(1); alarm 0; };