[rfc][icedtea-web] PR835: javaws findBestUrl leaks TCP connections

Omair Majid omajid at redhat.com
Thu Feb 7 15:04:50 PST 2013


On 02/07/2013 05:58 PM, Adam Domurad wrote:
> On 02/07/2013 05:10 PM, Omair Majid wrote:
>> On 02/07/2013 04:45 PM, Adam Domurad wrote:
>>> Tiny patch here.
>>>
>>> This issue still exists in head:
>>> http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=835
>>>
>>> The patch in the bug report works, although I have preferred the use of
>>> a finally block (I prefer the stronger guarantee).
>>>
>>> ChangeLog:
>>>
>>> 2013-XX-XX  Adam Domurad  <adomurad at redhat.com>
>>>
>>>      * netx/net/sourceforge/jnlp/cache/ResourceTracker.java
>>>      (findBestUrl): Ensure that connections are not leaked.
>> Looks okay to me.
>>
>> As an improvement, maybe we can avoid closing and return the "best"
>> connection so it can be reused without having to establish another one.
>>
>> Cheers,
>> Omair
>>
> 
> Good idea. Luckily the code was set-up to make this fairly easy.
> 
> Due to rearranging the disconnect is placed slightly different (more
> aligned with the original patch).
> 
> Note that if connection == null, the NPE will get caught. I didn't have
> an idea of a better exception to throw, but I figured this should be
> noted (it had caused me pains before).

Looks great.

Cheers,
Omair

-- 
PGP Key: 66484681 (http://pgp.mit.edu/)
Fingerprint = F072 555B 0A17 3957 4E95  0056 F286 F14F 6648 4681



More information about the distro-pkg-dev mailing list