classpath-inetlib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Classpath-inetlib] Query about slow HTTP HEAD requests


From: Kevin Rogers
Subject: [Classpath-inetlib] Query about slow HTTP HEAD requests
Date: Mon, 20 Jun 2005 13:40:53 +0100

Hi,

I'm slowly developing a virtual file system library in Java for
MillScript(http://www.millscript.org) and have recently switched over
to release 1.1 of inetlib. In general I've had a good experience of
the conversion except for one issue regarding HTTP HEAD requests.

I'm trying to implement support for the HTTP protocol within the VFS,
but in order to achieve this I have to determine if a resource is
available and if it represents a file or directory. I chose to do this
by issuing HEAD requests to avoid retrieving any body content
unnecessarily.

On switching to inetlib I saw a significant increase in the time taken
to run my basic VFS test suite for the HTTP protocol. The test issues
around 9 HEAD requests and it now takes 135 seconds to complete, where
it previously would have taken 10 or less seconds.

I've had a quick look through the code and think the problem lies in
the readResponseBody method of the Request class. It looks like the
method is trying to read and body content, even for the HEAD request.
As a result it appears the HEAD requests from my VFS are waiting for
the read to timeout each time.

I was wondering if anyone else has seen this kind of problem or could
suggest a suitable fix/workaround? I haven't tried to provide a patch
for this as I wasn't certain what the best approach would be. If you'd
like me to provide some example code or a test case, let me know.

Thanks,
Kevin




reply via email to

[Prev in Thread] Current Thread [Next in Thread]