aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ssh/sshnc.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/ssh/sshnc.c b/ssh/sshnc.c
index 0c912dd..eea1fc7 100644
--- a/ssh/sshnc.c
+++ b/ssh/sshnc.c
@@ -342,18 +342,18 @@ enum sshnc_retval sshnc_maybe_recv(
return SSHNC_ERR_POLL;
}
- const int status = ssh_get_status(client->sesdata->session);
- if (client->sesdata->should_close
- || (status & (SSH_CLOSED | SSH_CLOSED_ERROR))) {
+ struct session_data *const ses = client->sesdata;
+
+ if (ses->should_close
+ || (ssh_get_status(ses->session) & (SSH_CLOSED | SSH_CLOSED_ERROR))) {
sshnc_close_nofree(client);
return SSHNC_EOF;
}
- if (client->sesdata->recvlen == 0) {
+ if (ses->recvlen == 0) {
return SSHNC_AGAIN;
}
- struct session_data *const ses = client->sesdata;
const size_t consumed = min_size_t(ses->recvlen, capacity);
memcpy(data, ses->recvdata, consumed);