hierynomus / smbj

Server Message Block (SMB2, SMB3) implementation in Java
Other
713 stars 180 forks source link

address issue #604 - stop closing the dfs share connection immediately. #609

Closed nddipiazza closed 3 years ago

nddipiazza commented 3 years ago

Stop closing the IPC$ share every time you connect to it to get a referral.

In my use case where I am crawling a smb2 share, this resulted in 1000's of connections to IPC$ every hour.

Let these connections get cleaned up from the logoff method.

I tested this against a fairly massive distributed share and experienced no connection bloat.

perhaps it would be safer to keep these in a dfs share cache that expires if not used after n time and has a max cap of say 100 of these connections... but in my fairly massive use case it does not matter.

hierynomus commented 3 years ago

Seems like a simple enough fix, though I wonder whether there would occur any problems from keeping the share open. I woould need to test it further.