]> git.ipfire.org Git - thirdparty/squid.git/commit - src/client_side.cc
Bug #1951: NTLM authentication does not work
authorwessels <>
Wed, 9 May 2007 15:07:38 +0000 (15:07 +0000)
committerwessels <>
Wed, 9 May 2007 15:07:38 +0000 (15:07 +0000)
commit4f0ef8e8d2e9f694437e2c1b12649a759bd7bb26
treec00bede4c8719db6e7cd08012a63ba34bb139d48
parentff3f37226a417ea13ac857c9c5893d9b46ea83d5
Bug #1951: NTLM authentication does not work

Turns out there were a number of reasons why NTLM authentication
didn't work.  Some of these were addressed by patches committed a
few revs earlier.  With this current patch, Squid is now handling
a Web Polygraph workload with NTLM authentication.

The big change here is to locking of AuthUserRequest by the various
other classes that maintain a pointer to it.  The old locking logic
was difficult for me to follow, and it seemed that there were not
enough unlocks, leading to helper processes getting stuck in RESERVED
state.

I copied the ideas from HttpMsg locking and created macros
AUTHUSERREQUESTLOCK and AUTHUSERREQUESTUNLOCK.  I also tried to
make sure that locks and unlocks occur in places where pointers are
assigned.  The most tricky part is with the ACLchecklist class,
which passes a pointer to a pointer.  Previously AuthUserRequest
was doing a lot of locking on behalf of ACLchecklist, but now I
make ACLchecklist do all its own locking and AuthUserRequest really
shouldn't lock its own objects for any other classes.

Another important change was to helperStatefulReleaseServer().  The
old version apparently ignored helper servers in the S_HELPER_RESERVED
states.  It was only concerned about the S_HELPER_DEFERRED state.
Now I think it does the right thing for both states.

This patch also contains numerous cosmetic "style" changes to the
source code and debugging that don't really affect its functionality.
I couldn't resist.
14 files changed:
src/ACLChecklist.cc
src/ACLProxyAuth.cc
src/AuthConfig.cc
src/AuthUserRequest.cc
src/AuthUserRequest.h
src/HttpRequest.cc
src/auth/digest/auth_digest.cc
src/auth/negotiate/auth_negotiate.cc
src/auth/ntlm/auth_ntlm.cc
src/client_side.cc
src/client_side_reply.cc
src/client_side_request.cc
src/errorpage.cc
src/helper.cc