#include "DelayPools.h"
#endif
-#define SQUID_ENTER_THROWING_CODE() try {
-#define SQUID_EXIT_THROWING_CODE(status) \
- status = true; \
- } \
- catch (const std::exception &e) { \
- debugs (11, 1, "Exception error:" << e.what()); \
- status = false; \
- }
-
CBDATA_CLASS_INIT(HttpStateData);
static const char *const crlf = "\r\n";
bool
HttpStateData::decodeAndWriteReplyBody()
{
- const char *data = NULL;
- int len;
- bool wasThereAnException = false;
assert(flags.chunked);
assert(httpChunkDecoder);
- SQUID_ENTER_THROWING_CODE();
- MemBuf decodedData;
- decodedData.init();
- httpChunkDecoder->setPayloadBuffer(&decodedData);
- const bool doneParsing = httpChunkDecoder->parse(inBuf);
- inBuf = httpChunkDecoder->remaining(); // sync buffers after parse
- len = decodedData.contentSize();
- data=decodedData.content();
- addVirginReplyBody(data, len);
- if (doneParsing) {
- lastChunk = 1;
- flags.do_next_read = false;
+ try {
+ MemBuf decodedData;
+ decodedData.init();
+ httpChunkDecoder->setPayloadBuffer(&decodedData);
+ const bool doneParsing = httpChunkDecoder->parse(inBuf);
+ inBuf = httpChunkDecoder->remaining(); // sync buffers after parse
+ addVirginReplyBody(decodedData.content(), decodedData.contentSize());
+ if (doneParsing) {
+ lastChunk = 1;
+ flags.do_next_read = false;
+ }
+ return true;
}
- SQUID_EXIT_THROWING_CODE(wasThereAnException);
- return wasThereAnException;
+ catch (...) {
+ debugs (11, 2, "de-chunking failure: " << CurrentException);
+ }
+ return false;
}
/**