projects
/
u
/
mdw
/
putty
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Integrate unfix.org's IPv6 patches up to level 10, with rather a lot
[u/mdw/putty]
/
raw.c
diff --git
a/raw.c
b/raw.c
index
c493649
..
8619446
100644
(file)
--- 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;
if (raw->s) {
sk_close(raw->s);
raw->s = NULL;
+ notify_remote_exit(raw->frontend);
}
if (error_msg) {
/* A socket error has occurred. */
}
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,
*/
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,
{
static const struct plug_function_table fn_table = {
raw_closing,
@@
-92,13
+94,18
@@
static const char *raw_init(void *frontend_handle, void **backend_handle,
*/
{
char *buf;
*/
{
char *buf;
- buf = dupprintf("Looking up host \"%s\"", host);
+ buf = dupprintf("Looking up host \"%s\"%s", host,
+ (cfg->addressfamily == ADDRTYPE_IPV4 ? " (IPv4)" :
+ (cfg->addressfamily == ADDRTYPE_IPV6 ? " (IPv6)" :
+ "")));
logevent(raw->frontend, buf);
sfree(buf);
}
logevent(raw->frontend, buf);
sfree(buf);
}
- addr = name_lookup(host, port, realhost, cfg);
- if ((err = sk_addr_error(addr)) != NULL)
+ addr = name_lookup(host, port, realhost, cfg, cfg->addressfamily);
+ if ((err = sk_addr_error(addr)) != NULL) {
+ sk_addr_free(addr);
return err;
return err;
+ }
if (port < 0)
port = 23; /* default telnet port */
if (port < 0)
port = 23; /* default telnet port */
@@
-113,13
+120,11
@@
static const char *raw_init(void *frontend_handle, void **backend_handle,
logevent(raw->frontend, buf);
sfree(buf);
}
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;
(Plug) raw, cfg);
if ((err = sk_socket_error(raw->s)) != NULL)
return err;
- sk_addr_free(addr);
-
return NULL;
}
return NULL;
}
@@
-234,6
+239,14
@@
static int raw_exitcode(void *handle)
return 0;
}
return 0;
}
+/*
+ * cfg_info for Raw does nothing at all.
+ */
+static int raw_cfg_info(void *handle)
+{
+ return 0;
+}
+
Backend raw_backend = {
raw_init,
raw_free,
Backend raw_backend = {
raw_init,
raw_free,
@@
-250,5
+263,6
@@
Backend raw_backend = {
raw_provide_ldisc,
raw_provide_logctx,
raw_unthrottle,
raw_provide_ldisc,
raw_provide_logctx,
raw_unthrottle,
+ raw_cfg_info,
1
};
1
};