projects
/
u
/
mdw
/
putty
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add input-focus support for System 7, where the Control Manager can't do
[u/mdw/putty]
/
portfwd.c
diff --git
a/portfwd.c
b/portfwd.c
index
e1499de
..
00c6cfc
100644
(file)
--- a/
portfwd.c
+++ b/
portfwd.c
@@
-57,7
+57,7
@@
struct pfwd_queue {
};
struct PFwdPrivate {
};
struct PFwdPrivate {
- struct plug_function_table *fn;
+
const
struct plug_function_table *fn;
/* the above variable absolutely *must* be the first in this structure */
void *c; /* (channel) data used by ssh.c */
void *backhandle; /* instance of SSH backend itself */
/* the above variable absolutely *must* be the first in this structure */
void *c; /* (channel) data used by ssh.c */
void *backhandle; /* instance of SSH backend itself */
@@
-111,7
+111,7
@@
static void pfd_sent(Plug plug, int bufsize)
char *pfd_newconnect(Socket *s, char *hostname, int port, void *c,
const Config *cfg)
{
char *pfd_newconnect(Socket *s, char *hostname, int port, void *c,
const Config *cfg)
{
- static struct plug_function_table fn_table = {
+ static
const
struct plug_function_table fn_table = {
pfd_closing,
pfd_receive,
pfd_sent,
pfd_closing,
pfd_receive,
pfd_sent,
@@
-132,7
+132,7
@@
char *pfd_newconnect(Socket *s, char *hostname, int port, void *c,
/*
* Open socket.
*/
/*
* Open socket.
*/
- pr =
(struct PFwdPrivate *) smalloc(sizeof(struct PFwdPrivate)
);
+ pr =
snew(struct PFwdPrivate
);
pr->fn = &fn_table;
pr->throttled = pr->throttle_override = 0;
pr->ready = 1;
pr->fn = &fn_table;
pr->throttled = pr->throttle_override = 0;
pr->ready = 1;
@@
-157,7
+157,7
@@
char *pfd_newconnect(Socket *s, char *hostname, int port, void *c,
static int pfd_accepting(Plug p, void *sock)
{
static int pfd_accepting(Plug p, void *sock)
{
- static struct plug_function_table fn_table = {
+ static
const
struct plug_function_table fn_table = {
pfd_closing,
pfd_receive,
pfd_sent,
pfd_closing,
pfd_receive,
pfd_sent,
@@
-168,7
+168,7
@@
static int pfd_accepting(Plug p, void *sock)
char *err;
org = (struct PFwdPrivate *)p;
char *err;
org = (struct PFwdPrivate *)p;
- pr =
(struct PFwdPrivate *) smalloc(sizeof(struct PFwdPrivate)
);
+ pr =
snew(struct PFwdPrivate
);
pr->fn = &fn_table;
pr->c = NULL;
pr->fn = &fn_table;
pr->c = NULL;
@@
-208,7
+208,7
@@
static int pfd_accepting(Plug p, void *sock)
char *pfd_addforward(char *desthost, int destport, char *srcaddr, int port,
void *backhandle, const Config *cfg)
{
char *pfd_addforward(char *desthost, int destport, char *srcaddr, int port,
void *backhandle, const Config *cfg)
{
- static struct plug_function_table fn_table = {
+ static
const
struct plug_function_table fn_table = {
pfd_closing,
pfd_receive, /* should not happen... */
pfd_sent, /* also should not happen */
pfd_closing,
pfd_receive, /* should not happen... */
pfd_sent, /* also should not happen */
@@
-222,7
+222,7
@@
char *pfd_addforward(char *desthost, int destport, char *srcaddr, int port,
/*
* Open socket.
*/
/*
* Open socket.
*/
- pr =
(struct PFwdPrivate *) smalloc(sizeof(struct PFwdPrivate)
);
+ pr =
snew(struct PFwdPrivate
);
pr->fn = &fn_table;
pr->c = NULL;
strcpy(pr->hostname, desthost);
pr->fn = &fn_table;
pr->c = NULL;
strcpy(pr->hostname, desthost);