Mercurial > 510Connectbot
comparison src/ch/ethz/ssh2/packets/PacketServiceRequest.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 |
---|---|
30 return serviceName; | 30 return serviceName; |
31 } | 31 } |
32 | 32 |
33 public PacketServiceRequest(byte payload[]) throws IOException { | 33 public PacketServiceRequest(byte payload[]) throws IOException { |
34 this.payload = payload; | 34 this.payload = payload; |
35 | |
36 TypesReader tr = new TypesReader(payload); | 35 TypesReader tr = new TypesReader(payload); |
37 | |
38 int packet_type = tr.readByte(); | 36 int packet_type = tr.readByte(); |
39 | 37 |
40 if(packet_type != Packets.SSH_MSG_SERVICE_REQUEST) { | 38 if (packet_type != Packets.SSH_MSG_SERVICE_REQUEST) { |
41 throw new PacketTypeException(packet_type); | 39 throw new PacketTypeException(packet_type); |
42 } | 40 } |
43 | 41 |
44 serviceName = tr.readString(); | 42 serviceName = tr.readString(); |
45 | 43 |
46 if(tr.remain() != 0) { | 44 if (tr.remain() != 0) { |
47 throw new PacketFormatException(String.format("Padding in %s", Packets.getMessageName(packet_type))); | 45 throw new PacketFormatException(String.format("Padding in %s", Packets.getMessageName(packet_type))); |
48 } | 46 } |
49 } | 47 } |
50 | 48 |
51 public byte[] getPayload() { | 49 public byte[] getPayload() { |