OSDN Git Service

Change log level of packet_edit_http.
authorKohei TANUMA <tanuma@users.sourceforge.jp>
Thu, 1 Oct 2009 07:59:55 +0000 (16:59 +0900)
committerTATEISHI Katsuyuki <kt@wheel.jp>
Fri, 2 Oct 2009 08:11:19 +0000 (17:11 +0900)
* Reduce log level of HTTP parser's error from ERROR to INFO.
 * Raise default log level from INFO to WARN.

conf/sslproxy.target.cf
src/http_message.cpp
src/http_request.cpp
src/http_response.cpp

index 8be6ba4..799b6c1 100644 (file)
@@ -143,6 +143,6 @@ sslproxy_common     = "warn"
 sslproxy_server     = "warn"
 sslproxy_session    = "warn"
 sslproxy_connection = "info"
-packet_edit         = "info"
-packet_edit_http    = "info"
+packet_edit         = "warn"
+packet_edit_http    = "warn"
 
index bf2ce09..03efa44 100644 (file)
@@ -304,7 +304,7 @@ void http_message::parse(std::string message)
                 } 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;
                 }
@@ -315,7 +315,7 @@ void http_message::parse(std::string message)
                 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;
                 }
@@ -345,7 +345,7 @@ void http_message::parse(std::string message)
                     }
                     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;
                 }
@@ -360,7 +360,7 @@ void http_message::parse(std::string message)
                     *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;
                 }
@@ -380,7 +380,7 @@ void http_message::parse(std::string message)
                 } 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;
                 }
@@ -399,7 +399,7 @@ void http_message::parse(std::string message)
                     *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;
                 }
@@ -410,7 +410,7 @@ void http_message::parse(std::string message)
                 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;
                 }
@@ -436,7 +436,7 @@ void http_message::parse(std::string message)
         }
     }
     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.");
     }
 
index dc769f0..0107583 100644 (file)
@@ -337,7 +337,7 @@ void http_request::parse(std::string request)
                     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;
                 }
@@ -395,7 +395,7 @@ void http_request::parse(std::string request)
                     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;
                 }
@@ -411,7 +411,7 @@ void http_request::parse(std::string request)
                     *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;
                 }
@@ -426,7 +426,7 @@ void http_request::parse(std::string request)
                     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;
                 }
@@ -437,7 +437,7 @@ void http_request::parse(std::string request)
                 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;
                 }
@@ -448,7 +448,7 @@ void http_request::parse(std::string request)
                 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;
                 }
@@ -459,7 +459,7 @@ void http_request::parse(std::string request)
                 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;
                 }
@@ -470,7 +470,7 @@ void http_request::parse(std::string request)
                 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;
                 }
@@ -481,7 +481,7 @@ void http_request::parse(std::string request)
                 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;
                 }
@@ -492,7 +492,7 @@ void http_request::parse(std::string request)
                 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;
                 }
@@ -503,7 +503,7 @@ void http_request::parse(std::string request)
                 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;
                 }
@@ -515,7 +515,7 @@ void http_request::parse(std::string request)
                     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;
                 }
@@ -527,7 +527,7 @@ void http_request::parse(std::string request)
                     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;
                 }
@@ -539,7 +539,7 @@ void http_request::parse(std::string request)
         }
     }
     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.");
     }
 
index 17b7fe5..78632b3 100644 (file)
@@ -338,7 +338,7 @@ void http_response::parse(std::string response)
                     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;
                 }
@@ -349,7 +349,7 @@ void http_response::parse(std::string response)
                 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;
                 }
@@ -360,7 +360,7 @@ void http_response::parse(std::string response)
                 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;
                 }
@@ -371,7 +371,7 @@ void http_response::parse(std::string response)
                 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;
                 }
@@ -382,7 +382,7 @@ void http_response::parse(std::string response)
                 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;
                 }
@@ -393,7 +393,7 @@ void http_response::parse(std::string response)
                 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;
                 }
@@ -404,7 +404,7 @@ void http_response::parse(std::string response)
                 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;
                 }
@@ -415,7 +415,7 @@ void http_response::parse(std::string response)
                 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;
                 }
@@ -427,7 +427,7 @@ void http_response::parse(std::string response)
                     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;
                 }
@@ -442,7 +442,7 @@ void http_response::parse(std::string response)
                     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;
                 }
@@ -453,7 +453,7 @@ void http_response::parse(std::string response)
                 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;
                 }
@@ -464,7 +464,7 @@ void http_response::parse(std::string response)
                 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;
                 }
@@ -476,7 +476,7 @@ void http_response::parse(std::string response)
                     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;
                 }
@@ -494,7 +494,7 @@ void http_response::parse(std::string response)
                     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;
                 }
@@ -506,7 +506,7 @@ void http_response::parse(std::string response)
                     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;
                 }
@@ -518,7 +518,7 @@ void http_response::parse(std::string response)
                     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;
                 }
@@ -530,7 +530,7 @@ void http_response::parse(std::string response)
         }
     }
     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.");
     }