You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@thrift.apache.org by ro...@apache.org on 2011/02/28 17:04:52 UTC
svn commit: r1075399 - /thrift/trunk/lib/cpp/src/transport/THttpClient.cpp
Author: roger
Date: Mon Feb 28 16:04:51 2011
New Revision: 1075399
URL: http://svn.apache.org/viewvc?rev=1075399&view=rev
Log:
THRIFT-1030 C++ THttpTransport doesn't support chucked transfer encoding
Patch: Rowan Kerr
Modified:
thrift/trunk/lib/cpp/src/transport/THttpClient.cpp
Modified: thrift/trunk/lib/cpp/src/transport/THttpClient.cpp
URL: http://svn.apache.org/viewvc/thrift/trunk/lib/cpp/src/transport/THttpClient.cpp?rev=1075399&r1=1075398&r2=1075399&view=diff
==============================================================================
--- thrift/trunk/lib/cpp/src/transport/THttpClient.cpp (original)
+++ thrift/trunk/lib/cpp/src/transport/THttpClient.cpp Mon Feb 28 16:04:51 2011
@@ -19,6 +19,7 @@
#include <cstdlib>
#include <sstream>
+#include <boost/algorithm/string.hpp>
#include <transport/THttpClient.h>
#include <transport/TSocket.h>
@@ -45,11 +46,11 @@ void THttpClient::parseHeader(char* head
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);
}