X-Git-Url: https://git.distorted.org.uk/u/mdw/putty/blobdiff_plain/eaf1e20af0294d79a176d2ac3b35fd4143163051..65d1432e946f534ce0b3216235798ffc882b6e4d:/raw.c diff --git a/raw.c b/raw.c index 28da09f7..b2676a93 100644 --- a/raw.c +++ b/raw.c @@ -139,6 +139,22 @@ static const char *raw_init(void *frontend_handle, void **backend_handle, if ((err = sk_socket_error(raw->s)) != NULL) return err; + if (*cfg->loghost) { + char *colon; + + sfree(*realhost); + *realhost = dupstr(cfg->loghost); + colon = strrchr(*realhost, ':'); + if (colon) { + /* + * FIXME: if we ever update this aspect of ssh.c for + * IPv6 literal management, this should change in line + * with it. + */ + *colon++ = '\0'; + } + } + return NULL; } @@ -209,10 +225,10 @@ static const struct telnet_special *raw_get_specials(void *handle) return NULL; } -static Socket raw_socket(void *handle) +static int raw_connected(void *handle) { Raw raw = (Raw) handle; - return raw->s; + return raw->s != NULL; } static int raw_sendok(void *handle) @@ -270,7 +286,7 @@ Backend raw_backend = { raw_size, raw_special, raw_get_specials, - raw_socket, + raw_connected, raw_exitcode, raw_sendok, raw_ldisc, @@ -278,5 +294,7 @@ Backend raw_backend = { raw_provide_logctx, raw_unthrottle, raw_cfg_info, - 1 + "raw", + PROT_RAW, + 0 };