1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-07-31 10:34:32 -05:00

Make plug receive and closing functions return void instead of int.

Nothing was paying attention to their return values any more anyway.
This commit is contained in:
Ben Harris
2016-06-02 23:03:24 +01:00
parent 0d9c7d82e8
commit 0d57b8a4d9
11 changed files with 73 additions and 98 deletions

View File

@@ -117,8 +117,8 @@ static void pfl_log(Plug plug, int type, SockAddr addr, int port,
/* we have to dump these since we have no interface to logging.c */
}
static int pfd_closing(Plug plug, const char *error_msg, int error_code,
int calling_back)
static void pfd_closing(Plug plug, const char *error_msg, int error_code,
int calling_back)
{
struct PortForwarding *pf = (struct PortForwarding *) plug;
@@ -145,16 +145,13 @@ static int pfd_closing(Plug plug, const char *error_msg, int error_code,
if (pf->c)
sshfwd_write_eof(pf->c);
}
return 1;
}
static int pfl_closing(Plug plug, const char *error_msg, int error_code,
int calling_back)
static void pfl_closing(Plug plug, const char *error_msg, int error_code,
int calling_back)
{
struct PortListener *pl = (struct PortListener *) plug;
pfl_terminate(pl);
return 1;
}
static void wrap_send_port_open(void *channel, const char *hostname, int port,
@@ -172,7 +169,7 @@ static void wrap_send_port_open(void *channel, const char *hostname, int port,
sfree(description);
}
static int pfd_receive(Plug plug, int urgent, char *data, int len)
static void pfd_receive(Plug plug, int urgent, char *data, int len)
{
struct PortForwarding *pf = (struct PortForwarding *) plug;
if (pf->dynamic) {
@@ -204,7 +201,7 @@ static int pfd_receive(Plug plug, int urgent, char *data, int len)
data[1] = 91; /* generic `request rejected' */
sk_write(pf->s, data, 8);
pfd_close(pf);
return 1;
return;
}
if (pf->sockslen <= 8)
continue; /* haven't started user/hostname */
@@ -320,7 +317,7 @@ static int pfd_receive(Plug plug, int urgent, char *data, int len)
reply[1] = 1; /* generic failure */
sk_write(pf->s, (char *) reply, lenof(reply));
pfd_close(pf);
return 1;
return;
}
/*
* Now we have a viable connect request. Switch
@@ -350,7 +347,7 @@ static int pfd_receive(Plug plug, int urgent, char *data, int len)
reply[1] = 8; /* atype not supported */
sk_write(pf->s, (char *) reply, lenof(reply));
pfd_close(pf);
return 1;
return;
}
}
}
@@ -362,9 +359,8 @@ static int pfd_receive(Plug plug, int urgent, char *data, int len)
* close the connection rudely.
*/
pfd_close(pf);
return 1;
}
return 1;
return;
/*
* We come here when we're ready to make an actual
@@ -383,7 +379,7 @@ static int pfd_receive(Plug plug, int urgent, char *data, int len)
pf->c = new_sock_channel(pf->backhandle, pf);
if (pf->c == NULL) {
pfd_close(pf);
return 1;
return;
} else {
/* asks to forward to the specified host/port for this */
wrap_send_port_open(pf->c, pf->hostname, pf->port, pf->s);
@@ -406,7 +402,6 @@ static int pfd_receive(Plug plug, int urgent, char *data, int len)
sk_set_frozen(pf->s, 1);
}
}
return 1;
}
static void pfd_sent(Plug plug, int bufsize)