This commit is contained in:
Shikhar Bhushan
2010-03-06 19:34:06 +01:00
parent df3387d26a
commit c8ec30db0e
5 changed files with 23 additions and 17 deletions

View File

@@ -48,10 +48,6 @@ public abstract class AbstractService
return name;
}
public int getTimeout() {
return this.timeout;
}
public void handle(Message msg, SSHPacket buf)
throws SSHException {
trans.sendUnimplemented();
@@ -66,6 +62,11 @@ public abstract class AbstractService
throw new SSHException(DisconnectReason.PROTOCOL_ERROR, "Unexpected: SSH_MSG_UNIMPLEMENTED");
}
public void notifyDisconnect()
throws SSHException {
log.debug("Was notified of disconnect");
}
public void request()
throws TransportException {
final Service active = trans.getService();
@@ -76,13 +77,12 @@ public abstract class AbstractService
trans.reqService(this);
}
public int getTimeout() {
return this.timeout;
}
public void setTimeout(int timeout) {
this.timeout = timeout;
}
public void notifyDisconnect()
throws SSHException {
log.debug("Was notified of disconnect");
}
}

View File

@@ -142,4 +142,5 @@ public interface Config {
* @param version software version info
*/
void setVersion(String version);
}

View File

@@ -63,19 +63,19 @@ public enum Message {
private final byte b;
private static final Message[] commands = new Message[256];
private static final Message[] cache = new Message[256];
static {
for (Message c : Message.values())
if (commands[c.toByte()] == null)
commands[c.toByte()] = c;
if (cache[c.toByte()] == null)
cache[c.toByte()] = c;
}
public static Message fromByte(byte b) {
return commands[b];
return cache[b];
}
Message(int b) {
private Message(int b) {
this.b = (byte) b;
}

View File

@@ -119,13 +119,19 @@ public interface Connection {
/**
* Set the maximum packet size for the local window this connection recommends to any {@link Channel}'s that ask for
* it.
*
* @param maxPacketSize maximum packet size in bytes
*/
void setMaxPacketSize(int maxPacketSize);
/** Get the size for the local window this connection recommends to any {@link Channel}'s that ask for it. */
/** @return the size for the local window this connection recommends to any {@link Channel}'s that ask for it. */
int getWindowSize();
/** Set the size for the local window this connection recommends to any {@link Channel}'s that ask for it. */
/**
* Set the size for the local window this connection recommends to any {@link Channel}'s that ask for it.
*
* @param windowSize window size in bytes
*/
void setWindowSize(int windowSize);
/** @return the associated {@link Transport}. */

View File

@@ -134,7 +134,6 @@ class Proposal {
public SSHPacket getPacket() {
return new SSHPacket(packet);
}
public NegotiatedAlgorithms negotiate(Proposal other)