mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-07-02 03:52:49 -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:
25
sshshare.c
25
sshshare.c
@ -911,8 +911,8 @@ static void share_disconnect(struct ssh_sharing_connstate *cs,
|
||||
share_begin_cleanup(cs);
|
||||
}
|
||||
|
||||
static int share_closing(Plug plug, const char *error_msg, int error_code,
|
||||
int calling_back)
|
||||
static void share_closing(Plug plug, const char *error_msg, int error_code,
|
||||
int calling_back)
|
||||
{
|
||||
struct ssh_sharing_connstate *cs = (struct ssh_sharing_connstate *)plug;
|
||||
|
||||
@ -935,7 +935,6 @@ static int share_closing(Plug plug, const char *error_msg, int error_code,
|
||||
"Socket error: %s", error_msg);
|
||||
}
|
||||
share_begin_cleanup(cs);
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int getstring_inner(const void *vdata, int datalen,
|
||||
@ -1775,17 +1774,17 @@ static void share_got_pkt_from_downstream(struct ssh_sharing_connstate *cs,
|
||||
* Coroutine macros similar to, but simplified from, those in ssh.c.
|
||||
*/
|
||||
#define crBegin(v) { int *crLine = &v; switch(v) { case 0:;
|
||||
#define crFinish(z) } *crLine = 0; return (z); }
|
||||
#define crFinishV } *crLine = 0; return; }
|
||||
#define crGetChar(c) do \
|
||||
{ \
|
||||
while (len == 0) { \
|
||||
*crLine =__LINE__; return 1; case __LINE__:; \
|
||||
*crLine =__LINE__; return; case __LINE__:; \
|
||||
} \
|
||||
len--; \
|
||||
(c) = (unsigned char)*data++; \
|
||||
} while (0)
|
||||
|
||||
static int share_receive(Plug plug, int urgent, char *data, int len)
|
||||
static void share_receive(Plug plug, int urgent, char *data, int len)
|
||||
{
|
||||
struct ssh_sharing_connstate *cs = (struct ssh_sharing_connstate *)plug;
|
||||
static const char expected_verstring_prefix[] =
|
||||
@ -1858,7 +1857,7 @@ static int share_receive(Plug plug, int urgent, char *data, int len)
|
||||
}
|
||||
|
||||
dead:;
|
||||
crFinish(1);
|
||||
crFinishV;
|
||||
}
|
||||
|
||||
static void share_sent(Plug plug, int bufsize)
|
||||
@ -1875,8 +1874,8 @@ static void share_sent(Plug plug, int bufsize)
|
||||
*/
|
||||
}
|
||||
|
||||
static int share_listen_closing(Plug plug, const char *error_msg,
|
||||
int error_code, int calling_back)
|
||||
static void share_listen_closing(Plug plug, const char *error_msg,
|
||||
int error_code, int calling_back)
|
||||
{
|
||||
struct ssh_sharing_state *sharestate = (struct ssh_sharing_state *)plug;
|
||||
if (error_msg)
|
||||
@ -1884,7 +1883,6 @@ static int share_listen_closing(Plug plug, const char *error_msg,
|
||||
"listening socket: %s", error_msg);
|
||||
sk_close(sharestate->listensock);
|
||||
sharestate->listensock = NULL;
|
||||
return 1;
|
||||
}
|
||||
|
||||
static void share_send_verstring(struct ssh_sharing_connstate *cs)
|
||||
@ -2047,10 +2045,9 @@ char *ssh_share_sockname(const char *host, int port, Conf *conf)
|
||||
|
||||
static void nullplug_socket_log(Plug plug, int type, SockAddr addr, int port,
|
||||
const char *error_msg, int error_code) {}
|
||||
static int nullplug_closing(Plug plug, const char *error_msg, int error_code,
|
||||
int calling_back) { return 0; }
|
||||
static int nullplug_receive(Plug plug, int urgent, char *data,
|
||||
int len) { return 0; }
|
||||
static void nullplug_closing(Plug plug, const char *error_msg, int error_code,
|
||||
int calling_back) {}
|
||||
static void nullplug_receive(Plug plug, int urgent, char *data, int len) {}
|
||||
static void nullplug_sent(Plug plug, int bufsize) {}
|
||||
|
||||
int ssh_share_test_for_upstream(const char *host, int port, Conf *conf)
|
||||
|
Reference in New Issue
Block a user