Enable C++11 on GCC; Link boost libs and pthread on GCC.
This commit is contained in:
@@ -1,3 +1,7 @@
|
||||
if(UNIX)
|
||||
add_definitions(-std=c++11)
|
||||
endif()
|
||||
|
||||
option(WEBCC_DEBUG_OUTPUT "Enable debug output?" OFF)
|
||||
|
||||
if(WEBCC_DEBUG_OUTPUT)
|
||||
|
||||
@@ -37,7 +37,7 @@ static void SetTimeout(boost::asio::ip::tcp::socket& socket,
|
||||
#else // POSIX
|
||||
|
||||
struct timeval tv;
|
||||
tv.tv_sec = timeout_seconds_;
|
||||
tv.tv_sec = timeout_seconds;
|
||||
tv.tv_usec = 0;
|
||||
setsockopt(socket.native_handle(), SOL_SOCKET, SO_RCVTIMEO, &tv, sizeof(tv));
|
||||
setsockopt(socket.native_handle(), SOL_SOCKET, SO_SNDTIMEO, &tv, sizeof(tv));
|
||||
@@ -107,11 +107,12 @@ Error HttpClient::SendRequest(const HttpRequest& request,
|
||||
size_t length = socket.read_some(boost::asio::buffer(buffer_), ec);
|
||||
|
||||
if (length == 0 || ec) {
|
||||
#if defined _WINDOWS
|
||||
if (ec.value() == WSAETIMEDOUT) {
|
||||
return kSocketTimeoutError;
|
||||
} else {
|
||||
return kSocketReadError;
|
||||
}
|
||||
#endif
|
||||
return kSocketReadError;
|
||||
}
|
||||
|
||||
#if WEBCC_DEBUG_OUTPUT
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
#include "webcc/http_response.h"
|
||||
#include <iostream>
|
||||
|
||||
namespace webcc {
|
||||
|
||||
@@ -98,7 +99,7 @@ std::vector<boost::asio::const_buffer> HttpResponse::ToBuffers() const {
|
||||
if (IsContentLengthValid()) {
|
||||
buffers.push_back(boost::asio::buffer(content_));
|
||||
}
|
||||
|
||||
|
||||
return buffers;
|
||||
}
|
||||
|
||||
|
||||
@@ -45,7 +45,7 @@ Error SoapClient::Call(const std::string& operation,
|
||||
http_request.SetHeader(kSoapAction, operation);
|
||||
http_request.set_content(std::move(http_content));
|
||||
|
||||
http_request.MakeStartLine();
|
||||
http_request.Build();
|
||||
|
||||
HttpResponse http_response;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user