Git/Packet: clarify that packet_required_key_val_read allows EOF
The function calls itself "required", but it does not die when it sees an unexpected EOF. Let's rename it to "packet_key_val_read()". Signed-off-by: Christian Couder <chriscool@tuxfamily.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:

committed by
Junio C Hamano

parent
0fe8d516bb
commit
cb1c64b4a8
@ -70,7 +70,7 @@ print $debug "init handshake complete\n";
|
||||
$debug->flush();
|
||||
|
||||
while (1) {
|
||||
my ( $res, $command ) = packet_required_key_val_read("command");
|
||||
my ( $res, $command ) = packet_key_val_read("command");
|
||||
if ( $res == -1 ) {
|
||||
print $debug "STOP\n";
|
||||
exit();
|
||||
@ -106,7 +106,7 @@ while (1) {
|
||||
packet_txt_write("status=success");
|
||||
packet_flush();
|
||||
} else {
|
||||
my ( $res, $pathname ) = packet_required_key_val_read("pathname");
|
||||
my ( $res, $pathname ) = packet_key_val_read("pathname");
|
||||
if ( $res == -1 ) {
|
||||
die "unexpected EOF while expecting pathname";
|
||||
}
|
||||
|
Reference in New Issue
Block a user