--------------------- PatchSet 1969 Date: 2005/10/23 09:16:20 Author: serassio Branch: negotiate Tag: (none) Log: Port of keep_alive option to negotiate Members: src/auth/negotiate/auth_negotiate.cc:1.1.2.4->1.1.2.5 src/auth/negotiate/auth_negotiate.h:1.1.2.2->1.1.2.3 Index: squid3/src/auth/negotiate/auth_negotiate.cc =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/auth/negotiate/auth_negotiate.cc,v retrieving revision 1.1.2.4 retrieving revision 1.1.2.5 diff -u -r1.1.2.4 -r1.1.2.5 --- squid3/src/auth/negotiate/auth_negotiate.cc 23 Oct 2005 08:54:21 -0000 1.1.2.4 +++ squid3/src/auth/negotiate/auth_negotiate.cc 23 Oct 2005 09:16:20 -0000 1.1.2.5 @@ -1,6 +1,6 @@ /* - * $Id: auth_negotiate.cc,v 1.1.2.4 2005/10/23 08:54:21 hno Exp $ + * $Id: auth_negotiate.cc,v 1.1.2.5 2005/10/23 09:16:20 serassio Exp $ * * DEBUG: section 29 Negotiate Authenticator * AUTHOR: Robert Collins, Henrik Nordstrom, Francesco Chemolli @@ -124,10 +124,11 @@ storeAppendPrintf(entry, "\n%s negotiate children %d\n", name, authenticateChildren); + storeAppendPrintf(entry, "%s %s keep_alive %d\n", name, "negotiate", keep_alive); } -AuthNegotiateConfig::AuthNegotiateConfig() : authenticateChildren(5) +AuthNegotiateConfig::AuthNegotiateConfig() : authenticateChildren(5), keep_alive(1) { } void @@ -142,6 +143,8 @@ requirePathnameExists("authparam negotiate program", authenticate->key); } else if (strcasecmp(param_str, "children") == 0) { parse_int(&authenticateChildren); + } else if (strcasecmp(param_str, "keep_alive") == 0) { + parse_onoff(&keep_alive); } else { debug(28, 0) ("AuthNegotiateConfig::parse: unrecognised negotiate auth scheme parameter '%s'\n", param_str); } @@ -299,13 +302,11 @@ if (auth_user_request == NULL) { debug(29, 9) ("AuthNegotiateConfig::fixHeader: Sending type:%d header: 'NEGOTIATE'\n", type); httpHeaderPutStrf(&rep->header, type, "NEGOTIATE"); -#if PROBABLY_NOT_NEEDED - /* drop the connection */ - httpHeaderDelByName(&rep->header, "keep-alive"); - /* Negotiate has problems if the initial connection is not dropped - * I haven't checked the RFC compliance of this hack - RBCollins */ - request->flags.proxy_keepalive = 0; -#endif /* PROBABLY_NOT_NEEDED */ + if (!keep_alive) { + /* drop the connection */ + httpHeaderDelByName(&rep->header, "keep-alive"); + request->flags.proxy_keepalive = 0; + } } else { negotiate_request = dynamic_cast(auth_user_request); Index: squid3/src/auth/negotiate/auth_negotiate.h =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/auth/negotiate/auth_negotiate.h,v retrieving revision 1.1.2.2 retrieving revision 1.1.2.3 diff -u -r1.1.2.2 -r1.1.2.3 --- squid3/src/auth/negotiate/auth_negotiate.h 23 Oct 2005 08:48:50 -0000 1.1.2.2 +++ squid3/src/auth/negotiate/auth_negotiate.h 23 Oct 2005 09:16:20 -0000 1.1.2.3 @@ -109,6 +109,7 @@ virtual void parse(AuthConfig *, int, char *); virtual const char * type() const; int authenticateChildren; + int keep_alive; wordlist *authenticate; };