We have access to one at every call site, so there's really no reason
not to send it through to ssh.c to be logged.
git-svn-id: http://svn.tartarus.org/sgt/putty@10038
cda61777-01e9-0310-a592-
d414129be87e
* Socket error. Slam the connection instantly shut.
*/
if (pr->c) {
- sshfwd_unclean_close(pr->c);
+ sshfwd_unclean_close(pr->c, error_msg);
} else {
/*
* We might not have an SSH channel, if a socket error
ssh_channel_try_eof(c);
}
-void sshfwd_unclean_close(struct ssh_channel *c)
+void sshfwd_unclean_close(struct ssh_channel *c, const char *err)
{
Ssh ssh = c->ssh;
switch (c->type) {
case CHAN_X11:
x11_close(c->u.x11.s);
- logevent("Forwarded X11 connection terminated due to local error");
+ logeventf(ssh, "Forwarded X11 connection terminated due to local "
+ "error: %s", err);
break;
case CHAN_SOCKDATA:
case CHAN_SOCKDATA_DORMANT:
pfd_close(c->u.pfd.s);
- logevent("Forwarded port closed due to local error");
+ logeventf(ssh, "Forwarded port closed due to local error: %s", err);
break;
}
c->type = CHAN_ZOMBIE;
extern int sshfwd_write(struct ssh_channel *c, char *, int);
extern void sshfwd_write_eof(struct ssh_channel *c);
-extern void sshfwd_unclean_close(struct ssh_channel *c);
+extern void sshfwd_unclean_close(struct ssh_channel *c, const char *err);
extern void sshfwd_unthrottle(struct ssh_channel *c, int bufsize);
/*
/*
* Socket error. Slam the connection instantly shut.
*/
- sshfwd_unclean_close(pr->c);
+ sshfwd_unclean_close(pr->c, error_msg);
} else {
/*
* Ordinary EOF received on socket. Send an EOF on the SSH