From 7e5aec8db700d4fe1b18f50e42c25c822b86b9dc Mon Sep 17 00:00:00 2001 From: Alex Rousskov Date: Mon, 21 Sep 2015 12:17:38 -0600 Subject: [PATCH] eCAP: Return unknown body size for bodies with unknown body sizes. Previously, unsigned -1 size was returned for those bodies. Old adapters relying on that buggy behavior will now throw: !"attempt to use unknown libecap::BodySize size" Such adapters should check libecap::BodySize::known() before using the libecap::Body::bodySize() value. --- src/adaptation/ecap/MessageRep.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/adaptation/ecap/MessageRep.cc b/src/adaptation/ecap/MessageRep.cc index 3d5e095010..53962dda40 100644 --- a/src/adaptation/ecap/MessageRep.cc +++ b/src/adaptation/ecap/MessageRep.cc @@ -353,7 +353,7 @@ Adaptation::Ecap::BodyRep::tie(const BodyPipe::Pointer &aBody) Adaptation::Ecap::BodyRep::BodySize Adaptation::Ecap::BodyRep::bodySize() const { - return !theBody ? BodySize() : BodySize(theBody->bodySize()); + return (theBody && theBody->bodySizeKnown()) ? BodySize(theBody->bodySize()) : BodySize(); } /* MessageRep */ -- 2.47.2