1 2 29 30 package com.jcraft.jsch; 31 32 class RequestX11 extends Request{ 33 public void setCookie(String cookie){ 34 ChannelX11.cookie=cookie.getBytes(); 35 } 36 public void request(Session session, Channel channel) throws Exception { 37 super.request(session, channel); 38 39 Buffer buf=new Buffer(); 40 Packet packet=new Packet(buf); 41 42 packet.reset(); 51 buf.putByte((byte) Session.SSH_MSG_CHANNEL_REQUEST); 52 buf.putInt(channel.getRecipient()); 53 buf.putString("x11-req".getBytes()); 54 buf.putByte((byte)(waitForReply() ? 1 : 0)); 55 buf.putByte((byte)0); 56 buf.putString("MIT-MAGIC-COOKIE-1".getBytes()); 57 buf.putString(ChannelX11.getFakedCookie(session)); 58 buf.putInt(0); 59 write(packet); 60 61 session.x11_forwarding=true; 62 } 63 } 64 | Popular Tags |