Fix matching of channel and global requests with replies in logparse.pl.

In each case, want_reply was being treated as true even when it wasn't,
because it got decoded into "yes"/"no", both of which are true in
Perl.

[originally from svn r9617]
This commit is contained in:
Ben Harris 2012-08-25 13:54:56 +00:00
Родитель 30e43ba2a3
Коммит 8387897d90
1 изменённых файлов: 3 добавлений и 2 удалений

Просмотреть файл

@ -172,7 +172,7 @@ my %packets = (
my ($type, $wantreply) = &parse("sb", $data); my ($type, $wantreply) = &parse("sb", $data);
printf "%s (%s)", $type, $wantreply eq "yes" ? "reply" : "noreply"; printf "%s (%s)", $type, $wantreply eq "yes" ? "reply" : "noreply";
my $request = [$seq, $type]; my $request = [$seq, $type];
push @{$globalreq{$direction}}, $request if $wantreply; push @{$globalreq{$direction}}, $request if $wantreply eq "yes";
if ($type eq "tcpip-forward" or $type eq "cancel-tcpip-forward") { if ($type eq "tcpip-forward" or $type eq "cancel-tcpip-forward") {
my ($addr, $port) = &parse("su", $data); my ($addr, $port) = &parse("su", $data);
printf " %s:%s", $addr, $port; printf " %s:%s", $addr, $port;
@ -361,7 +361,8 @@ my %packets = (
my $chan = $channels[$index]; my $chan = $channels[$index];
printf "ch%d (%s) %s (%s)", printf "ch%d (%s) %s (%s)",
$index, $chan->{'id'}, $type, $wantreply eq "yes" ? "reply" : "noreply"; $index, $chan->{'id'}, $type, $wantreply eq "yes" ? "reply" : "noreply";
push @{$chan->{'requests_'.$direction}}, [$seq, $type] if $wantreply; push @{$chan->{'requests_'.$direction}}, [$seq, $type]
if $wantreply eq "yes";
if ($type eq "pty-req") { if ($type eq "pty-req") {
my ($term, $w, $h, $pw, $ph, $modes) = &parse("suuuus", $data); my ($term, $w, $h, $pw, $ph, $modes) = &parse("suuuus", $data);
printf " %s %sx%s", &str($term), $w, $h; printf " %s %sx%s", &str($term), $w, $h;