Skip to content

Commit

Permalink
Exit transfer loop when output fd is closed
Browse files Browse the repository at this point in the history
If input fd is closed due to EOF, we need to continue transferring IO to handle the
case:

   echo -e "print('hello world')\n" | ssh recuser@localhost "python3"

Otherwise, exit when EOF is received from source.
  • Loading branch information
justin-stephenson committed Apr 20, 2022
1 parent 86cca62 commit 726b5f9
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/tlog/rec.c
Original file line number Diff line number Diff line change
Expand Up @@ -967,6 +967,10 @@ tlog_rec_transfer(struct tlog_errs **perrs,
}
} else if (tlog_pkt_is_eof(&pkt)) {
tlog_sink_io_close(tty_sink, pkt.data.io.output);
/* Continue if only input was closed */
if (pkt.data.io.output) {
break;
}
}
}

Expand Down

0 comments on commit 726b5f9

Please sign in to comment.