projects
/
u
/
mdw
/
putty
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
The back ends now contain their own copies of the Config structure,
[u/mdw/putty]
/
rlogin.c
diff --git
a/rlogin.c
b/rlogin.c
index
b43804d
..
afc3d2c
100644
(file)
--- a/
rlogin.c
+++ b/
rlogin.c
@@
-98,6
+98,7
@@
static void rlogin_sent(Plug plug, int bufsize)
* freed by the caller.
*/
static char *rlogin_init(void *frontend_handle, void **backend_handle,
* freed by the caller.
*/
static char *rlogin_init(void *frontend_handle, void **backend_handle,
+ Config *cfg,
char *host, int port, char **realhost, int nodelay)
{
static const struct plug_function_table fn_table = {
char *host, int port, char **realhost, int nodelay)
{
static const struct plug_function_table fn_table = {
@@
-113,8
+114,8
@@
static char *rlogin_init(void *frontend_handle, void **backend_handle,
rlogin->fn = &fn_table;
rlogin->s = NULL;
rlogin->frontend = frontend_handle;
rlogin->fn = &fn_table;
rlogin->s = NULL;
rlogin->frontend = frontend_handle;
- rlogin->term_width = cfg
.
width;
- rlogin->term_height = cfg
.
height;
+ rlogin->term_width = cfg
->
width;
+ rlogin->term_height = cfg
->
height;
*backend_handle = rlogin;
/*
*backend_handle = rlogin;
/*
@@
-126,8
+127,8
@@
static char *rlogin_init(void *frontend_handle, void **backend_handle,
logevent(rlogin->frontend, buf);
sfree(buf);
}
logevent(rlogin->frontend, buf);
sfree(buf);
}
- addr =
sk_namelookup(hos
t, realhost);
- if ((err = sk_addr_error(addr)))
+ addr =
name_lookup(host, por
t, realhost);
+ if ((err = sk_addr_error(addr))
!= NULL
)
return err;
if (port < 0)
return err;
if (port < 0)
@@
-145,7
+146,7
@@
static char *rlogin_init(void *frontend_handle, void **backend_handle,
}
rlogin->s = new_connection(addr, *realhost, port, 1, 0,
nodelay, (Plug) rlogin);
}
rlogin->s = new_connection(addr, *realhost, port, 1, 0,
nodelay, (Plug) rlogin);
- if ((err = sk_socket_error(rlogin->s)))
+ if ((err = sk_socket_error(rlogin->s))
!= NULL
)
return err;
sk_addr_free(addr);
return err;
sk_addr_free(addr);
@@
-158,14
+159,17
@@
static char *rlogin_init(void *frontend_handle, void **backend_handle,
char z = 0;
char *p;
sk_write(rlogin->s, &z, 1);
char z = 0;
char *p;
sk_write(rlogin->s, &z, 1);
- sk_write(rlogin->s, cfg.localusername, strlen(cfg.localusername));
+ sk_write(rlogin->s, cfg->localusername,
+ strlen(cfg->localusername));
sk_write(rlogin->s, &z, 1);
sk_write(rlogin->s, &z, 1);
- sk_write(rlogin->s, cfg.username, strlen(cfg.username));
+ sk_write(rlogin->s, cfg->username,
+ strlen(cfg->username));
sk_write(rlogin->s, &z, 1);
sk_write(rlogin->s, &z, 1);
- sk_write(rlogin->s, cfg.termtype, strlen(cfg.termtype));
+ sk_write(rlogin->s, cfg->termtype,
+ strlen(cfg->termtype));
sk_write(rlogin->s, "/", 1);
sk_write(rlogin->s, "/", 1);
- for (p = cfg
.termspeed; isdigit(*p); p++)
;
- sk_write(rlogin->s, cfg
.termspeed, p - cfg.
termspeed);
+ for (p = cfg
->termspeed; isdigit(*p); p++) continue
;
+ sk_write(rlogin->s, cfg
->termspeed, p - cfg->
termspeed);
rlogin->bufsize = sk_write(rlogin->s, &z, 1);
}
rlogin->bufsize = sk_write(rlogin->s, &z, 1);
}
@@
-173,6
+177,13
@@
static char *rlogin_init(void *frontend_handle, void **backend_handle,
}
/*
}
/*
+ * Stub routine (we don't have any need to reconfigure this backend).
+ */
+static void rlogin_reconfig(void *handle, Config *cfg)
+{
+}
+
+/*
* Called to send data down the rlogin connection.
*/
static int rlogin_send(void *handle, char *buf, int len)
* Called to send data down the rlogin connection.
*/
static int rlogin_send(void *handle, char *buf, int len)
@@
-270,6
+281,7
@@
static int rlogin_exitcode(void *handle)
Backend rlogin_backend = {
rlogin_init,
Backend rlogin_backend = {
rlogin_init,
+ rlogin_reconfig,
rlogin_send,
rlogin_sendbuffer,
rlogin_size,
rlogin_send,
rlogin_sendbuffer,
rlogin_size,