Hello.

I have been trying to patch 2.5.13 with patch
http://squid.sourceforge.net/cgi-bin...2.5.patch?s2_5. It
compiled without errors, but icap didn't compiled in to binary.
Then i little bit modify some files icap began to work.
Every thing ok while i don't enable preview mode.
When it enabled squid really often reload (it seems on every request)
with error:
assertion failed: MemBuf.c:197: "mb && buf && sz >= 0"
Unfortunately i can't fix this bug.
Can anybody help me.

============
additional pach to 2.5.13 for enable icap
============
diff -ru squid-2.5.STABLE13.orig/configure squid-2.5.STABLE13/configure
--- squid-2.5.STABLE13.orig/configure 2006-03-12 14:29:22.000000000
+0300
+++ squid-2.5.STABLE13/configure 2006-05-19 11:46:50.000000000 +0400
@@ -2073,6 +2073,38 @@

fi

+#fi;
+
+
+
+if false; then
+ USE_ICAP_TRUE=
+ USE_ICAP_FALSE='#'
+else
+ USE_ICAP_TRUE='#'
+ USE_ICAP_FALSE=
+fi
+# Check whether --enable-icap-support or --disable-icap-support was
given.
+if test "${enable_icap_support+set}" = set; then
+ enableval="$enable_icap_support"
+ if test "$enableval" = "yes" ; then
+ echo "ICAP support enabled"
+ cat >>confdefs.h <<\EOF
+#define HS_FEAT_ICAP 1
+EOF
+
+
+
+if true; then
+ USE_ICAP_TRUE=
+ USE_ICAP_FALSE='#'
+else
+ USE_ICAP_TRUE='#'
+ USE_ICAP_FALSE=
+fi
+fi
+
+fi;

# Check whether --enable-removal-policies or
--disable-removal-policies was given.
if test "${enable_removal_policies+set}" = set; then
@@ -9072,6 +9104,8 @@
s%@ENABLE_PINGER_FALSE@%$ENABLE_PINGER_FALSE%g
s%@USE_DELAY_POOLS_TRUE@%$USE_DELAY_POOLS_TRUE%g
s%@USE_DELAY_POOLS_FALSE@%$USE_DELAY_POOLS_FALSE%g
+s%@USE_ICAP_TRUE@%$USE_ICAP_TRUE%g
+s%@USE_ICAP_FALSE@%$USE_ICAP_FALSE%g
s%@USE_SNMP_TRUE@%$USE_SNMP_TRUE%g
s%@USE_SNMP_FALSE@%$USE_SNMP_FALSE%g
s%@SNMPLIB@%$SNMPLIB%g
diff -ru squid-2.5.STABLE13.orig/include/autoconf.h.in
squid-2.5.STABLE13/include/autoconf.h.in
--- squid-2.5.STABLE13.orig/include/autoconf.h.in 2005-09-13
04:12:34.000000000 +0400
+++ squid-2.5.STABLE13/include/autoconf.h.in 2006-05-19
11:46:50.000000000 +0400
@@ -124,6 +124,13 @@
*/
#undef DELAY_POOLS

+
+/*
+ * ICAP - Internet Content Adaptation Protocol
+ */
+#undef HS_FEAT_ICAP
+
+
/*
* If you want to log User-Agent request header values, define this.
* By default, they are written to useragent.log in the Squid log
diff -ru squid-2.5.STABLE13.orig/src/Makefile.am
squid-2.5.STABLE13/src/Makefile.am
--- squid-2.5.STABLE13.orig/src/Makefile.am 2006-05-19
10:45:29.000000000 +0400
+++ squid-2.5.STABLE13/src/Makefile.am 2006-05-19 11:46:50.000000000
+0400
@@ -105,6 +105,7 @@
dnsserver.c \
dns_internal.c \
htcp.c \
+ $(ICAPSOURCE) \
leakfinder.c \
snmp_core.c \
snmp_agent.c \
diff -ru squid-2.5.STABLE13.orig/src/Makefile.in
squid-2.5.STABLE13/src/Makefile.in
--- squid-2.5.STABLE13.orig/src/Makefile.in 2005-09-29
00:57:21.000000000 +0400
+++ squid-2.5.STABLE13/src/Makefile.in 2006-05-19 11:46:50.000000000
+0400
@@ -125,6 +125,9 @@
install_sh = @install_sh@
makesnmplib = @makesnmplib@

+@USE_ICAP_TRUE@ICAPSOURCE = icap_common.c icap_reqmod.c icap_respmod.c
icap_opt.c
+@USE_ICAP_FALSE@ICAPSOURCE =
+
@USE_DNSSERVER_TRUE@DNSSOURCE = dns.c
@USE_DNSSERVER_FALSE@DNSSOURCE = dns_internal.c
@USE_DNSSERVER_TRUE@DNSSERVER = dnsserver
@@ -196,6 +199,7 @@
dnsserver.c \
dns_internal.c \
htcp.c \
+ $(ICAPSOURCE) \
leakfinder.c \
snmp_core.c \
snmp_agent.c \
@@ -249,6 +253,7 @@
HttpMsg.c \
HttpReply.c \
HttpRequest.c \
+ $(ICAPSOURCE) \
icmp.c \
icp_v2.c \
icp_v3.c \
@@ -498,6 +503,7 @@
HttpHeader.$(OBJEXT) HttpHeaderTools.$(OBJEXT) \
HttpBody.$(OBJEXT) HttpMsg.$(OBJEXT) HttpReply.$(OBJEXT) \
HttpRequest.$(OBJEXT) icmp.$(OBJEXT) icp_v2.$(OBJEXT) \
+ icap_common.$(OBJEXT) icap_reqmod.$(OBJEXT) icap_respmod.$(OBJEXT)
icap_opt.$(OBJEXT) \
icp_v3.$(OBJEXT) ident.$(OBJEXT) internal.$(OBJEXT) \
ipc.$(OBJEXT) ipcache.$(OBJEXT) $(am__objects_6) \
logfile.$(OBJEXT) main.$(OBJEXT) mem.$(OBJEXT) \
@@ -564,6 +570,7 @@
@AMDEP_TRUE@ $(DEPDIR)/globals.Po $(DEPDIR)/gopher.Po \
@AMDEP_TRUE@ $(DEPDIR)/helper.Po $(DEPDIR)/htcp.Po \
@AMDEP_TRUE@ $(DEPDIR)/http.Po $(DEPDIR)/icmp.Po \
+@AMDEP_TRUE@ $(DEPDIR)/icap_common.Po $(DEPDIR)/icap_reqmod.Po
$(DEPDIR)/icap_respmod.Po $(DEPDIR)/icap_opt.Po \
@AMDEP_TRUE@ $(DEPDIR)/icp_v2.Po $(DEPDIR)/icp_v3.Po \
@AMDEP_TRUE@ $(DEPDIR)/ident.Po $(DEPDIR)/internal.Po \
@AMDEP_TRUE@ $(DEPDIR)/ipc.Po $(DEPDIR)/ipcache.Po \
@@ -778,6 +785,10 @@
@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/htcp.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/http.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/icmp.Po@am__quote@
+@AMDEP_TRUE@@am__include@
@am__quote@$(DEPDIR)/icap_common.Po@am__quote@
+@AMDEP_TRUE@@am__include@
@am__quote@$(DEPDIR)/icap_reqmod.Po@am__quote@
+@AMDEP_TRUE@@am__include@
@am__quote@$(DEPDIR)/icap_respmod.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/icap_opt.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/icp_v2.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/icp_v3.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/ident.Po@am__quote@