Skip to content

Commit

Permalink
Merge branch 'main' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
dcommander committed Jan 8, 2025
2 parents bd1393f + 36ddf41 commit 6606c7e
Show file tree
Hide file tree
Showing 163 changed files with 2,140 additions and 2,142 deletions.
16 changes: 8 additions & 8 deletions java/com/jcraft/jsch/Buffer.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
1. Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in
the documentation and/or other materials provided with the distribution.
3. The names of the authors may not be used to endorse or promote products
Expand Down Expand Up @@ -145,7 +145,7 @@ public void getByte(byte[] foo) {
getByte(foo, 0, foo.length);
}
void getByte(byte[] foo, int start, int len) {
System.arraycopy(buffer, s, foo, start, len);
System.arraycopy(buffer, s, foo, start, len);
s+=len;
}
public int getByte(int len) {
Expand Down Expand Up @@ -271,15 +271,15 @@ static void dump_buffer(){
int foo;
for(int i=0; i<tmp_buffer_index; i++){
foo=tmp_buffer[i]&0xff;
System.err.print(chars[(foo>>>4)&0xf]);
System.err.print(chars[foo&0xf]);
System.err.print(chars[(foo>>>4)&0xf]);
System.err.print(chars[foo&0xf]);
if(i%16==15){
System.err.println("");
continue;
}
continue;
}
if(i>0 && i%2==1){
System.err.print(" ");
}
}
}
System.err.println("");
}
Expand Down
314 changes: 157 additions & 157 deletions java/com/jcraft/jsch/ChangeLog

Large diffs are not rendered by default.

46 changes: 23 additions & 23 deletions java/com/jcraft/jsch/Channel.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
1. Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in
the documentation and/or other materials provided with the distribution.
3. The names of the authors may not be used to endorse or promote products
Expand Down Expand Up @@ -47,7 +47,7 @@ public abstract class Channel implements Runnable{
static final int SSH_OPEN_UNKNOWN_CHANNEL_TYPE= 3;
static final int SSH_OPEN_RESOURCE_SHORTAGE= 4;

static int index=0;
static int index=0;
private static java.util.Vector pool=new java.util.Vector();
static Channel getChannel(String type){
if(type.equals("session")){
Expand Down Expand Up @@ -104,7 +104,7 @@ static void del(Channel c){
volatile long rwsize=0; // remote initial window size
volatile int rmpsize=0; // remote maximum packet size

IO io=null;
IO io=null;
Thread thread=null;

volatile boolean eof_local=false;
Expand All @@ -116,12 +116,12 @@ static void del(Channel c){

volatile int exitstatus=-1;

volatile int reply=0;
volatile int reply=0;
volatile int connectTimeout=0;

private Session session;

int notifyme=0;
int notifyme=0;

Channel(){
synchronized(pool){
Expand Down Expand Up @@ -154,7 +154,7 @@ public void connect(int connectTimeout) throws JSchException{
catch(Exception e){
connected=false;
disconnect();
if(e instanceof JSchException)
if(e instanceof JSchException)
throw (JSchException)e;
throw new JSchException(e.toString(), e);
}
Expand Down Expand Up @@ -372,7 +372,7 @@ else if(in < out){
else size = out - in;
}
return size;
}
}
synchronized void checkSpace(int len) throws IOException {
int size = freeSpace();
if(size<len){
Expand All @@ -396,7 +396,7 @@ else if(in < out){
}
else {
System.arraycopy(buffer, 0, tmp, 0, in);
System.arraycopy(buffer, out,
System.arraycopy(buffer, out,
tmp, tmp.length-(buffer.length-out),
(buffer.length-out));
out = tmp.length-(buffer.length-out);
Expand All @@ -408,7 +408,7 @@ else if(in == out){
}
buffer=tmp;
}
else if(buffer.length == size && size > BUFFER_SIZE) {
else if(buffer.length == size && size > BUFFER_SIZE) {
int i = size/2;
if(i<BUFFER_SIZE) i = BUFFER_SIZE;
byte[] tmp = new byte[i];
Expand All @@ -420,8 +420,8 @@ else if(buffer.length == size && size > BUFFER_SIZE) {
void setLocalWindowSize(int foo){ this.lwsize=foo; }
void setLocalPacketSize(int foo){ this.lmpsize=foo; }
synchronized void setRemoteWindowSize(long foo){ this.rwsize=foo; }
synchronized void addRemoteWindowSize(long foo){
this.rwsize+=foo;
synchronized void addRemoteWindowSize(long foo){
this.rwsize+=foo;
if(notifyme>0)
notifyAll();
}
Expand Down Expand Up @@ -546,15 +546,15 @@ static void disconnect(Session session){
synchronized(pool){
channels=new Channel[pool.size()];
for(int i=0; i<pool.size(); i++){
try{
Channel c=((Channel)(pool.elementAt(i)));
if(c.session==session){
channels[count++]=c;
}
}
catch(Exception e){
}
}
try{
Channel c=((Channel)(pool.elementAt(i)));
if(c.session==session){
channels[count++]=c;
}
}
catch(Exception e){
}
}
}
for(int i=0; i<count; i++){
channels[i].disconnect();
Expand Down Expand Up @@ -657,7 +657,7 @@ public void write(byte[] b, int off, int len) throws IOException {
if(_sink != null) {
_sink.checkSpace(len);
}
super.write(b, off, len);
super.write(b, off, len);
}
}

Expand All @@ -668,7 +668,7 @@ void setSession(Session session){
this.session=session;
}

public Session getSession() throws JSchException{
public Session getSession() throws JSchException{
Session _session=session;
if(_session==null){
throw new JSchException("session is not available");
Expand Down
8 changes: 4 additions & 4 deletions java/com/jcraft/jsch/ChannelAgentForwarding.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
1. Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in
the documentation and/or other materials provided with the distribution.
3. The names of the authors may not be used to endorse or promote products
Expand Down Expand Up @@ -43,7 +43,7 @@ class ChannelAgentForwarding extends Channel{
private final byte SSH_AGENT_RSA_RESPONSE = 4;
private final byte SSH_AGENT_FAILURE = 5;
private final byte SSH_AGENT_SUCCESS = 6;
private final byte SSH_AGENTC_ADD_RSA_IDENTITY = 7;
private final byte SSH_AGENTC_ADD_RSA_IDENTITY = 7;
private final byte SSH_AGENTC_REMOVE_RSA_IDENTITY = 8;
private final byte SSH_AGENTC_REMOVE_ALL_RSA_IDENTITIES = 9;

Expand Down Expand Up @@ -126,7 +126,7 @@ void write(byte[] foo, int s, int l) throws java.io.IOException {

mbuf.reset();

if(typ==SSH2_AGENTC_REQUEST_IDENTITIES){
if(typ==SSH2_AGENTC_REQUEST_IDENTITIES){
mbuf.putByte(SSH2_AGENT_IDENTITIES_ANSWER);
Vector identities = irepo.getIdentities();
synchronized(identities){
Expand Down
12 changes: 6 additions & 6 deletions java/com/jcraft/jsch/ChannelDirectTCPIP.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
1. Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in
the documentation and/or other materials provided with the distribution.
3. The names of the authors may not be used to endorse or promote products
Expand Down Expand Up @@ -95,11 +95,11 @@ public void run(){
int i=0;

while(isConnected() &&
thread!=null &&
io!=null &&
thread!=null &&
io!=null &&
io.in!=null){
i=io.in.read(buf.buffer,
14,
i=io.in.read(buf.buffer,
14,
buf.buffer.length-14
-Session.buffer_margin
);
Expand Down
8 changes: 4 additions & 4 deletions java/com/jcraft/jsch/ChannelExec.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
1. Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in
the documentation and/or other materials provided with the distribution.
3. The names of the authors may not be used to endorse or promote products
Expand Down Expand Up @@ -59,10 +59,10 @@ public void start() throws JSchException{
}
}

public void setCommand(String command){
public void setCommand(String command){
this.command=Util.str2byte(command);
}
public void setCommand(byte[] command){
public void setCommand(byte[] command){
this.command=command;
}

Expand Down
24 changes: 12 additions & 12 deletions java/com/jcraft/jsch/ChannelForwardedTCPIP.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
1. Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in
the documentation and/or other materials provided with the distribution.
3. The names of the authors may not be used to endorse or promote products
Expand Down Expand Up @@ -58,7 +58,7 @@ public class ChannelForwardedTCPIP extends Channel{
}

public void run(){
try{
try{
if(config instanceof ConfigDaemon){
ConfigDaemon _config = (ConfigDaemon)config;
Class c=Class.forName(_config.target);
Expand All @@ -75,8 +75,8 @@ public void run(){
}
else{
ConfigLHost _config = (ConfigLHost)config;
socket=(_config.factory==null) ?
Util.createSocket(_config.target, _config.lport, TIMEOUT) :
socket=(_config.factory==null) ?
Util.createSocket(_config.target, _config.lport, TIMEOUT) :
_config.factory.createSocket(_config.target, _config.lport);
socket.setTcpNoDelay(true);
io.setInputStream(socket.getInputStream());
Expand All @@ -88,7 +88,7 @@ public void run(){
sendOpenFailure(SSH_OPEN_ADMINISTRATIVELY_PROHIBITED);
close=true;
disconnect();
return;
return;
}

thread=Thread.currentThread();
Expand All @@ -97,11 +97,11 @@ public void run(){
int i=0;
try{
Session _session = getSession();
while(thread!=null &&
io!=null &&
while(thread!=null &&
io!=null &&
io.in!=null){
i=io.in.read(buf.buffer,
14,
i=io.in.read(buf.buffer,
14,
buf.buffer.length-14
-Session.buffer_margin
);
Expand Down Expand Up @@ -159,7 +159,7 @@ void getData(Buffer buf){

if(this.config == null){
if(JSch.getLogger().isEnabled(Logger.ERROR)){
JSch.getLogger().log(Logger.ERROR,
JSch.getLogger().log(Logger.ERROR,
"ChannelForwardedTCPIP: "+Util.byte2str(addr)+":"+port+" is not registered.");
}
}
Expand Down Expand Up @@ -264,7 +264,7 @@ static void delPort(Session session, String address_to_bind, int rport){
pool.removeElement(foo);
if(address_to_bind==null){
address_to_bind=foo.address_to_bind;
}
}
if(address_to_bind==null){
address_to_bind="0.0.0.0";
}
Expand Down
Loading

0 comments on commit 6606c7e

Please sign in to comment.