Diff

Differences From Artifact [e6b822ef3d]:

To Artifact [277541ede6]:


503
504
505
506
507
508
509




510
511
512
513
514
515
516
517
518
519
{
    struct X11Private *pr = (struct X11Private *) plug;

    /*
     * We have no way to communicate down the forwarded connection,
     * so if an error occurred on the socket, we just ignore it
     * and treat it like a proper close.




     */
    sshfwd_close(pr->c);
    x11_close(pr->s);
    return 1;
}

static int x11_receive(Plug plug, int urgent, char *data, int len)
{
    struct X11Private *pr = (struct X11Private *) plug;








>
>
>
>

|
<







503
504
505
506
507
508
509
510
511
512
513
514
515

516
517
518
519
520
521
522
{
    struct X11Private *pr = (struct X11Private *) plug;

    /*
     * We have no way to communicate down the forwarded connection,
     * so if an error occurred on the socket, we just ignore it
     * and treat it like a proper close.
     *
     * FIXME: except we could initiate a full close here instead of
     * just an outgoing EOF? ssh.c currently has no API for that, but
     * it could.
     */
    sshfwd_write_eof(pr->c);

    return 1;
}

static int x11_receive(Plug plug, int urgent, char *data, int len)
{
    struct X11Private *pr = (struct X11Private *) plug;

717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
	    reply[0] = 0;	       /* failure */
	    reply[1] = msglen;	       /* length of reason string */
	    memcpy(reply + 2, pr->firstpkt + 2, 4);	/* major/minor proto vsn */
	    PUT_16BIT(pr->firstpkt[0], reply + 6, msgsize >> 2);/* data len */
	    memset(reply + 8, 0, msgsize);
	    memcpy(reply + 8, message, msglen);
	    sshfwd_write(pr->c, (char *)reply, 8 + msgsize);
	    sshfwd_close(pr->c);
	    x11_close(s);
	    sfree(reply);
	    sfree(message);
	    return 0;
	}

	/*
	 * Now we know we're going to accept the connection. Strip







|
<







720
721
722
723
724
725
726
727

728
729
730
731
732
733
734
	    reply[0] = 0;	       /* failure */
	    reply[1] = msglen;	       /* length of reason string */
	    memcpy(reply + 2, pr->firstpkt + 2, 4);	/* major/minor proto vsn */
	    PUT_16BIT(pr->firstpkt[0], reply + 6, msgsize >> 2);/* data len */
	    memset(reply + 8, 0, msgsize);
	    memcpy(reply + 8, message, msglen);
	    sshfwd_write(pr->c, (char *)reply, 8 + msgsize);
	    sshfwd_write_eof(pr->c);

	    sfree(reply);
	    sfree(message);
	    return 0;
	}

	/*
	 * Now we know we're going to accept the connection. Strip
783
784
785
786
787
788
789






    /*
     * After initialisation, just copy data simply.
     */

    return sk_write(s, data, len);
}












>
>
>
>
>
785
786
787
788
789
790
791
792
793
794
795
796

    /*
     * After initialisation, just copy data simply.
     */

    return sk_write(s, data, len);
}

void x11_send_eof(Socket s)
{
    sk_write_eof(s);
}