From: Martin Mares Date: Fri, 29 Jun 2007 20:22:53 +0000 (+0200) Subject: Act sensibly when connection to the server is lost. X-Git-Tag: python-dummy-working~327^2~4 X-Git-Url: http://mj.ucw.cz/gitweb/?a=commitdiff_plain;h=4e1059a0054a8004e9dda39a4f84d6f71e72b9a9;p=moe.git Act sensibly when connection to the server is lost. --- diff --git a/submit/MO/Submit.pm b/submit/MO/Submit.pm index 554fda8..0aa165d 100644 --- a/submit/MO/Submit.pm +++ b/submit/MO/Submit.pm @@ -126,7 +126,7 @@ sub connect($) { sub request($$) { my ($self, $obj) = @_; my $sk = $self->{"sk"}; - ## $SIG{'PIPE'} = 'ignore'; + local $SIG{'PIPE'} = 'ignore'; $obj->write($sk); print $sk "\n"; $sk->flush(); @@ -152,6 +152,7 @@ sub reply($) { sub send_file($$$) { my ($self, $fh, $size) = @_; my $sk = $self->{"sk"}; + local $SIG{'PIPE'} = 'ignore'; while ($size) { my $l = ($size < 4096 ? $size : 4096); my $buf = ""; diff --git a/submit/contest b/submit/contest index 8e7f3f2..7d54456 100755 --- a/submit/contest +++ b/submit/contest @@ -258,6 +258,7 @@ sub refresh() if (!$conn->is_connected && !$force_refresh) { # Retry $conn->log("Retrying"); + $force_refresh = 1; refresh(); } }