---------------------
PatchSet 1234 
Date: 2001/01/10 00:59:59
Author: rbcollins
Branch: auth_rewrite
Tag: (none) 
Log:
code cleanup

Members: 
	src/auth/basic/auth_basic.c:1.1.2.24->1.1.2.25 

Index: squid/src/auth/basic/auth_basic.c
===================================================================
RCS file: /cvsroot/squid-sf//squid/src/auth/basic/auth_basic.c,v
retrieving revision 1.1.2.24
retrieving revision 1.1.2.25
diff -u -r1.1.2.24 -r1.1.2.25
--- squid/src/auth/basic/auth_basic.c	9 Jan 2001 12:36:00 -0000	1.1.2.24
+++ squid/src/auth/basic/auth_basic.c	10 Jan 2001 00:59:59 -0000	1.1.2.25
@@ -82,7 +82,6 @@
 void
 authBasicDone(void)
 {
-//    memPoolDestroy(ufs_state_pool);
     if (basicauthenticators)
 	helperShutdown(basicauthenticators);
     authbasic_initialised = 0;
@@ -124,12 +123,6 @@
 int
 authenticateBasicActive()
 {
-#if 0
-    if (authbasic_initialised)
-	return 1;
-    else
-	return 0;
-#endif
     if ((basicConfig != NULL) && (basicConfig->authenticate != NULL) &&
 	(basicConfig->authenticateChildren != 0) && (basicConfig->basicAuthRealm != NULL))
 	return 1;
@@ -157,13 +150,13 @@
 static void
 authenticateBasicAuthenticateUser(auth_user_request_t * auth_user_request, request_t * request, ConnStateData * conn, http_hdr_type type)
 {
-#if 0
+#if GLOBALPROXY_CACHE 
     auth_user_hash_pointer *usernamehash, *proxy_auth_hash = NULL;
 #endif
     auth_user_t *auth_user;
     basic_data *basic_auth;
-#if 0
-//, *temp_auth;
+#if GLOBALPROXY_CACHE
+    basic_data *temp_auth;
     const char *proxy_auth;
 #endif
 
@@ -182,53 +175,12 @@
 	debug(29, 4) ("authBasicAuthenticate: credentials expired - rechecking\n");
 	return;
     }
-#if 0
-    /*    get the header. */
-    proxy_auth = httpHeaderGetStr(&request->header, type);
-#endif
 
     /* we have been through the external helper, and the credentials haven't expired */
     debug(29, 9) ("authenticateBasicAuthenticateuser: user '%s' authenticated\n",
 	basic_auth->username);
 
     /* Decode now takes care of finding the auth_user struct in the cache */
-#if 0
-    /* see if this is an existing user with a different proxy_auth string */
-    if ((usernamehash = hash_lookup(proxy_auth_username_cache,
-		basic_auth->username))) {
-	while ((usernamehash->auth_user->auth_type != auth_user->auth_type) &&
-	    (usernamehash->next) &&
-	    !authenticateBasiccmpUsername(usernamehash->auth_user->scheme_data, basic_auth))
-	    usernamehash = usernamehash->next;
-	if (usernamehash->auth_user->auth_type == auth_user->auth_type) {
-	    /*
-	     * add another link from the new proxy_auth to the
-	     * auth_user structure and update the information */
-	    assert(proxy_auth_hash == NULL);
-	    authenticateProxyAuthCacheAddLink(proxy_auth, usernamehash->auth_user);
-	    /* maybe the p/w changed. update in the old structure */
-	    temp_auth = usernamehash->auth_user->scheme_data;
-	    xfree(temp_auth->passwd);
-	    temp_auth->passwd = basic_auth->passwd;
-	    basic_auth->passwd = NULL;
-	    /* and remove the temporary structure */
-	    authenticateAuthUserUnlock(auth_user);
-#if 0
-	    authenticateFreeProxyAuthUser(auth_user);
-#endif
-	    auth_user = usernamehash->auth_user;
-	    /* and reference the existing basic data structure */
-	    basic_auth = auth_user->scheme_data;
-	    /* lock the structure for this request */
-	    authenticateAuthUserLock(auth_user);
-	}
-    } else {
-	/* store user in hash's */
-	authenticateUserNameCacheAdd(auth_user);
-	authenticateProxyAuthCacheAddLink(proxy_auth, auth_user);
-    }
-    /* auth_user is now linked, we reset these values */
-#endif
     /* after external auth occurs anyway */
     auth_user->expiretime = current_time.tv_sec;
     auth_user->ip_expiretime = squid_curtime;
@@ -332,10 +284,6 @@
 	xfree(node);
 	node = tmpnode;
     }
-#if 0
-    if (valid)
-	r->handler(r->data, reply);
-#endif
     authenticateStateFree(r);
 }
 
@@ -516,14 +464,7 @@
 	    authenticateAuthUserLock(auth_user);
 	    node = dlinkNodeNew();
 	    dlinkAdd(auth_user_request, node, &auth_user->requests);
-#if 0
-	    xfree(local_basic.username);
-#endif
 	}
-#if 0
-	memPoolFree(basic_data_pool, basic_auth);
-	auth_user->scheme_data = NULL;
-#endif
 	return;
     } else {
 	local_basic.passwd = xstrndup(cleartext, USER_IDENT_SZ);
