1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-01-10 09:58:01 +00:00

winplink: remove "connopen" variable.

It's redundant with back->connected(): only the SSH backend has a
receive function that can ever return 0, and whenever ssh_receive
returns 0 it has called ssh_do_close, which will cause future calls
to ssh_connected also to return 0.  Similarly, all backend closing
functions ensure that future calls to their connected function will
return 0.
This commit is contained in:
Ben Harris 2016-05-30 20:47:04 +01:00
parent d56496c31c
commit f65c31667e

View File

@ -87,7 +87,6 @@ void cmdline_error(const char *p, ...)
HANDLE inhandle, outhandle, errhandle;
struct handle *stdin_handle, *stdout_handle, *stderr_handle;
DWORD orig_console_mode;
int connopen;
WSAEVENT netevent;
@ -267,7 +266,7 @@ int stdin_gotdata(struct handle *h, void *data, int len)
cleanup_exit(0);
}
noise_ultralight(len);
if (connopen && back->connected(backhandle)) {
if (back->connected(backhandle)) {
if (len > 0) {
return back->send(backhandle, data, len);
} else {
@ -294,7 +293,7 @@ void stdouterr_sent(struct handle *h, int new_backlog)
(h == stdout_handle ? "output" : "error"), buf);
cleanup_exit(0);
}
if (connopen && back->connected(backhandle)) {
if (back->connected(backhandle)) {
back->unthrottle(backhandle, (handle_backlog(stdout_handle) +
handle_backlog(stderr_handle)));
}
@ -662,7 +661,6 @@ int main(int argc, char **argv)
back->provide_logctx(backhandle, logctx);
sfree(realhost);
}
connopen = 1;
inhandle = GetStdHandle(STD_INPUT_HANDLE);
outhandle = GetStdHandle(STD_OUTPUT_HANDLE);
@ -782,7 +780,7 @@ int main(int argc, char **argv)
LPARAM lp;
int err = things.iErrorCode[eventtypes[e].bit];
lp = WSAMAKESELECTREPLY(eventtypes[e].mask, err);
connopen &= select_result(wp, lp);
select_result(wp, lp);
}
}
}
@ -810,7 +808,7 @@ int main(int argc, char **argv)
if (sending)
handle_unthrottle(stdin_handle, back->sendbuffer(backhandle));
if ((!connopen || !back->connected(backhandle)) &&
if (!back->connected(backhandle) &&
handle_backlog(stdout_handle) + handle_backlog(stderr_handle) == 0)
break; /* we closed the connection */
}