From 46d32b4f082c595a6f7de54d0e683f50b4991efe Mon Sep 17 00:00:00 2001 From: Roger Meier Date: Mon, 28 Feb 2011 16:04:51 +0000 Subject: [PATCH] THRIFT-1030 C++ THttpTransport doesn't support chucked transfer encoding Patch: Rowan Kerr git-svn-id: https://svn.apache.org/repos/asf/thrift/trunk@1075399 13f79535-47bb-0310-9956-ffa450edef68 --- lib/cpp/src/transport/THttpClient.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/cpp/src/transport/THttpClient.cpp b/lib/cpp/src/transport/THttpClient.cpp index 604df0d3..d7833512 100644 --- a/lib/cpp/src/transport/THttpClient.cpp +++ b/lib/cpp/src/transport/THttpClient.cpp @@ -19,6 +19,7 @@ #include #include +#include #include #include @@ -45,11 +46,11 @@ void THttpClient::parseHeader(char* header) { uint32_t sz = colon - header; char* value = colon+1; - if (strncmp(header, "Transfer-Encoding", sz) == 0) { - if (strstr(value, "chunked") != NULL) { + if (boost::istarts_with(header, "Transfer-Encoding")) { + if (boost::iends_with(value, "chunked")) { chunked_ = true; } - } else if (strncmp(header, "Content-Length", sz) == 0) { + } else if (boost::istarts_with(header, "Content-Length")) { chunked_ = false; contentLength_ = atoi(value); } -- 2.17.1