[jcifs] NTLM HTTP client stuff

eglass1 at attbi.com eglass1 at attbi.com
Wed May 28 20:44:47 EST 2003


> The examples/NtlmHttpClient.java example works with the latest
> NtlmHttpURLConnection but it hangs for 30 seconds on line 442 with your
> experimental standalone davenport setup. I upgraded to 1.3.1_08 but same
> problem. With resin it hangs for 60 seconds and still doesn't read the page. Am 
> I
> doing something wrong?
> 
> Mike
> 

Doh!  This is a simple one -- NtlmHttpURLConnection.java, line 439:

if (errorStream != null) {

should be:

if (errorStream != null && errorStream.available() != 0) {

What is happening is that we (both Davenport and the filter, since we both use
NtlmSsp) send an empty body with the Type 2 message.  The client tries to read
the empty error stream, and blocks on IO.  This works against IIS, which sends
an error body with the reply (which is what I was testing against, since most
of my early problems were with IIS).  Checking for 0 available will ensure that
it only attempts to read if there are content-length bytes available
(available > 0) or chunked content available (available == -1).

Is it too late to re-release 0.7.7...?  I also didn't realize you were moving
NtlmSsp itself into jcifs.ntlmssp; that will require some rework from folks
using it (such as Davenport), since it's part of the public API.  Since it
technically represents the HTTP binding for NTLMSSP, I could see it belonging
in either package.  I will do a release of Davenport with the new location,
if required.

Eric



More information about the jcifs mailing list