From d096bb626f8dd78b6ba1ac9c2d19e567cb88827e Mon Sep 17 00:00:00 2001 From: Tom Smeding Date: Sat, 3 Oct 2020 21:30:25 +0200 Subject: sshnc: Cleanup sshnc_maybe_recv --- ssh/sshnc.c | 10 +++++----- 1 file 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); -- cgit v1.2.3-70-g09d2