Skip to content

Commit 0272dc3

Browse files
committed
io BUGFIX unset errno means EOF
1 parent a3b6632 commit 0272dc3

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/io.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ nc_read(struct nc_session *session, char *buf, size_t count, uint32_t inact_time
181181
session->term_reason = NC_SESSION_TERM_DROPPED;
182182
return -1;
183183
case SSL_ERROR_SYSCALL:
184-
ERR(session, "SSL socket error (%s).", strerror(errno));
184+
ERR(session, "SSL socket error (%s).", errno ? strerror(errno) : "unexpected EOF");
185185
session->status = NC_STATUS_INVALID;
186186
session->term_reason = NC_SESSION_TERM_OTHER;
187187
return -1;

src/session_client_tls.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -650,7 +650,7 @@ nc_connect_tls(const char *host, unsigned short port, struct ly_ctx *ctx)
650650
if (ret != 1) {
651651
switch (SSL_get_error(session->ti.tls, ret)) {
652652
case SSL_ERROR_SYSCALL:
653-
ERR(NULL, "SSL_connect failed (%s).", strerror(errno));
653+
ERR(NULL, "SSL_connect failed (%s).", errno ? strerror(errno) : "unexpected EOF");
654654
break;
655655
case SSL_ERROR_SSL:
656656
ERR(NULL, "SSL_connect failed (%s).", ERR_reason_error_string(ERR_get_error()));

0 commit comments

Comments
 (0)