[jcifs] Thread Leak part deux
David McReynolds
david.mcreynolds at gmail.com
Tue Apr 6 09:33:11 MDT 2010
Comments embedded below.
On Mon, Apr 5, 2010 at 9:34 PM, Michael B Allen <ioplex at gmail.com> wrote:
> On Thu, Apr 1, 2010 at 2:13 PM, David McReynolds
> <david.mcreynolds at gmail.com> wrote:
>> What is this supposed to do?
>>
>> if (false && NETBIOS_HOSTNAME != null &&
>> NETBIOS_HOSTNAME.equals( "" ) == false) {
>> port = 139;
>> }
>
> You seem to have missed the comment above the:
>
> /* If jcifs.netbios.hostname is set this *probably* means there
> * is a policy regarding which hosts a user can connect from. This
> * requires communicating over port 139 rather than 445.
> */
> if (false && NETBIOS_HOSTNAME != null && NETBIOS_HOSTNAME.equals( ""
> ) == false) {
> port = 139;
> }
>
Where, in the above comment, does it state that the code below, is
dead? So, no, it wasn't missed. It failed to mention that the code was
intentionally dead.
<snip> mindless justification of idiotic programming practice removed </snip>
> codebase is 10 years old). I just removed it. Thanks for the feedback.
>
Great, We've forked your code.
<snip> restatement of orginal 9 month old problem </snip>
>
> Again, so far you have not demonstrated that there is anything to be
> "fixed". I'm not stating that there isn't a bug behind the behavior
> that you're seeing. You just haven't shown me what it is.
>
> I believe your last message claimed that BCAST was required for your
> application to function? That NetBIOS behavior is only emitted by
> pre-Windows 2000 systems. So if your application depends on it, I
> would suggest you find another solution to whatever it is that you're
> doing.
>
Again, we've forked and fixed. Thanks.
>>> Aslo, unfortunately this is the sort of thing
>>> that could take a really long time to make it into the code since I
>>> don't really work on JCIFS for free or Free anymore.
But apparently, your still an asshole for free.
> Mike
>
>>
>> From July 2009
>>> Ok, this looks like something worth fixing. I think using the 1.4
>>> timeout looks like the right track but I haven't really looked at the
>>> problem so I don't know. Aslo, unfortunately this is the sort of thing
>>> that could take a really long time to make it into the code since I
>>> don't really work on JCIFS for free or Free anymore. But I've added
>>> this to the TODO.
>>>
>>> Thanks for the report.
>>>
>>> Mike
>>
>> The fix, 9 months later.
>> InetAddress addr =
>> InetAddress.getByName(address.getHostAddress());
>> if(!addr.isReachable(SO_TIMEOUT)) {
>> throw new IOException("host unreachable");
>> }
>>
>> and if you want to be thorough.
>>
>> if (port == 139) {
>> ssn139();
>> } else {
>> if (port == 0) {
>> port = DEFAULT_PORT; // 445
>> }
>>
>> InetAddress addr =
>> InetAddress.getByName(address.getHostAddress()); //fix
>> if(!addr.isReachable(SO_TIMEOUT)) {
>> //fix
>> throw new IOException("host unreachable");
>> //fix
>> }
>> //fix
>>
>> if (localAddr == null) {
>> InetSocketAddress remoteAddr = new
>> InetSocketAddress(addr, port);//fix
>> socket = new Socket();
>> //fix
>> socket.connect(remoteAddr, SO_TIMEOUT);
>> //fix
>> } else {
>> socket = new Socket();
>> //fix
>> InetSocketAddress remoteAddr = new
>> InetSocketAddress(addr, port); //fix
>> InetSocketAddress localAdd = new
>> InetSocketAddress(localAddr,localPort);//fix
>> socket.bind(localAdd);
>> //fix
>> socket.connect(remoteAddr,SO_TIMEOUT);
>> //fix
>> }
>>
>> socket.setSoTimeout( SO_TIMEOUT );
>> out = socket.getOutputStream();
>> in = socket.getInputStream();
>> }
>>
>> --
>> dlm
>>
>
>
>
> --
> Michael B Allen
> Java Active Directory Integration
> http://www.ioplex.com/
>
--
--
dlm
More information about the jCIFS
mailing list