X-Git-Url: https://git.distorted.org.uk/u/mdw/putty/blobdiff_plain/57356d6317f6f33dd622711d305c4579df63b269..86916870d36cb70e7ef0ea760e75a6ae8b2d83a5:/rlogin.c diff --git a/rlogin.c b/rlogin.c index b43804d4..afc3d2c3 100644 --- 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, + Config *cfg, 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->term_width = cfg.width; - rlogin->term_height = cfg.height; + rlogin->term_width = cfg->width; + rlogin->term_height = cfg->height; *backend_handle = rlogin; /* @@ -126,8 +127,8 @@ static char *rlogin_init(void *frontend_handle, void **backend_handle, logevent(rlogin->frontend, buf); sfree(buf); } - addr = sk_namelookup(host, realhost); - if ((err = sk_addr_error(addr))) + addr = name_lookup(host, port, realhost); + if ((err = sk_addr_error(addr)) != NULL) 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); - if ((err = sk_socket_error(rlogin->s))) + if ((err = sk_socket_error(rlogin->s)) != NULL) 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); - 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, cfg.username, strlen(cfg.username)); + sk_write(rlogin->s, cfg->username, + strlen(cfg->username)); 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); - 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); } @@ -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) @@ -270,6 +281,7 @@ static int rlogin_exitcode(void *handle) Backend rlogin_backend = { rlogin_init, + rlogin_reconfig, rlogin_send, rlogin_sendbuffer, rlogin_size,