From 376b88ec09ef8cf71dd823467406c58204485fcc Mon Sep 17 00:00:00 2001 From: Oleg Morozenkov Date: Tue, 11 Aug 2015 22:13:23 +0300 Subject: Fixed compiler's errors in TgTypeParser + fixed indentation + some other fixes --- src/net/HttpClient.cpp | 42 +++++++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 21 deletions(-) (limited to 'src/net/HttpClient.cpp') diff --git a/src/net/HttpClient.cpp b/src/net/HttpClient.cpp index 5027b09..b9813ad 100644 --- a/src/net/HttpClient.cpp +++ b/src/net/HttpClient.cpp @@ -32,36 +32,36 @@ using namespace boost::asio::local; namespace TgBot { HttpClient& HttpClient::getInstance() { - static HttpClient result; - return result; + static HttpClient result; + return result; } string HttpClient::makeRequest(const Url& url, const vector& args) { - ssl::context context(ssl::context::sslv23); - context.set_default_verify_paths(); + ssl::context context(ssl::context::sslv23); + context.set_default_verify_paths(); - ssl::stream socket(_ioService, context); - tcp::resolver resolver(_ioService); - tcp::resolver::query query(url.host, url.protocol); + ssl::stream socket(_ioService, context); + tcp::resolver resolver(_ioService); + tcp::resolver::query query(url.host, url.protocol); - connect(socket.lowest_layer(), resolver.resolve(query)); + connect(socket.lowest_layer(), resolver.resolve(query)); - socket.set_verify_mode(ssl::verify_none); - socket.set_verify_callback(ssl::rfc2818_verification(url.host)); - socket.handshake(ssl::stream::client); + socket.set_verify_mode(ssl::verify_none); + socket.set_verify_callback(ssl::rfc2818_verification(url.host)); + socket.handshake(ssl::stream::client); - string requestText = HttpParser::getInstance().generateRequest(url, args, false); - write(socket, buffer(requestText.c_str(), requestText.length())); + string requestText = HttpParser::getInstance().generateRequest(url, args, false); + write(socket, buffer(requestText.c_str(), requestText.length())); - string response; - char buff[1024]; - boost::system::error_code error; - while (!error) { - size_t bytes = read(socket, buffer(buff), error); - response += string(buff, bytes); - } + string response; + char buff[1024]; + boost::system::error_code error; + while (!error) { + size_t bytes = read(socket, buffer(buff), error); + response += string(buff, bytes); + } - return HttpParser::getInstance().parseResponse(response); + return HttpParser::getInstance().parseResponse(response); } } -- cgit v1.2.3