diff -urp squid-3.1.10/src/adaptation/ecap/Host.cc squid-3.1.10-ecap/src/adaptation/ecap/Host.cc
--- src/adaptation/ecap/Host.cc	2010-12-22 00:46:56.000000000 -0500
+++ src/adaptation/ecap/Host.cc	2011-02-03 18:30:59.000000000 -0500
@@ -25,6 +25,7 @@ Adaptation::Ecap::Host::Host()
     // this code can run only once
 
     libecap::headerReferer.assignHostId(HDR_REFERER);
+    libecap::headerContentLength.assignHostId(HDR_CONTENT_LENGTH);
 
     libecap::protocolHttp.assignHostId(PROTO_HTTP);
     libecap::protocolHttps.assignHostId(PROTO_HTTPS);
diff -urp squid-3.1.10/src/adaptation/ecap/MessageRep.cc squid-3.1.10-ecap/src/adaptation/ecap/MessageRep.cc
--- src/adaptation/ecap/MessageRep.cc	2010-12-22 00:46:56.000000000 -0500
+++ src/adaptation/ecap/MessageRep.cc	2011-02-03 11:37:50.000000000 -0500
@@ -48,6 +48,9 @@ Adaptation::Ecap::HeaderRep::add(const N
     HttpHeaderEntry *e = new HttpHeaderEntry(squidId, name.image().c_str(),
             value.toString().c_str());
     theHeader.addEntry(e);
+
+    if (squidId == HDR_CONTENT_LENGTH)
+	    theMessage.content_length = theHeader.getInt64(HDR_CONTENT_LENGTH);
 }
 
 void
@@ -58,6 +61,9 @@ Adaptation::Ecap::HeaderRep::removeAny(c
         theHeader.delByName(name.image().c_str());
     else
         theHeader.delById(squidId);
+
+    if (squidId == HDR_CONTENT_LENGTH)
+	    theMessage.content_length = theHeader.getInt64(HDR_CONTENT_LENGTH);
 }
 
 libecap::Area
