summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 3ff903b)
raw | patch | inline | side by side (parent: 3ff903b)
author | Martin Mares <mj@ucw.cz> | |
Sat, 18 Feb 2006 20:44:20 +0000 (21:44 +0100) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Sun, 19 Feb 2006 00:19:00 +0000 (16:19 -0800) |
Fixed a couple of bugs in recovering from broken connections:
The _line() method now returns undef correctly when the connection
is broken instead of falling off the function and returning garbage.
Retries are now reported to stderr and the eventual partially
downloaded file is discarded instead of being appended to.
The "Server gone away" test has been removed, because it was
reachable only if the garbage return bug bit.
Signed-off-by: Martin Mares <mj@ucw.cz>
Signed-off-by: Junio C Hamano <junkio@cox.net>
The _line() method now returns undef correctly when the connection
is broken instead of falling off the function and returning garbage.
Retries are now reported to stderr and the eventual partially
downloaded file is discarded instead of being appended to.
The "Server gone away" test has been removed, because it was
reachable only if the garbage return bug bit.
Signed-off-by: Martin Mares <mj@ucw.cz>
Signed-off-by: Junio C Hamano <junkio@cox.net>
git-cvsimport.perl | patch | blob | history |
diff --git a/git-cvsimport.perl b/git-cvsimport.perl
index 00fc3bacda948a4ea2d33079d85a8254080806e8..24f983434249e0c37b7f2229e73c70b374403dc4 100755 (executable)
--- a/git-cvsimport.perl
+++ b/git-cvsimport.perl
}
}
}
+ return undef;
}
sub file {
my($self,$fn,$rev) = @_;
$self->_file($fn,$rev) and $res = $self->_line($fh);
if (!defined $res) {
- # retry
+ print STDERR "Server has gone away while fetching $fn $rev, retrying...\n";
+ truncate $fh, 0;
$self->conn();
- $self->_file($fn,$rev)
- or die "No file command send\n";
+ $self->_file($fn,$rev) or die "No file command send";
$res = $self->_line($fh);
- die "No input: $fn $rev\n" unless defined $res;
+ die "Retry failed" unless defined $res;
}
close ($fh);
- if ($res eq '') {
- die "Looks like the server has gone away while fetching $fn $rev -- exiting!";
- }
-
return ($name, $res);
}