From 9116322a9b95c37fd60c2e2850592200fa9a46ca Mon Sep 17 00:00:00 2001 From: wujunzhuo Date: Mon, 16 Feb 2015 09:34:28 +0800 Subject: [PATCH] catch exceptions in parse_headers --- boost/network/protocol/http/server/async_connection.hpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/boost/network/protocol/http/server/async_connection.hpp b/boost/network/protocol/http/server/async_connection.hpp index bcfcfb7d8..21728c192 100644 --- a/boost/network/protocol/http/server/async_connection.hpp +++ b/boost/network/protocol/http/server/async_connection.hpp @@ -477,7 +477,12 @@ struct async_connection } else if (parsed_ok == true) { partial_parsed.append(boost::begin(result_range), boost::end(result_range)); - parse_headers(partial_parsed, request_.headers); + try { + parse_headers(partial_parsed, request_.headers); + } catch (...) { + client_error(); + break; + } new_start = boost::end(result_range); thread_pool().post(boost::bind( &Handler::operator(), &handler, cref(request_),