diff -ru squid-HEAD/src/cf.data.pre squid-HEAD_mod/src/cf.data.pre
--- squid-HEAD/src/cf.data.pre	2006-11-04 16:50:51.000000000 +0100
+++ squid-HEAD_mod/src/cf.data.pre	2006-12-03 15:08:11.000000000 +0100
@@ -4983,6 +4983,26 @@
     If you want to enable the ICAP module support, set this to on.
 DOC_END
 
+NAME: icap_session_failure_limit
+TYPE: int
+IFDEF: ICAP_CLIENT
+LOC: TheICAPConfig.session_failure_limit
+DEFAULT: 10
+DOC_START
+        The Number of Failures in ICAP Server communication that will
+        supend the icap connection.
+DOC_END
+
+NAME: icap_delay_on_failure
+TYPE: int
+IFDEF: ICAP_CLIENT
+LOC: TheICAPConfig.delay_on_failure
+DEFAULT: 180
+DOC_START
+        Number of seconds to wait on a suspended icap connection 
+        before trying again.
+DOC_END
+
 NAME: icap_preview_enable
 TYPE: onoff
 IFDEF: ICAP_CLIENT
@@ -5047,6 +5067,15 @@
         if proxy access is authentified.
 DOC_END
 
+NAME: icap_client_username_header
+TYPE: string
+IFDEF: ICAP_CLIENT
+LOC: TheICAPConfig.client_username_header
+DEFAULT: X-Client-Username
+DOC_START
+        Header ti use for send_client_username
+DOC_END
+
 NAME: icap_service
 TYPE: icap_service_type
 IFDEF: ICAP_CLIENT
diff -ru squid-HEAD/src/ICAP/ICAPConfig.h squid-HEAD_mod/src/ICAP/ICAPConfig.h
--- squid-HEAD/src/ICAP/ICAPConfig.h	2006-11-01 00:52:31.000000000 +0100
+++ squid-HEAD_mod/src/ICAP/ICAPConfig.h	2006-12-03 15:08:35.000000000 +0100
@@ -102,6 +102,9 @@
     int send_client_ip;
     int send_client_username;
     int reuse_connections;
+    int session_failure_limit;
+    int delay_on_failure;
+    char* client_username_header;
 
     Vector<ICAPServiceRep::Pointer> services;
     Vector<ICAPClass*> classes;
diff -ru squid-HEAD/src/ICAP/ICAPModXact.cc squid-HEAD_mod/src/ICAP/ICAPModXact.cc
--- squid-HEAD/src/ICAP/ICAPModXact.cc	2006-11-01 00:52:31.000000000 +0100
+++ squid-HEAD_mod/src/ICAP/ICAPModXact.cc	2006-12-03 15:09:14.000000000 +0100
@@ -1018,7 +1018,7 @@
     if (TheICAPConfig.send_client_username && request)
         if (request->auth_user_request)
             if (request->auth_user_request->username())
-                buf.Printf("X-Client-Username: %s\r\n", request->auth_user_request->username());
+                buf.Printf("%s: %s\r\n", TheICAPConfig.client_username_header, request->auth_user_request->username());
 
     // fprintf(stderr, "%s\n", buf.content());
 
diff -ru squid-HEAD/src/ICAP/ICAPServiceRep.cc squid-HEAD_mod/src/ICAP/ICAPServiceRep.cc
--- squid-HEAD/src/ICAP/ICAPServiceRep.cc	2006-11-01 00:52:31.000000000 +0100
+++ squid-HEAD_mod/src/ICAP/ICAPServiceRep.cc	2006-12-03 15:09:49.000000000 +0100
@@ -8,12 +8,13 @@
 #include "ICAPOptions.h"
 #include "ICAPOptXact.h"
 #include "ConfigParser.h"
+#include "ICAPConfig.h"
 #include "SquidTime.h"
 
 CBDATA_CLASS_INIT(ICAPServiceRep);
 
 // XXX: move to squid.conf
-const int ICAPServiceRep::TheSessionFailureLimit = 10;
+extern ICAPConfig TheICAPConfig;
 
 ICAPServiceRep::ICAPServiceRep(): method(ICAP::methodNone),
         point(ICAP::pointNone), port(-1), bypass(false),
@@ -177,9 +178,9 @@
 void ICAPServiceRep::noteFailure() {
     ++theSessionFailures;
     debugs(93,4, "ICAPService failure " << theSessionFailures <<
-        ", out of " << TheSessionFailureLimit << " allowed");
+        ", out of " << TheICAPConfig.session_failure_limit << " allowed");
 
-    if (theSessionFailures > TheSessionFailureLimit)
+    if (theSessionFailures > TheICAPConfig.session_failure_limit )
         suspend("too many failures");
 
     // TODO: Should bypass setting affect how much Squid tries to talk to
@@ -462,7 +463,7 @@
         else
             when = expire - expectedWait; // before the current options expire
     } else {
-        when = squid_curtime + 3*60; // delay for a down service
+        when = squid_curtime + TheICAPConfig.delay_on_failure; // delay for a down service
     }
 
     debugs(93,7, "ICAPService options raw update on " << when << " or " << (when - squid_curtime));
