X-Git-Url: https://git.distorted.org.uk/u/mdw/putty/blobdiff_plain/7555d6a50b05d96de39b5e95cf11a8f05f0c4fd9..95aec24912aa931cd1bd58508313295a9393bd14:/raw.c diff --git a/raw.c b/raw.c index 31d7490c..b2676a93 100644 --- a/raw.c +++ b/raw.c @@ -1,3 +1,7 @@ +/* + * "Raw" backend. + */ + #include #include @@ -135,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; } @@ -205,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) @@ -266,7 +286,7 @@ Backend raw_backend = { raw_size, raw_special, raw_get_specials, - raw_socket, + raw_connected, raw_exitcode, raw_sendok, raw_ldisc, @@ -274,5 +294,7 @@ Backend raw_backend = { raw_provide_logctx, raw_unthrottle, raw_cfg_info, - 1 + "raw", + PROT_RAW, + 0 };