diff options
author | ipknHama <ipknhama@gmail.com> | 2014-04-22 20:19:03 +0900 |
---|---|---|
committer | ipknHama <ipknhama@gmail.com> | 2014-04-22 20:19:03 +0900 |
commit | 89bfe52f09ca583afc56e2fb31c6a79c5b6e55ac (patch) | |
tree | e884babffb936286ec1f5f58aabe67e885e40308 /http_connection.h | |
parent | dd74354a7bfc34b1c347083c4565ebbd80ff94c0 (diff) | |
download | crow-89bfe52f09ca583afc56e2fb31c6a79c5b6e55ac.tar.gz crow-89bfe52f09ca583afc56e2fb31c6a79c5b6e55ac.zip |
increasing unittest coverage; fix crash bug while parsing headers
Diffstat (limited to 'http_connection.h')
-rw-r--r-- | http_connection.h | 4 |
1 files changed, 2 insertions, 2 deletions
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_--; |