From 89bfe52f09ca583afc56e2fb31c6a79c5b6e55ac Mon Sep 17 00:00:00 2001 From: ipknHama Date: Tue, 22 Apr 2014 20:19:03 +0900 Subject: increasing unittest coverage; fix crash bug while parsing headers --- http_connection.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'http_connection.h') diff --git a/http_connection.h b/http_connection.h index 6338c6f..d486d01 100644 --- a/http_connection.h +++ b/http_connection.h @@ -72,7 +72,6 @@ namespace flask std::cerr << "HTTP/" << parser_.http_major << "." << parser_.http_minor << ' '; std::cerr << method_name(req.method); std::cerr << " " << res.code << std::endl; - std::cerr << "res body: " << res.body << std::endl; #endif static std::string seperator = ": "; @@ -81,7 +80,7 @@ namespace flask buffers_.clear(); buffers_.reserve(4*(res.headers.size()+4)+3); - if (res.body.empty() && res.json_value.t == json::type::Object) + if (res.body.empty() && res.json_value.t() == json::type::Object) { res.body = json::dump(res.json_value); } @@ -161,6 +160,7 @@ namespace flask do_read(); else { + socket_.shutdown(boost::asio::ip::tcp::socket::shutdown_both); socket_.close(); life_--; -- cgit v1.2.3-54-g00ecf