hierynomus / sshj

ssh, scp and sftp for java
Apache License 2.0
2.49k stars 602 forks source link

Close Session when closing SCPEngine or SFTPEngine #926

Closed evigeant closed 5 months ago

evigeant commented 8 months ago

This PR fixes an issue where the SessionChannel created for an SCP or SFTP command was not closed explicitely. As such, doing many transfers in a connection would accumulate open channels and this can cause issues if the number of open channels is limited by the server.

codecov-commenter commented 5 months ago

Codecov Report

Attention: Patch coverage is 85.71429% with 1 lines in your changes are missing coverage. Please review.

Project coverage is 69.06%. Comparing base (03f8b22) to head (699f6b1). Report is 4 commits behind head on master.

:exclamation: Current head 699f6b1 differs from pull request most recent head 90df54c. Consider uploading reports for the commit 90df54c to get more accurate results

Files Patch % Lines
...main/java/net/schmizz/sshj/xfer/scp/SCPEngine.java 80.00% 0 Missing and 1 partial :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #926 +/- ## ============================================ + Coverage 68.96% 69.06% +0.09% + Complexity 1448 1446 -2 ============================================ Files 208 208 Lines 7602 7607 +5 Branches 658 659 +1 ============================================ + Hits 5243 5254 +11 + Misses 2009 2002 -7 - Partials 350 351 +1 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.