Skip to content

Commit f031e03

Browse files
Roytakmichalvasko
authored andcommitted
io UPDATE dont fail on SSH_EOF in nc_write
If we receiver SSH_EOF in nc_write, it means that the peer won't be sending anything anymore, but it can still receive, so we shouldn't fail. This doesn't apply to nc_read, where it's still valid to fail.
1 parent 41138bc commit f031e03

1 file changed

Lines changed: 2 additions & 6 deletions

File tree

src/io.c

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -603,12 +603,8 @@ nc_write(struct nc_session *session, const void *buf, uint32_t count)
603603

604604
#ifdef NC_ENABLED_SSH_TLS
605605
case NC_TI_SSH:
606-
if (ssh_channel_is_closed(session->ti.libssh.channel) || ssh_channel_is_eof(session->ti.libssh.channel)) {
607-
if (ssh_channel_is_closed(session->ti.libssh.channel)) {
608-
ERR(session, "SSH channel unexpectedly closed.");
609-
} else {
610-
ERR(session, "SSH channel unexpected EOF.");
611-
}
606+
if (ssh_channel_is_closed(session->ti.libssh.channel)) {
607+
ERR(session, "SSH channel unexpectedly closed.");
612608
session->status = NC_STATUS_INVALID;
613609
session->term_reason = NC_SESSION_TERM_DROPPED;
614610
return -1;

0 commit comments

Comments
 (0)