Mercurial > 510Connectbot
comparison src/ch/ethz/ssh2/packets/PacketChannelOpenFailure.java @ 308:42b15aaa7ac7 ganymed
merge
author | Carl Byington <carl@five-ten-sg.com> |
---|---|
date | Wed, 30 Jul 2014 14:21:50 -0700 |
parents | 071eccdff8ea |
children |
comparison
equal
deleted
inserted
replaced
306:90e47d99ea54 | 308:42b15aaa7ac7 |
---|---|
27 payload = tw.getBytes(); | 27 payload = tw.getBytes(); |
28 } | 28 } |
29 | 29 |
30 public PacketChannelOpenFailure(byte payload[]) throws IOException { | 30 public PacketChannelOpenFailure(byte payload[]) throws IOException { |
31 this.payload = payload; | 31 this.payload = payload; |
32 | |
33 TypesReader tr = new TypesReader(payload); | 32 TypesReader tr = new TypesReader(payload); |
34 | |
35 int packet_type = tr.readByte(); | 33 int packet_type = tr.readByte(); |
36 | 34 |
37 if(packet_type != Packets.SSH_MSG_CHANNEL_OPEN_FAILURE) { | 35 if (packet_type != Packets.SSH_MSG_CHANNEL_OPEN_FAILURE) { |
38 throw new IOException( | 36 throw new IOException( |
39 "This is not a SSH_MSG_CHANNEL_OPEN_FAILURE! (" | 37 "This is not a SSH_MSG_CHANNEL_OPEN_FAILURE! (" |
40 + packet_type + ")" | 38 + packet_type + ")" |
41 ); | 39 ); |
42 } | 40 } |
43 | 41 |
44 int recipientChannelID = tr.readUINT32(); | 42 int recipientChannelID = tr.readUINT32(); |
45 int reasonCode = tr.readUINT32(); | 43 int reasonCode = tr.readUINT32(); |
46 String description = tr.readString(); | 44 String description = tr.readString(); |
47 String languageTag = tr.readString(); | 45 String languageTag = tr.readString(); |
48 | 46 |
49 if(tr.remain() != 0) { | 47 if (tr.remain() != 0) { |
50 throw new PacketFormatException(String.format("Padding in %s", Packets.getMessageName(packet_type))); | 48 throw new PacketFormatException(String.format("Padding in %s", Packets.getMessageName(packet_type))); |
51 } | 49 } |
52 } | 50 } |
53 | 51 |
54 public byte[] getPayload() { | 52 public byte[] getPayload() { |