X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=blobdiff_plain;f=raw.c;h=6262ed8994acc7a6a583addd71d924947ec11f3b;hb=9dd9860cc84f82309de64c33e2813c6e9dc60749;hp=1d9f854cd65f77e1b9b7cec754a58462133aaa2e;hpb=ea301bdd9b892a5e70692f82f5c0b98bd585e775;p=PuTTY.git diff --git a/raw.c b/raw.c index 1d9f854c..6262ed89 100644 --- a/raw.c +++ b/raw.c @@ -125,8 +125,8 @@ static void raw_sent(Plug plug, int bufsize) */ static const char *raw_init(void *frontend_handle, void **backend_handle, Conf *conf, - char *host, int port, char **realhost, int nodelay, - int keepalive) + const char *host, int port, char **realhost, + int nodelay, int keepalive) { static const struct plug_function_table fn_table = { raw_log, @@ -146,6 +146,7 @@ static const char *raw_init(void *frontend_handle, void **backend_handle, raw->closed_on_socket_error = FALSE; *backend_handle = raw; raw->sent_console_eof = raw->sent_socket_eof = FALSE; + raw->bufsize = 0; raw->frontend = frontend_handle; @@ -185,15 +186,10 @@ static const char *raw_init(void *frontend_handle, void **backend_handle, sfree(*realhost); *realhost = dupstr(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 = host_strrchr(*realhost, ':'); + if (colon) *colon++ = '\0'; - } } return NULL; @@ -218,7 +214,7 @@ static void raw_reconfig(void *handle, Conf *conf) /* * Called to send data down the raw connection. */ -static int raw_send(void *handle, char *buf, int len) +static int raw_send(void *handle, const char *buf, int len) { Raw raw = (Raw) handle; @@ -343,6 +339,7 @@ Backend raw_backend = { raw_provide_logctx, raw_unthrottle, raw_cfg_info, + NULL /* test_for_upstream */, "raw", PROT_RAW, 0