aboutsummaryrefslogtreecommitdiff
path: root/ssh
diff options
context:
space:
mode:
authorTom Smeding <tom.smeding@gmail.com>2020-10-03 21:30:25 +0200
committerTom Smeding <tom.smeding@gmail.com>2020-10-03 21:30:25 +0200
commitd096bb626f8dd78b6ba1ac9c2d19e567cb88827e (patch)
treeb70cb7e7790173147a23201a788d891702e583ea /ssh
parent856ae316cb369956917a8dcdbeb4d662522c5f7f (diff)
sshnc: Cleanup sshnc_maybe_recv
Diffstat (limited to 'ssh')
-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);