Add dependencies for x11fwd.obj to Makefile (thanks Catbells :-)
[sgt/putty] / x11fwd.c
index b4fecd9..d0a1f99 100644 (file)
--- a/x11fwd.c
+++ b/x11fwd.c
@@ -106,6 +106,14 @@ static int x11_verify(char *proto, unsigned char *data, int dlen) {
 static int x11_receive (Socket s, int urgent, char *data, int len) {
     struct X11Private *pr = (struct X11Private *)sk_get_private_ptr(s);
 
+    if (urgent==3) {
+        /*
+         * A socket error has occurred. We have no way to
+         * communicate this down the forwarded connection, so we'll
+         * just treat it like a proper close.
+         */
+        len = 0;
+    }
     if (!len) {
        /* Connection has closed. */
         sshfwd_close(pr->c);
@@ -155,7 +163,7 @@ char *x11_init (Socket *s, char *display, void *c) {
     /*
      * Open socket.
      */
-    *s = sk_new(addr, port, 0, x11_receive);
+    *s = sk_new(addr, port, 0, 1, x11_receive);
     if ( (err = sk_socket_error(*s)) )
        return err;