diff -ur squid-ntlm-orig/ntlm_auth_modules/NTLMSSP/libntlmssp.c squid-ntlm/ntlm_auth_modules/NTLMSSP/libntlmssp.c --- squid-ntlm-orig/ntlm_auth_modules/NTLMSSP/libntlmssp.c Thu Oct 19 18:42:45 2000 +++ squid-ntlm/ntlm_auth_modules/NTLMSSP/libntlmssp.c Thu Oct 19 18:59:11 2000 @@ -24,6 +24,9 @@ #if HAVE_STDLIB_H #include #endif /* HAVE_STDLIB_H */ +#ifdef HAVE_UNISTD_H +#include +#endif #include "smblib-priv.h" /* for SMB_Handle_Type */ @@ -212,7 +215,7 @@ int ntlm_errno; static char credentials[1024]; /* we can afford to waste */ char * ntlm_check_auth(struct ntlm_authenticate * auth, int auth_length) { - int rv; + int rv, retries=0; char pass[25]; char *domain=credentials; char *user; @@ -258,6 +261,13 @@ debug("checking domain: '%s', user: '%s', pass='%s'\n",domain,user,pass); rv=SMB_Logon_Server(handle,user,pass,domain,1); + + while ( (rv == NTLM_BAD_PROTOCOL || rv==NTLM_SERVER_ERROR) + && retries < BAD_DC_RETRIES_NUMBER) { + retries++; + usleep ((unsigned long)100000); + rv=SMB_Logon_Server(handle,user,pass,domain,1); + } debug("\tresult is %d\n",rv); diff -ur squid-ntlm-orig/ntlm_auth_modules/NTLMSSP/ntlm.h squid-ntlm/ntlm_auth_modules/NTLMSSP/ntlm.h --- squid-ntlm-orig/ntlm_auth_modules/NTLMSSP/ntlm.h Thu Oct 19 18:42:45 2000 +++ squid-ntlm/ntlm_auth_modules/NTLMSSP/ntlm.h Thu Oct 19 18:58:56 2000 @@ -66,6 +66,13 @@ extern time_t inactivity_timeout; +/* + * Number of retries when some kinds of errors occur with the Domain + * Controller. Keep it reasonable... + */ +#define BAD_DC_RETRIES_NUMBER 3 + + /************* END CONFIGURATION ***************/ #include