mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-01-26 09:42:25 +00:00
There's no real need for portfwd.c to reference `cfg' directly, when
it only needs one item from it and that can easily be passed in from the call site in ssh.c. [originally from svn r2564]
This commit is contained in:
parent
6a2c0436de
commit
5ecbac2441
@ -204,7 +204,7 @@ static int pfd_accepting(Plug p, void *sock)
|
|||||||
sets up a listener on the local machine on (srcaddr:)port
|
sets up a listener on the local machine on (srcaddr:)port
|
||||||
*/
|
*/
|
||||||
char *pfd_addforward(char *desthost, int destport, char *srcaddr, int port,
|
char *pfd_addforward(char *desthost, int destport, char *srcaddr, int port,
|
||||||
void *backhandle)
|
void *backhandle, int acceptall)
|
||||||
{
|
{
|
||||||
static struct plug_function_table fn_table = {
|
static struct plug_function_table fn_table = {
|
||||||
pfd_closing,
|
pfd_closing,
|
||||||
@ -230,7 +230,7 @@ char *pfd_addforward(char *desthost, int destport, char *srcaddr, int port,
|
|||||||
pr->waiting = NULL;
|
pr->waiting = NULL;
|
||||||
pr->backhandle = backhandle;
|
pr->backhandle = backhandle;
|
||||||
|
|
||||||
pr->s = s = new_listener(srcaddr, port, (Plug) pr, !cfg.lport_acceptall);
|
pr->s = s = new_listener(srcaddr, port, (Plug) pr, !acceptall);
|
||||||
if ((err = sk_socket_error(s)) != NULL) {
|
if ((err = sk_socket_error(s)) != NULL) {
|
||||||
sfree(pr);
|
sfree(pr);
|
||||||
return err;
|
return err;
|
||||||
|
4
ssh.c
4
ssh.c
@ -3121,7 +3121,7 @@ static void ssh1_protocol(Ssh ssh, unsigned char *in, int inlen, int ispkt)
|
|||||||
if (sport && dport) {
|
if (sport && dport) {
|
||||||
if (type == 'L') {
|
if (type == 'L') {
|
||||||
pfd_addforward(host, dport, *saddr ? saddr : NULL,
|
pfd_addforward(host, dport, *saddr ? saddr : NULL,
|
||||||
sport, ssh);
|
sport, ssh, ssh->cfg.lport_acceptall);
|
||||||
logeventf(ssh, "Local port %.*s%.*s%.*s%.*s%d%.*s"
|
logeventf(ssh, "Local port %.*s%.*s%.*s%.*s%d%.*s"
|
||||||
" forwarding to %s:%.*s%.*s%d%.*s",
|
" forwarding to %s:%.*s%.*s%d%.*s",
|
||||||
(int)(*saddr?strlen(saddr):0), *saddr?saddr:NULL,
|
(int)(*saddr?strlen(saddr):0), *saddr?saddr:NULL,
|
||||||
@ -5185,7 +5185,7 @@ static void do_ssh2_authconn(Ssh ssh, unsigned char *in, int inlen, int ispkt)
|
|||||||
if (sport && dport) {
|
if (sport && dport) {
|
||||||
if (type == 'L') {
|
if (type == 'L') {
|
||||||
pfd_addforward(host, dport, *saddr ? saddr : NULL,
|
pfd_addforward(host, dport, *saddr ? saddr : NULL,
|
||||||
sport, ssh);
|
sport, ssh, ssh->cfg.lport_acceptall);
|
||||||
logeventf(ssh, "Local port %.*s%.*s%.*s%.*s%d%.*s"
|
logeventf(ssh, "Local port %.*s%.*s%.*s%.*s%d%.*s"
|
||||||
" forwarding to %s:%.*s%.*s%d%.*s",
|
" forwarding to %s:%.*s%.*s%d%.*s",
|
||||||
(int)(*saddr?strlen(saddr):0), *saddr?saddr:NULL,
|
(int)(*saddr?strlen(saddr):0), *saddr?saddr:NULL,
|
||||||
|
2
ssh.h
2
ssh.h
@ -258,7 +258,7 @@ void ssh_send_port_open(void *channel, char *hostname, int port, char *org);
|
|||||||
/* Exports from portfwd.c */
|
/* Exports from portfwd.c */
|
||||||
extern char *pfd_newconnect(Socket * s, char *hostname, int port, void *c);
|
extern char *pfd_newconnect(Socket * s, char *hostname, int port, void *c);
|
||||||
extern char *pfd_addforward(char *desthost, int destport, char *srcaddr,
|
extern char *pfd_addforward(char *desthost, int destport, char *srcaddr,
|
||||||
int port, void *backhandle);
|
int port, void *backhandle, int acceptall);
|
||||||
extern void pfd_close(Socket s);
|
extern void pfd_close(Socket s);
|
||||||
extern int pfd_send(Socket s, char *data, int len);
|
extern int pfd_send(Socket s, char *data, int len);
|
||||||
extern void pfd_confirm(Socket s);
|
extern void pfd_confirm(Socket s);
|
||||||
|
Loading…
Reference in New Issue
Block a user