SFTP connection bug
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Syncany |
New
|
Undecided
|
Unassigned |
Bug Description
Hi,
I found a bug with SFTP connection, the bug is the conection with the storage server never closes, and creates more connections every time.
For example when upload the chunks the conection is already stablished and for each chunk open a conection because in the SftpTransferManager in funtion upload conects with the storage and the application not checks the connection.
@Override
public void upload(File localFile, RemoteFile remoteFile) throws StorageException {
connect();
And the function connects every time creates a new session and not closes the last session:
I solved checking the connection when try to connect with the storage.
@Override
public void connect() throws StorageConnectE
boolean isConnected = false;
if(session != null){
} else{
}
}
}
for (int i=0; i<CONNECT_
try {
}
}
}
if (logger.
}
}
}
In function disconnect sometimes appears the null pointer exception because sftp or session is null.
I solved with this:
@Override
public void disconnect() {
if(sftp != null){
}
if(session != null){
}
}
Regards.