* Reduce log level of HTTP parser's error from ERROR to INFO.
* Raise default log level from INFO to WARN.
sslproxy_server = "warn"
sslproxy_session = "warn"
sslproxy_connection = "info"
-packet_edit = "info"
-packet_edit_http = "info"
+packet_edit = "warn"
+packet_edit_http = "warn"
} else if (*ptr == '\r') { // CRLF + CRLF
pos = MESSAGE_LAST_CR;
} else {
- LOGGER_PUT_LOG_ERROR(LOG_CAT_PACKET_EDIT_HTTP, 2,
+ LOGGER_PUT_LOG_INFO(LOG_CAT_PACKET_EDIT_HTTP, 32,
"Parse error: Invalid header field name.(%c)", *ptr);
throw -1;
}
if (*ptr == '\n') {
pos = MESSAGE_LF;
} else {
- LOGGER_PUT_LOG_ERROR(LOG_CAT_PACKET_EDIT_HTTP, 3,
+ LOGGER_PUT_LOG_INFO(LOG_CAT_PACKET_EDIT_HTTP, 33,
"Parse error: No LF.(%c)", *ptr);
throw -1;
}
}
pos = MESSAGE_LAST_CR;
} else {
- LOGGER_PUT_LOG_ERROR(LOG_CAT_PACKET_EDIT_HTTP, 4,
+ LOGGER_PUT_LOG_INFO(LOG_CAT_PACKET_EDIT_HTTP, 34,
"Parse error: Invalid header field name.(%c)", *ptr);
throw -1;
}
*ptr != '.' && *ptr != '_' && *ptr != '~' && *ptr != '!' &&
*ptr != '$' && *ptr != '&' && *ptr != '*' && *ptr != '+' &&
*ptr != '%') {
- LOGGER_PUT_LOG_ERROR(LOG_CAT_PACKET_EDIT_HTTP, 5,
+ LOGGER_PUT_LOG_INFO(LOG_CAT_PACKET_EDIT_HTTP, 35,
"Parse error: Invalid header field name.(%c)", *ptr);
throw -1;
}
} else if (*ptr == '\r') { // omit field value
field_pair.second.clear();
} else {
- LOGGER_PUT_LOG_ERROR(LOG_CAT_PACKET_EDIT_HTTP, 6,
+ LOGGER_PUT_LOG_INFO(LOG_CAT_PACKET_EDIT_HTTP, 36,
"Parse error: Invalid header field value.(%c)", *ptr);
throw -1;
}
*ptr != '<' && *ptr != '>' && *ptr != '[' && *ptr != ']' &&
*ptr != '{' && *ptr != '}' && *ptr != '?' && *ptr != '"' &&
*ptr != '|' && *ptr != '/' && *ptr != '\\'&& *ptr != '\t' ) {
- LOGGER_PUT_LOG_ERROR(LOG_CAT_PACKET_EDIT_HTTP, 7,
+ LOGGER_PUT_LOG_INFO(LOG_CAT_PACKET_EDIT_HTTP, 37,
"Parse error: Invalid header field value.(%c)", *ptr);
throw -1;
}
if (*ptr == '\n') {
pos = MESSAGE_LAST_LF;
} else {
- LOGGER_PUT_LOG_ERROR(LOG_CAT_PACKET_EDIT_HTTP, 8,
+ LOGGER_PUT_LOG_INFO(LOG_CAT_PACKET_EDIT_HTTP, 38,
"Parse error: No LF.(%c)", *ptr);
throw -1;
}
}
}
catch (...) {
- LOGGER_PUT_LOG_ERROR(LOG_CAT_PACKET_EDIT_HTTP, 9,
+ LOGGER_PUT_LOG_INFO(LOG_CAT_PACKET_EDIT_HTTP, 39,
"Exception occured by parsing HTTP message.");
}
this->_method.assign(start, ptr);
pos = REQUEST_METHOD_SP;
} else if (!isalpha(*ptr) && !isdigit(*ptr)) { // XXX not enough
- LOGGER_PUT_LOG_ERROR(LOG_CAT_PACKET_EDIT_HTTP, 10,
+ LOGGER_PUT_LOG_INFO(LOG_CAT_PACKET_EDIT_HTTP, 1,
"Parse error: Invalid request method.(%c)", *ptr);
throw -1;
}
pos = REQUEST_REQUEST_URI;
start = ptr;
} else {
- LOGGER_PUT_LOG_ERROR(LOG_CAT_PACKET_EDIT_HTTP, 11,
+ LOGGER_PUT_LOG_INFO(LOG_CAT_PACKET_EDIT_HTTP, 2,
"Parse error: Invalid request-uri.(%c)", *ptr);
throw -1;
}
*ptr != '@' && *ptr != '!' && *ptr != '$' && *ptr != '-' &&
*ptr != '(' && *ptr != ')' && *ptr != '*' && *ptr != '_' &&
*ptr != ':' && *ptr != ';') {
- LOGGER_PUT_LOG_ERROR(LOG_CAT_PACKET_EDIT_HTTP, 12,
+ LOGGER_PUT_LOG_INFO(LOG_CAT_PACKET_EDIT_HTTP, 3,
"Parse error: Invalid request-uri.(%c)", *ptr);
throw -1;
}
pos = REQUEST_HTTP_VERSION_H;
start = ptr;
} else {
- LOGGER_PUT_LOG_ERROR(LOG_CAT_PACKET_EDIT_HTTP, 13,
+ LOGGER_PUT_LOG_INFO(LOG_CAT_PACKET_EDIT_HTTP, 4,
"Parse error: Invalid http-version.(%c)", *ptr);
throw -1;
}
if (*ptr == 'T') {
pos = REQUEST_HTTP_VERSION_T1;
} else {
- LOGGER_PUT_LOG_ERROR(LOG_CAT_PACKET_EDIT_HTTP, 14,
+ LOGGER_PUT_LOG_INFO(LOG_CAT_PACKET_EDIT_HTTP, 5,
"Parse error: Invalid http-version.(%c)", *ptr);
throw -1;
}
if (*ptr == 'T') {
pos = REQUEST_HTTP_VERSION_T2;
} else {
- LOGGER_PUT_LOG_ERROR(LOG_CAT_PACKET_EDIT_HTTP, 15,
+ LOGGER_PUT_LOG_INFO(LOG_CAT_PACKET_EDIT_HTTP, 6,
"Parse error: Invalid http-version.(%c)", *ptr);
throw -1;
}
if (*ptr == 'P') {
pos = REQUEST_HTTP_VERSION_P;
} else {
- LOGGER_PUT_LOG_ERROR(LOG_CAT_PACKET_EDIT_HTTP, 16,
+ LOGGER_PUT_LOG_INFO(LOG_CAT_PACKET_EDIT_HTTP, 7,
"Parse error: Invalid http-version.(%c)", *ptr);
throw -1;
}
if (*ptr == '/') {
pos = REQUEST_HTTP_VERSION_SLASH;
} else {
- LOGGER_PUT_LOG_ERROR(LOG_CAT_PACKET_EDIT_HTTP, 17,
+ LOGGER_PUT_LOG_INFO(LOG_CAT_PACKET_EDIT_HTTP, 8,
"Parse error: Invalid http-version.(%c)", *ptr);
throw -1;
}
if (isdigit(*ptr)) {
pos = REQUEST_HTTP_VERSION_MAJOR;
} else {
- LOGGER_PUT_LOG_ERROR(LOG_CAT_PACKET_EDIT_HTTP, 18,
+ LOGGER_PUT_LOG_INFO(LOG_CAT_PACKET_EDIT_HTTP, 9,
"Parse error: Invalid http-version.(%c)", *ptr);
throw -1;
}
if (*ptr == '.') {
pos = REQUEST_HTTP_VERSION_DOT;
} else if (!isdigit(*ptr)) {
- LOGGER_PUT_LOG_ERROR(LOG_CAT_PACKET_EDIT_HTTP, 19,
+ LOGGER_PUT_LOG_INFO(LOG_CAT_PACKET_EDIT_HTTP, 10,
"Parse error: Invalid http-version.(%c)", *ptr);
throw -1;
}
if (isdigit(*ptr)) {
pos = REQUEST_HTTP_VERSION_MINOR;
} else {
- LOGGER_PUT_LOG_ERROR(LOG_CAT_PACKET_EDIT_HTTP, 20,
+ LOGGER_PUT_LOG_INFO(LOG_CAT_PACKET_EDIT_HTTP, 11,
"Parse error: Invalid http-version.(%c)", *ptr);
throw -1;
}
pos = REQUEST_CR;
this->_http_version.assign(start, ptr);
} else if (!isdigit(*ptr)) {
- LOGGER_PUT_LOG_ERROR(LOG_CAT_PACKET_EDIT_HTTP, 21,
+ LOGGER_PUT_LOG_INFO(LOG_CAT_PACKET_EDIT_HTTP, 12,
"Parse error: Invalid http-version.(%c)", *ptr);
throw -1;
}
pos = REQUEST_LF;
http_message::parse(std::string(ptr + 1, end));
} else {
- LOGGER_PUT_LOG_ERROR(LOG_CAT_PACKET_EDIT_HTTP, 22,
+ LOGGER_PUT_LOG_INFO(LOG_CAT_PACKET_EDIT_HTTP, 13,
"Parse error: No LF.(%c)", *ptr);
throw -1;
}
}
}
catch (...) {
- LOGGER_PUT_LOG_ERROR(LOG_CAT_PACKET_EDIT_HTTP, 23,
+ LOGGER_PUT_LOG_INFO(LOG_CAT_PACKET_EDIT_HTTP, 14,
"Exception occured by parsing HTTP request.");
}
pos = RESPONSE_HTTP_VERSION_H;
start = ptr;
} else {
- LOGGER_PUT_LOG_ERROR(LOG_CAT_PACKET_EDIT_HTTP, 24,
+ LOGGER_PUT_LOG_INFO(LOG_CAT_PACKET_EDIT_HTTP, 15,
"Parse error: Invalid http-version.(%c)", *ptr);
throw -1;
}
if (*ptr == 'T') {
pos = RESPONSE_HTTP_VERSION_T1;
} else {
- LOGGER_PUT_LOG_ERROR(LOG_CAT_PACKET_EDIT_HTTP, 25,
+ LOGGER_PUT_LOG_INFO(LOG_CAT_PACKET_EDIT_HTTP, 16,
"Parse error: Invalid http-version.(%c)", *ptr);
throw -1;
}
if (*ptr == 'T') {
pos = RESPONSE_HTTP_VERSION_T2;
} else {
- LOGGER_PUT_LOG_ERROR(LOG_CAT_PACKET_EDIT_HTTP, 26,
+ LOGGER_PUT_LOG_INFO(LOG_CAT_PACKET_EDIT_HTTP, 17,
"Parse error: Invalid http-version.(%c)", *ptr);
throw -1;
}
if (*ptr == 'P') {
pos = RESPONSE_HTTP_VERSION_P;
} else {
- LOGGER_PUT_LOG_ERROR(LOG_CAT_PACKET_EDIT_HTTP, 27,
+ LOGGER_PUT_LOG_INFO(LOG_CAT_PACKET_EDIT_HTTP, 18,
"Parse error: Invalid http-version.(%c)", *ptr);
throw -1;
}
if (*ptr == '/') {
pos = RESPONSE_HTTP_VERSION_SLASH;
} else {
- LOGGER_PUT_LOG_ERROR(LOG_CAT_PACKET_EDIT_HTTP, 28,
+ LOGGER_PUT_LOG_INFO(LOG_CAT_PACKET_EDIT_HTTP, 19,
"Parse error: Invalid http-version.(%c)", *ptr);
throw -1;
}
if (isdigit(*ptr)) {
pos = RESPONSE_HTTP_VERSION_MAJOR;
} else {
- LOGGER_PUT_LOG_ERROR(LOG_CAT_PACKET_EDIT_HTTP, 29,
+ LOGGER_PUT_LOG_INFO(LOG_CAT_PACKET_EDIT_HTTP, 20,
"Parse error: Invalid http-version.(%c)", *ptr);
throw -1;
}
if (*ptr == '.') {
pos = RESPONSE_HTTP_VERSION_DOT;
} else if (!isdigit(*ptr)) {
- LOGGER_PUT_LOG_ERROR(LOG_CAT_PACKET_EDIT_HTTP, 30,
+ LOGGER_PUT_LOG_INFO(LOG_CAT_PACKET_EDIT_HTTP, 21,
"Parse error: Invalid http-version.(%c)", *ptr);
throw -1;
}
if (isdigit(*ptr)) {
pos = RESPONSE_HTTP_VERSION_MINOR;
} else {
- LOGGER_PUT_LOG_ERROR(LOG_CAT_PACKET_EDIT_HTTP, 31,
+ LOGGER_PUT_LOG_INFO(LOG_CAT_PACKET_EDIT_HTTP, 22,
"Parse error: Invalid http-version.(%c)", *ptr);
throw -1;
}
pos = RESPONSE_HTTP_VERSION_SP;
this->_http_version.assign(start, ptr);
} else if (!isdigit(*ptr)) {
- LOGGER_PUT_LOG_ERROR(LOG_CAT_PACKET_EDIT_HTTP, 32,
+ LOGGER_PUT_LOG_INFO(LOG_CAT_PACKET_EDIT_HTTP, 23,
"Parse error: Invalid http-version.(%c)", *ptr);
throw -1;
}
pos = RESPONSE_STATUS_CODE1;
start = ptr;
} else {
- LOGGER_PUT_LOG_ERROR(LOG_CAT_PACKET_EDIT_HTTP, 33,
+ LOGGER_PUT_LOG_INFO(LOG_CAT_PACKET_EDIT_HTTP, 24,
"Parse error: Invalid status-code.(%c)", *ptr);
throw -1;
}
if (isdigit(*ptr)) {
pos = RESPONSE_STATUS_CODE2;
} else {
- LOGGER_PUT_LOG_ERROR(LOG_CAT_PACKET_EDIT_HTTP, 34,
+ LOGGER_PUT_LOG_INFO(LOG_CAT_PACKET_EDIT_HTTP, 25,
"Parse error: Invalid status-code.(%c)", *ptr);
throw -1;
}
if (isdigit(*ptr)) {
pos = RESPONSE_STATUS_CODE3;
} else {
- LOGGER_PUT_LOG_ERROR(LOG_CAT_PACKET_EDIT_HTTP, 35,
+ LOGGER_PUT_LOG_INFO(LOG_CAT_PACKET_EDIT_HTTP, 26,
"Parse error: Invalid status-code.(%c)", *ptr);
throw -1;
}
pos = RESPONSE_STATUS_CODE_SP;
this->_status_code.assign(start, ptr);
} else {
- LOGGER_PUT_LOG_ERROR(LOG_CAT_PACKET_EDIT_HTTP, 36,
+ LOGGER_PUT_LOG_INFO(LOG_CAT_PACKET_EDIT_HTTP, 27,
"Parse error: Invalid status-code.(%c)", *ptr);
throw -1;
}
pos = RESPONSE_REASON_PHRASE;
start = ptr;
} else {
- LOGGER_PUT_LOG_ERROR(LOG_CAT_PACKET_EDIT_HTTP, 37,
+ LOGGER_PUT_LOG_INFO(LOG_CAT_PACKET_EDIT_HTTP, 28,
"Parse error: Invalid reason-phrase.(%c)", *ptr);
throw -1;
}
pos = RESPONSE_CR;
this->_reason_phrase.assign(start, ptr);
} else if (*ptr == '\n') {
- LOGGER_PUT_LOG_ERROR(LOG_CAT_PACKET_EDIT_HTTP, 38,
+ LOGGER_PUT_LOG_INFO(LOG_CAT_PACKET_EDIT_HTTP, 29,
"Parse error: Invalid reason-phrase.(%c)", *ptr);
throw -1;
}
pos = RESPONSE_LF;
http_message::parse(std::string(ptr + 1, end));
} else {
- LOGGER_PUT_LOG_ERROR(LOG_CAT_PACKET_EDIT_HTTP, 39,
+ LOGGER_PUT_LOG_INFO(LOG_CAT_PACKET_EDIT_HTTP, 30,
"Parse error: No LF.(%c)", *ptr);
throw -1;
}
}
}
catch (...) {
- LOGGER_PUT_LOG_ERROR(LOG_CAT_PACKET_EDIT_HTTP, 40,
+ LOGGER_PUT_LOG_INFO(LOG_CAT_PACKET_EDIT_HTTP, 31,
"Exception occured by parsing HTTP response.");
}