X-Git-Url: https://git.distorted.org.uk/u/mdw/putty/blobdiff_plain/cbe2d68fd7c7c7bac692b3a2d200a5d2429ab201..39934deb5202149f98198c111a35c21cb4d0d0f8:/raw.c diff --git a/raw.c b/raw.c index c4936493..8b1b1e9b 100644 --- a/raw.c +++ b/raw.c @@ -37,6 +37,7 @@ static int raw_closing(Plug plug, const char *error_msg, int error_code, if (raw->s) { sk_close(raw->s); raw->s = NULL; + notify_remote_exit(raw->frontend); } if (error_msg) { /* A socket error has occurred. */ @@ -69,7 +70,8 @@ static void raw_sent(Plug plug, int bufsize) */ static const char *raw_init(void *frontend_handle, void **backend_handle, Config *cfg, - char *host, int port, char **realhost, int nodelay) + char *host, int port, char **realhost, int nodelay, + int keepalive) { static const struct plug_function_table fn_table = { raw_closing, @@ -97,8 +99,10 @@ static const char *raw_init(void *frontend_handle, void **backend_handle, sfree(buf); } addr = name_lookup(host, port, realhost, cfg); - if ((err = sk_addr_error(addr)) != NULL) + if ((err = sk_addr_error(addr)) != NULL) { + sk_addr_free(addr); return err; + } if (port < 0) port = 23; /* default telnet port */ @@ -113,13 +117,11 @@ static const char *raw_init(void *frontend_handle, void **backend_handle, logevent(raw->frontend, buf); sfree(buf); } - raw->s = new_connection(addr, *realhost, port, 0, 1, nodelay, + raw->s = new_connection(addr, *realhost, port, 0, 1, nodelay, keepalive, (Plug) raw, cfg); if ((err = sk_socket_error(raw->s)) != NULL) return err; - sk_addr_free(addr); - return NULL; }