mirror of
https://github.com/hierynomus/sshj.git
synced 2025-12-07 07:40:55 +03:00
minor
This commit is contained in:
@@ -48,10 +48,6 @@ public abstract class AbstractService
|
|||||||
return name;
|
return name;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getTimeout() {
|
|
||||||
return this.timeout;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void handle(Message msg, SSHPacket buf)
|
public void handle(Message msg, SSHPacket buf)
|
||||||
throws SSHException {
|
throws SSHException {
|
||||||
trans.sendUnimplemented();
|
trans.sendUnimplemented();
|
||||||
@@ -66,6 +62,11 @@ public abstract class AbstractService
|
|||||||
throw new SSHException(DisconnectReason.PROTOCOL_ERROR, "Unexpected: SSH_MSG_UNIMPLEMENTED");
|
throw new SSHException(DisconnectReason.PROTOCOL_ERROR, "Unexpected: SSH_MSG_UNIMPLEMENTED");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void notifyDisconnect()
|
||||||
|
throws SSHException {
|
||||||
|
log.debug("Was notified of disconnect");
|
||||||
|
}
|
||||||
|
|
||||||
public void request()
|
public void request()
|
||||||
throws TransportException {
|
throws TransportException {
|
||||||
final Service active = trans.getService();
|
final Service active = trans.getService();
|
||||||
@@ -76,13 +77,12 @@ public abstract class AbstractService
|
|||||||
trans.reqService(this);
|
trans.reqService(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public int getTimeout() {
|
||||||
|
return this.timeout;
|
||||||
|
}
|
||||||
|
|
||||||
public void setTimeout(int timeout) {
|
public void setTimeout(int timeout) {
|
||||||
this.timeout = timeout;
|
this.timeout = timeout;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void notifyDisconnect()
|
|
||||||
throws SSHException {
|
|
||||||
log.debug("Was notified of disconnect");
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -142,4 +142,5 @@ public interface Config {
|
|||||||
* @param version software version info
|
* @param version software version info
|
||||||
*/
|
*/
|
||||||
void setVersion(String version);
|
void setVersion(String version);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -63,19 +63,19 @@ public enum Message {
|
|||||||
|
|
||||||
private final byte b;
|
private final byte b;
|
||||||
|
|
||||||
private static final Message[] commands = new Message[256];
|
private static final Message[] cache = new Message[256];
|
||||||
|
|
||||||
static {
|
static {
|
||||||
for (Message c : Message.values())
|
for (Message c : Message.values())
|
||||||
if (commands[c.toByte()] == null)
|
if (cache[c.toByte()] == null)
|
||||||
commands[c.toByte()] = c;
|
cache[c.toByte()] = c;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Message fromByte(byte b) {
|
public static Message fromByte(byte b) {
|
||||||
return commands[b];
|
return cache[b];
|
||||||
}
|
}
|
||||||
|
|
||||||
Message(int b) {
|
private Message(int b) {
|
||||||
this.b = (byte) b;
|
this.b = (byte) b;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -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
|
* Set the maximum packet size for the local window this connection recommends to any {@link Channel}'s that ask for
|
||||||
* it.
|
* it.
|
||||||
|
*
|
||||||
|
* @param maxPacketSize maximum packet size in bytes
|
||||||
*/
|
*/
|
||||||
void setMaxPacketSize(int maxPacketSize);
|
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();
|
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);
|
void setWindowSize(int windowSize);
|
||||||
|
|
||||||
/** @return the associated {@link Transport}. */
|
/** @return the associated {@link Transport}. */
|
||||||
|
|||||||
@@ -134,7 +134,6 @@ class Proposal {
|
|||||||
|
|
||||||
public SSHPacket getPacket() {
|
public SSHPacket getPacket() {
|
||||||
return new SSHPacket(packet);
|
return new SSHPacket(packet);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public NegotiatedAlgorithms negotiate(Proposal other)
|
public NegotiatedAlgorithms negotiate(Proposal other)
|
||||||
|
|||||||
Reference in New Issue
Block a user