1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-07-01 03:22:48 -05:00

The `socket' function in the backends is only ever checked to see if

it's NULL. Since we already have one back end (uxpty) which doesn't
in fact talk to a network socket, and may well have more soon, I'm
replacing this TCP/IP-centric function with a nice neutral
`connected' function returning a boolean. Nothing else about its
semantics has currently changed.

[originally from svn r6810]
This commit is contained in:
Simon Tatham
2006-08-27 08:03:19 +00:00
parent cda522186a
commit c353c3cc97
10 changed files with 26 additions and 26 deletions

View File

@ -899,7 +899,7 @@ int main(int argc, char **argv)
FD_SET_MAX(signalpipe[0], maxfd, rset);
if (connopen && !sending &&
back->socket(backhandle) != NULL &&
back->connected(backhandle) &&
back->sendok(backhandle) &&
back->sendbuffer(backhandle) < MAX_STDIN_BACKLOG) {
/* If we're OK to send, then try to read from stdin. */
@ -1014,7 +1014,7 @@ int main(int argc, char **argv)
char buf[4096];
int ret;
if (connopen && back->socket(backhandle) != NULL) {
if (connopen && back->connected(backhandle)) {
ret = read(0, buf, sizeof(buf));
if (ret < 0) {
perror("stdin: read");
@ -1039,7 +1039,7 @@ int main(int argc, char **argv)
try_output(1);
}
if ((!connopen || back->socket(backhandle) == NULL) &&
if ((!connopen || !back->connected(backhandle)) &&
bufchain_size(&stdout_data) == 0 &&
bufchain_size(&stderr_data) == 0)
break; /* we closed the connection */

View File

@ -1008,10 +1008,10 @@ static const struct telnet_special *pty_get_specials(void *handle)
return NULL;
}
static Socket pty_socket(void *handle)
static int pty_connected(void *handle)
{
/* Pty pty = (Pty)handle; */
return NULL; /* shouldn't ever be needed */
return TRUE;
}
static int pty_sendok(void *handle)
@ -1068,7 +1068,7 @@ Backend pty_backend = {
pty_size,
pty_special,
pty_get_specials,
pty_socket,
pty_connected,
pty_exitcode,
pty_sendok,
pty_ldisc,