diff svr-x11fwd.c @ 13:db2c8e6fb284

Fixed stupid agentfwd error (using the listening FD, not the accepted on. gah)
author Matt Johnston <matt@ucc.asn.au>
date Thu, 03 Jun 2004 18:08:34 +0000
parents 7a37cff27258
children 20563735e8b5
line wrap: on
line diff
--- a/svr-x11fwd.c	Thu Jun 03 17:29:17 2004 +0000
+++ b/svr-x11fwd.c	Thu Jun 03 18:08:34 2004 +0000
@@ -106,6 +106,7 @@
 	struct sockaddr_in addr;
 	int len;
 	int ret;
+	struct ChanSess * chansess = (struct ChanSess *)(listener->typedata);
 
 	len = sizeof(addr);
 
@@ -115,8 +116,8 @@
 	}
 
 	/* if single-connection we close it up */
-	if (((struct ChanSess *)(listener->typedata))->x11singleconn) {
-		x11cleanup(listener);
+	if (chansess->x11singleconn) {
+		x11cleanup(chansess);
 	}
 
 	ret = send_msg_channel_open_x11(fd, &addr);
@@ -166,13 +167,11 @@
 	}
 }
 
-void x11cleanup(struct Listener *listener) {
-
-	struct ChanSess *chansess = (struct ChanSess*)listener->typedata;
+void x11cleanup(struct ChanSess *chansess) {
 
 	m_free(chansess->x11authprot);
 	m_free(chansess->x11authcookie);
-	remove_listener(listener);
+	remove_listener(chansess->x11listener);
 	chansess->x11listener = NULL;
 }