c->halfopen = FALSE;
static void ssh1_smsg_x11_open(Ssh ssh, struct Packet *pktin){    /* Remote side is trying to open a channel to talk to our     * X-Server. Give them back a local channel number. */    struct ssh_channel *c;    int remoteid = ssh_pkt_getuint32(pktin);    logevent("Received X11 connect request");    /* Refuse if X11 forwarding is disabled. */    if (!ssh->X11_fwd_enabled) {	send_packet(ssh, SSH1_MSG_CHANNEL_OPEN_FAILURE,		    PKT_INT, remoteid, PKT_END);	logevent("Rejected X11 connect request");    } else {	c = snew(struct ssh_channel);	c->ssh = ssh;	if (x11_init(&c->u.x11.s, ssh->cfg.x11_display, c,		     ssh->x11auth, NULL, -1, &ssh->cfg) != NULL) {	    logevent("Opening X11 forward connection failed");	    sfree(c);	    send_packet(ssh, SSH1_MSG_CHANNEL_OPEN_FAILURE,			PKT_INT, remoteid, PKT_END);	} else {	    logevent		("Opening X11 forward connection succeeded");	    c->remoteid = remoteid;	    c->localid = alloc_channel_id(ssh);	    c->closes = 0;	    c->v.v1.throttling = 0;	    c->type = CHAN_X11;	/* identify channel type */	    add234(ssh->channels, c);	    send_packet(ssh, SSH1_MSG_CHANNEL_OPEN_CONFIRMATION,			PKT_INT, c->remoteid, PKT_INT,			c->localid, PKT_END);	    logevent("Opened X11 forward channel");	}    }}