--------------------- PatchSet 892 Date: 2000/12/05 07:32:59 Author: rbcollins Branch: auth_rewrite Tag: (none) Log: incorrect test in StatefulSubmit + a test for NULL in auth_NTLM.c Members: src/helper.c:1.1.1.3.12.13.2.2->1.1.1.3.12.13.2.3 src/auth/ntlm/auth_ntlm.c:1.1.2.10->1.1.2.11 Index: squid/src/helper.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/helper.c,v retrieving revision 1.1.1.3.12.13.2.2 retrieving revision 1.1.1.3.12.13.2.3 diff -u -r1.1.1.3.12.13.2.2 -r1.1.1.3.12.13.2.3 --- squid/src/helper.c 4 Dec 2000 12:22:11 -0000 1.1.1.3.12.13.2.2 +++ squid/src/helper.c 5 Dec 2000 07:32:59 -0000 1.1.1.3.12.13.2.3 @@ -1,6 +1,6 @@ /* - * $Id: helper.c,v 1.1.1.3.12.13.2.2 2000/12/04 12:22:11 rbcollins Exp $ + * $Id: helper.c,v 1.1.1.3.12.13.2.3 2000/12/05 07:32:59 rbcollins Exp $ * * DEBUG: section 29 Helper process maintenance * AUTHOR: Harvest Derived? @@ -255,7 +255,7 @@ debug(29,5)("StatefulSubmit with lastserver %d\n",lastserver); if (lastserver->flags.reserved!=S_HELPER_RESERVED) lastserver->deferred_requests--; - if (!(lastserver->queue.head)) { + if (!(lastserver->request)) { debug(29,5)("StatefulSubmit dispatching\n"); helperStatefulDispatch(lastserver, r); } else { @@ -286,7 +286,10 @@ } debug(29,5)("helperStatefulDefer: Running servers %d.\n",hlp->n_running); if (hlp->n_running == 0) + { + debug(29,1)("helperStatefulDefer: No running servers!. \n"); return NULL; + } srv = StatefulGetFirstAvailable(hlp); /* all currently busy:loop through servers and find server with the shortest queue */ @@ -309,7 +312,7 @@ } if (rv == NULL) { - debug(29,5)("helperStatefulDefer: None available.\n"); + debug(29,1)("helperStatefulDefer: None available.\n"); return NULL; } Index: squid/src/auth/ntlm/auth_ntlm.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/auth/ntlm/auth_ntlm.c,v retrieving revision 1.1.2.10 retrieving revision 1.1.2.11 diff -u -r1.1.2.10 -r1.1.2.11 --- squid/src/auth/ntlm/auth_ntlm.c 4 Dec 2000 20:40:06 -0000 1.1.2.10 +++ squid/src/auth/ntlm/auth_ntlm.c 5 Dec 2000 07:33:00 -0000 1.1.2.11 @@ -483,7 +483,7 @@ * 3: tell it to get a challenge, or give ntlmauthdone the challenge */ server=helperStatefulDefer(ntlmauthenticators); - helperstate=helperStatefulServerGetData(server); + helperstate=server ? helperStatefulServerGetData(server): NULL ; while ((server !=NULL) && authenticateNTLMChangeChallenge(helperstate)) { @@ -494,13 +494,13 @@ server=helperStatefulDefer(ntlmauthenticators); helperstate=helperStatefulServerGetData(server); } - if (server==NULL) fatal("unable to get a deferred ntlm helper... this shouldn't happen.\n"); + if (server==NULL) debug(29,4) ("unable to get a deferred ntlm helper... all helpers are refreshing challenges. Queuing as a YR request.\n"); auth_user->auth_data.ntlm_auth.authhelper=server; /* tell the log what helper we have been given */ debug(29,5)("authenticateNTLMStart: helper '%d' assigned\n",server); /* valid challenge? */ - if(!authenticateNTLMValidChallenge(helperstate)) + if((server == NULL) || !authenticateNTLMValidChallenge(helperstate)) { r = xcalloc(1, sizeof(authenticateStateData)); cbdataAdd(r, cbdataXfree, 0);