}
}
catch (...) {
+ this->_method.clear();
+ this->_request_uri.clear();
+ this->_http_version.clear();
LOGGER_PUT_LOG_INFO(LOG_CAT_PACKET_EDIT_HTTP, 14,
"Exception occured by parsing HTTP request.");
}
}
}
catch (...) {
+ this->_http_version.clear();
+ this->_status_code.clear();
+ this->_reason_phrase.clear();
LOGGER_PUT_LOG_INFO(LOG_CAT_PACKET_EDIT_HTTP, 31,
"Exception occured by parsing HTTP response.");
}
it = ::http_request_header.begin();
end = ::http_request_header.end();
http_request request(std::string(client_msg, client_length));
+
+ // Ignore when client_msg is not HTTP message
+ if (request.method().empty())
+ goto packet_edit_out;
+
for (;it != end; ++it) {
// Set request header field
if (it->first == "set") {
* Insert other protocol editor.
*/
+packet_edit_out:
+
if (request.modified()) {
std::string edited = request.as_string();
// New client message is too long (over buffer size)
it = ::http_response_header.begin();
end = ::http_response_header.end();
http_response response(std::string(server_msg, server_length));
+
+ // Ignore when server_msg is not HTTP message
+ if (response.http_version().empty())
+ goto packet_edit_out;
+
for (;it != end; ++it) {
// Set request header field
if (it->first == "set") {
* Insert other protocol editor.
*/
+packet_edit_out:
+
if (response.modified()) {
std::string edited = response.as_string();
// New server message is too long (over buffer size)