mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-07-01 11:32:48 -05:00
Merge the two low-level portfwd setup systems.
In commit09954a87c
I introduced the portfwdmgr_connect_socket() system, which opened a port forwarding given a callback to create the Socket itself, with the aim of using it to make forwardings to Unix- domain sockets and Windows named pipes (both initially for agent forwarding). But I forgot that a year and a bit ago, in commit834396170
, I already introduced a similar low-level system for creating a PortForwarding around an unusual kind of socket: the portfwd_raw_new() system, which in place of a callback uses a two-phase setup protocol (you create the socket in between the two setup calls, and can roll it back if the socket can't be created). There's really no need to have _both_ these systems! So now I'm merging them, which is to say, I'm enhancing portfwd_raw_new to have the one new feature it needs, and throwing away the newer system completely. The new feature is to be able to control the initial state of the 'ready' flag: portfwd_raw_new was always used for initiating port forwardings in response to an incoming local connection, which means you need to start off with ready=false and set it true when the other end of the SSH connection sends back OPEN_CONFIRMATION. Now it's being used for initiating port forwardings in response to a CHANNEL_OPEN, we need to be able to start with ready=true. This commit reverts09954a87c2
and its followup fix12aa06ccc9
, and simplifies the agent_connect system down to a single trivial function that makes a Socket given a Plug.
This commit is contained in:
5
ssh.h
5
ssh.h
@ -380,13 +380,10 @@ void portfwdmgr_close_all(PortFwdManager *mgr);
|
||||
char *portfwdmgr_connect(PortFwdManager *mgr, Channel **chan_ret,
|
||||
char *hostname, int port, SshChannel *c,
|
||||
int addressfamily);
|
||||
char *portfwdmgr_connect_socket(PortFwdManager *mgr, Channel **chan_ret,
|
||||
Socket *(*connect)(void *, Plug *), void *ctx,
|
||||
SshChannel *c);
|
||||
bool portfwdmgr_listen(PortFwdManager *mgr, const char *host, int port,
|
||||
const char *keyhost, int keyport, Conf *conf);
|
||||
bool portfwdmgr_unlisten(PortFwdManager *mgr, const char *host, int port);
|
||||
Channel *portfwd_raw_new(ConnectionLayer *cl, Plug **plug);
|
||||
Channel *portfwd_raw_new(ConnectionLayer *cl, Plug **plug, bool start_ready);
|
||||
void portfwd_raw_free(Channel *pfchan);
|
||||
void portfwd_raw_setup(Channel *pfchan, Socket *s, SshChannel *sc);
|
||||
|
||||
|
Reference in New Issue
Block a user