コミットメタ情報

リビジョン2d2a294d7e8e74db8ba3e958015a616f095aa8e6 (tree)
日時2009-10-02 17:11:19
作者Kohei TANUMA <tanuma@user...>
コミッターTATEISHI Katsuyuki

ログメッセージ

Change log level of packet_edit_http.

* Reduce log level of HTTP parser's error from ERROR to INFO.

  • Raise default log level from INFO to WARN.

変更サマリ

差分

--- a/conf/sslproxy.target.cf
+++ b/conf/sslproxy.target.cf
@@ -143,6 +143,6 @@ sslproxy_common = "warn"
143143 sslproxy_server = "warn"
144144 sslproxy_session = "warn"
145145 sslproxy_connection = "info"
146-packet_edit = "info"
147-packet_edit_http = "info"
146+packet_edit = "warn"
147+packet_edit_http = "warn"
148148
--- a/src/http_message.cpp
+++ b/src/http_message.cpp
@@ -304,7 +304,7 @@ void http_message::parse(std::string message)
304304 } else if (*ptr == '\r') { // CRLF + CRLF
305305 pos = MESSAGE_LAST_CR;
306306 } else {
307- LOGGER_PUT_LOG_ERROR(LOG_CAT_PACKET_EDIT_HTTP, 2,
307+ LOGGER_PUT_LOG_INFO(LOG_CAT_PACKET_EDIT_HTTP, 32,
308308 "Parse error: Invalid header field name.(%c)", *ptr);
309309 throw -1;
310310 }
@@ -315,7 +315,7 @@ void http_message::parse(std::string message)
315315 if (*ptr == '\n') {
316316 pos = MESSAGE_LF;
317317 } else {
318- LOGGER_PUT_LOG_ERROR(LOG_CAT_PACKET_EDIT_HTTP, 3,
318+ LOGGER_PUT_LOG_INFO(LOG_CAT_PACKET_EDIT_HTTP, 33,
319319 "Parse error: No LF.(%c)", *ptr);
320320 throw -1;
321321 }
@@ -345,7 +345,7 @@ void http_message::parse(std::string message)
345345 }
346346 pos = MESSAGE_LAST_CR;
347347 } else {
348- LOGGER_PUT_LOG_ERROR(LOG_CAT_PACKET_EDIT_HTTP, 4,
348+ LOGGER_PUT_LOG_INFO(LOG_CAT_PACKET_EDIT_HTTP, 34,
349349 "Parse error: Invalid header field name.(%c)", *ptr);
350350 throw -1;
351351 }
@@ -360,7 +360,7 @@ void http_message::parse(std::string message)
360360 *ptr != '.' && *ptr != '_' && *ptr != '~' && *ptr != '!' &&
361361 *ptr != '$' && *ptr != '&' && *ptr != '*' && *ptr != '+' &&
362362 *ptr != '%') {
363- LOGGER_PUT_LOG_ERROR(LOG_CAT_PACKET_EDIT_HTTP, 5,
363+ LOGGER_PUT_LOG_INFO(LOG_CAT_PACKET_EDIT_HTTP, 35,
364364 "Parse error: Invalid header field name.(%c)", *ptr);
365365 throw -1;
366366 }
@@ -380,7 +380,7 @@ void http_message::parse(std::string message)
380380 } else if (*ptr == '\r') { // omit field value
381381 field_pair.second.clear();
382382 } else {
383- LOGGER_PUT_LOG_ERROR(LOG_CAT_PACKET_EDIT_HTTP, 6,
383+ LOGGER_PUT_LOG_INFO(LOG_CAT_PACKET_EDIT_HTTP, 36,
384384 "Parse error: Invalid header field value.(%c)", *ptr);
385385 throw -1;
386386 }
@@ -399,7 +399,7 @@ void http_message::parse(std::string message)
399399 *ptr != '<' && *ptr != '>' && *ptr != '[' && *ptr != ']' &&
400400 *ptr != '{' && *ptr != '}' && *ptr != '?' && *ptr != '"' &&
401401 *ptr != '|' && *ptr != '/' && *ptr != '\\'&& *ptr != '\t' ) {
402- LOGGER_PUT_LOG_ERROR(LOG_CAT_PACKET_EDIT_HTTP, 7,
402+ LOGGER_PUT_LOG_INFO(LOG_CAT_PACKET_EDIT_HTTP, 37,
403403 "Parse error: Invalid header field value.(%c)", *ptr);
404404 throw -1;
405405 }
@@ -410,7 +410,7 @@ void http_message::parse(std::string message)
410410 if (*ptr == '\n') {
411411 pos = MESSAGE_LAST_LF;
412412 } else {
413- LOGGER_PUT_LOG_ERROR(LOG_CAT_PACKET_EDIT_HTTP, 8,
413+ LOGGER_PUT_LOG_INFO(LOG_CAT_PACKET_EDIT_HTTP, 38,
414414 "Parse error: No LF.(%c)", *ptr);
415415 throw -1;
416416 }
@@ -436,7 +436,7 @@ void http_message::parse(std::string message)
436436 }
437437 }
438438 catch (...) {
439- LOGGER_PUT_LOG_ERROR(LOG_CAT_PACKET_EDIT_HTTP, 9,
439+ LOGGER_PUT_LOG_INFO(LOG_CAT_PACKET_EDIT_HTTP, 39,
440440 "Exception occured by parsing HTTP message.");
441441 }
442442
--- a/src/http_request.cpp
+++ b/src/http_request.cpp
@@ -337,7 +337,7 @@ void http_request::parse(std::string request)
337337 this->_method.assign(start, ptr);
338338 pos = REQUEST_METHOD_SP;
339339 } else if (!isalpha(*ptr) && !isdigit(*ptr)) { // XXX not enough
340- LOGGER_PUT_LOG_ERROR(LOG_CAT_PACKET_EDIT_HTTP, 10,
340+ LOGGER_PUT_LOG_INFO(LOG_CAT_PACKET_EDIT_HTTP, 1,
341341 "Parse error: Invalid request method.(%c)", *ptr);
342342 throw -1;
343343 }
@@ -395,7 +395,7 @@ void http_request::parse(std::string request)
395395 pos = REQUEST_REQUEST_URI;
396396 start = ptr;
397397 } else {
398- LOGGER_PUT_LOG_ERROR(LOG_CAT_PACKET_EDIT_HTTP, 11,
398+ LOGGER_PUT_LOG_INFO(LOG_CAT_PACKET_EDIT_HTTP, 2,
399399 "Parse error: Invalid request-uri.(%c)", *ptr);
400400 throw -1;
401401 }
@@ -411,7 +411,7 @@ void http_request::parse(std::string request)
411411 *ptr != '@' && *ptr != '!' && *ptr != '$' && *ptr != '-' &&
412412 *ptr != '(' && *ptr != ')' && *ptr != '*' && *ptr != '_' &&
413413 *ptr != ':' && *ptr != ';') {
414- LOGGER_PUT_LOG_ERROR(LOG_CAT_PACKET_EDIT_HTTP, 12,
414+ LOGGER_PUT_LOG_INFO(LOG_CAT_PACKET_EDIT_HTTP, 3,
415415 "Parse error: Invalid request-uri.(%c)", *ptr);
416416 throw -1;
417417 }
@@ -426,7 +426,7 @@ void http_request::parse(std::string request)
426426 pos = REQUEST_HTTP_VERSION_H;
427427 start = ptr;
428428 } else {
429- LOGGER_PUT_LOG_ERROR(LOG_CAT_PACKET_EDIT_HTTP, 13,
429+ LOGGER_PUT_LOG_INFO(LOG_CAT_PACKET_EDIT_HTTP, 4,
430430 "Parse error: Invalid http-version.(%c)", *ptr);
431431 throw -1;
432432 }
@@ -437,7 +437,7 @@ void http_request::parse(std::string request)
437437 if (*ptr == 'T') {
438438 pos = REQUEST_HTTP_VERSION_T1;
439439 } else {
440- LOGGER_PUT_LOG_ERROR(LOG_CAT_PACKET_EDIT_HTTP, 14,
440+ LOGGER_PUT_LOG_INFO(LOG_CAT_PACKET_EDIT_HTTP, 5,
441441 "Parse error: Invalid http-version.(%c)", *ptr);
442442 throw -1;
443443 }
@@ -448,7 +448,7 @@ void http_request::parse(std::string request)
448448 if (*ptr == 'T') {
449449 pos = REQUEST_HTTP_VERSION_T2;
450450 } else {
451- LOGGER_PUT_LOG_ERROR(LOG_CAT_PACKET_EDIT_HTTP, 15,
451+ LOGGER_PUT_LOG_INFO(LOG_CAT_PACKET_EDIT_HTTP, 6,
452452 "Parse error: Invalid http-version.(%c)", *ptr);
453453 throw -1;
454454 }
@@ -459,7 +459,7 @@ void http_request::parse(std::string request)
459459 if (*ptr == 'P') {
460460 pos = REQUEST_HTTP_VERSION_P;
461461 } else {
462- LOGGER_PUT_LOG_ERROR(LOG_CAT_PACKET_EDIT_HTTP, 16,
462+ LOGGER_PUT_LOG_INFO(LOG_CAT_PACKET_EDIT_HTTP, 7,
463463 "Parse error: Invalid http-version.(%c)", *ptr);
464464 throw -1;
465465 }
@@ -470,7 +470,7 @@ void http_request::parse(std::string request)
470470 if (*ptr == '/') {
471471 pos = REQUEST_HTTP_VERSION_SLASH;
472472 } else {
473- LOGGER_PUT_LOG_ERROR(LOG_CAT_PACKET_EDIT_HTTP, 17,
473+ LOGGER_PUT_LOG_INFO(LOG_CAT_PACKET_EDIT_HTTP, 8,
474474 "Parse error: Invalid http-version.(%c)", *ptr);
475475 throw -1;
476476 }
@@ -481,7 +481,7 @@ void http_request::parse(std::string request)
481481 if (isdigit(*ptr)) {
482482 pos = REQUEST_HTTP_VERSION_MAJOR;
483483 } else {
484- LOGGER_PUT_LOG_ERROR(LOG_CAT_PACKET_EDIT_HTTP, 18,
484+ LOGGER_PUT_LOG_INFO(LOG_CAT_PACKET_EDIT_HTTP, 9,
485485 "Parse error: Invalid http-version.(%c)", *ptr);
486486 throw -1;
487487 }
@@ -492,7 +492,7 @@ void http_request::parse(std::string request)
492492 if (*ptr == '.') {
493493 pos = REQUEST_HTTP_VERSION_DOT;
494494 } else if (!isdigit(*ptr)) {
495- LOGGER_PUT_LOG_ERROR(LOG_CAT_PACKET_EDIT_HTTP, 19,
495+ LOGGER_PUT_LOG_INFO(LOG_CAT_PACKET_EDIT_HTTP, 10,
496496 "Parse error: Invalid http-version.(%c)", *ptr);
497497 throw -1;
498498 }
@@ -503,7 +503,7 @@ void http_request::parse(std::string request)
503503 if (isdigit(*ptr)) {
504504 pos = REQUEST_HTTP_VERSION_MINOR;
505505 } else {
506- LOGGER_PUT_LOG_ERROR(LOG_CAT_PACKET_EDIT_HTTP, 20,
506+ LOGGER_PUT_LOG_INFO(LOG_CAT_PACKET_EDIT_HTTP, 11,
507507 "Parse error: Invalid http-version.(%c)", *ptr);
508508 throw -1;
509509 }
@@ -515,7 +515,7 @@ void http_request::parse(std::string request)
515515 pos = REQUEST_CR;
516516 this->_http_version.assign(start, ptr);
517517 } else if (!isdigit(*ptr)) {
518- LOGGER_PUT_LOG_ERROR(LOG_CAT_PACKET_EDIT_HTTP, 21,
518+ LOGGER_PUT_LOG_INFO(LOG_CAT_PACKET_EDIT_HTTP, 12,
519519 "Parse error: Invalid http-version.(%c)", *ptr);
520520 throw -1;
521521 }
@@ -527,7 +527,7 @@ void http_request::parse(std::string request)
527527 pos = REQUEST_LF;
528528 http_message::parse(std::string(ptr + 1, end));
529529 } else {
530- LOGGER_PUT_LOG_ERROR(LOG_CAT_PACKET_EDIT_HTTP, 22,
530+ LOGGER_PUT_LOG_INFO(LOG_CAT_PACKET_EDIT_HTTP, 13,
531531 "Parse error: No LF.(%c)", *ptr);
532532 throw -1;
533533 }
@@ -539,7 +539,7 @@ void http_request::parse(std::string request)
539539 }
540540 }
541541 catch (...) {
542- LOGGER_PUT_LOG_ERROR(LOG_CAT_PACKET_EDIT_HTTP, 23,
542+ LOGGER_PUT_LOG_INFO(LOG_CAT_PACKET_EDIT_HTTP, 14,
543543 "Exception occured by parsing HTTP request.");
544544 }
545545
--- a/src/http_response.cpp
+++ b/src/http_response.cpp
@@ -338,7 +338,7 @@ void http_response::parse(std::string response)
338338 pos = RESPONSE_HTTP_VERSION_H;
339339 start = ptr;
340340 } else {
341- LOGGER_PUT_LOG_ERROR(LOG_CAT_PACKET_EDIT_HTTP, 24,
341+ LOGGER_PUT_LOG_INFO(LOG_CAT_PACKET_EDIT_HTTP, 15,
342342 "Parse error: Invalid http-version.(%c)", *ptr);
343343 throw -1;
344344 }
@@ -349,7 +349,7 @@ void http_response::parse(std::string response)
349349 if (*ptr == 'T') {
350350 pos = RESPONSE_HTTP_VERSION_T1;
351351 } else {
352- LOGGER_PUT_LOG_ERROR(LOG_CAT_PACKET_EDIT_HTTP, 25,
352+ LOGGER_PUT_LOG_INFO(LOG_CAT_PACKET_EDIT_HTTP, 16,
353353 "Parse error: Invalid http-version.(%c)", *ptr);
354354 throw -1;
355355 }
@@ -360,7 +360,7 @@ void http_response::parse(std::string response)
360360 if (*ptr == 'T') {
361361 pos = RESPONSE_HTTP_VERSION_T2;
362362 } else {
363- LOGGER_PUT_LOG_ERROR(LOG_CAT_PACKET_EDIT_HTTP, 26,
363+ LOGGER_PUT_LOG_INFO(LOG_CAT_PACKET_EDIT_HTTP, 17,
364364 "Parse error: Invalid http-version.(%c)", *ptr);
365365 throw -1;
366366 }
@@ -371,7 +371,7 @@ void http_response::parse(std::string response)
371371 if (*ptr == 'P') {
372372 pos = RESPONSE_HTTP_VERSION_P;
373373 } else {
374- LOGGER_PUT_LOG_ERROR(LOG_CAT_PACKET_EDIT_HTTP, 27,
374+ LOGGER_PUT_LOG_INFO(LOG_CAT_PACKET_EDIT_HTTP, 18,
375375 "Parse error: Invalid http-version.(%c)", *ptr);
376376 throw -1;
377377 }
@@ -382,7 +382,7 @@ void http_response::parse(std::string response)
382382 if (*ptr == '/') {
383383 pos = RESPONSE_HTTP_VERSION_SLASH;
384384 } else {
385- LOGGER_PUT_LOG_ERROR(LOG_CAT_PACKET_EDIT_HTTP, 28,
385+ LOGGER_PUT_LOG_INFO(LOG_CAT_PACKET_EDIT_HTTP, 19,
386386 "Parse error: Invalid http-version.(%c)", *ptr);
387387 throw -1;
388388 }
@@ -393,7 +393,7 @@ void http_response::parse(std::string response)
393393 if (isdigit(*ptr)) {
394394 pos = RESPONSE_HTTP_VERSION_MAJOR;
395395 } else {
396- LOGGER_PUT_LOG_ERROR(LOG_CAT_PACKET_EDIT_HTTP, 29,
396+ LOGGER_PUT_LOG_INFO(LOG_CAT_PACKET_EDIT_HTTP, 20,
397397 "Parse error: Invalid http-version.(%c)", *ptr);
398398 throw -1;
399399 }
@@ -404,7 +404,7 @@ void http_response::parse(std::string response)
404404 if (*ptr == '.') {
405405 pos = RESPONSE_HTTP_VERSION_DOT;
406406 } else if (!isdigit(*ptr)) {
407- LOGGER_PUT_LOG_ERROR(LOG_CAT_PACKET_EDIT_HTTP, 30,
407+ LOGGER_PUT_LOG_INFO(LOG_CAT_PACKET_EDIT_HTTP, 21,
408408 "Parse error: Invalid http-version.(%c)", *ptr);
409409 throw -1;
410410 }
@@ -415,7 +415,7 @@ void http_response::parse(std::string response)
415415 if (isdigit(*ptr)) {
416416 pos = RESPONSE_HTTP_VERSION_MINOR;
417417 } else {
418- LOGGER_PUT_LOG_ERROR(LOG_CAT_PACKET_EDIT_HTTP, 31,
418+ LOGGER_PUT_LOG_INFO(LOG_CAT_PACKET_EDIT_HTTP, 22,
419419 "Parse error: Invalid http-version.(%c)", *ptr);
420420 throw -1;
421421 }
@@ -427,7 +427,7 @@ void http_response::parse(std::string response)
427427 pos = RESPONSE_HTTP_VERSION_SP;
428428 this->_http_version.assign(start, ptr);
429429 } else if (!isdigit(*ptr)) {
430- LOGGER_PUT_LOG_ERROR(LOG_CAT_PACKET_EDIT_HTTP, 32,
430+ LOGGER_PUT_LOG_INFO(LOG_CAT_PACKET_EDIT_HTTP, 23,
431431 "Parse error: Invalid http-version.(%c)", *ptr);
432432 throw -1;
433433 }
@@ -442,7 +442,7 @@ void http_response::parse(std::string response)
442442 pos = RESPONSE_STATUS_CODE1;
443443 start = ptr;
444444 } else {
445- LOGGER_PUT_LOG_ERROR(LOG_CAT_PACKET_EDIT_HTTP, 33,
445+ LOGGER_PUT_LOG_INFO(LOG_CAT_PACKET_EDIT_HTTP, 24,
446446 "Parse error: Invalid status-code.(%c)", *ptr);
447447 throw -1;
448448 }
@@ -453,7 +453,7 @@ void http_response::parse(std::string response)
453453 if (isdigit(*ptr)) {
454454 pos = RESPONSE_STATUS_CODE2;
455455 } else {
456- LOGGER_PUT_LOG_ERROR(LOG_CAT_PACKET_EDIT_HTTP, 34,
456+ LOGGER_PUT_LOG_INFO(LOG_CAT_PACKET_EDIT_HTTP, 25,
457457 "Parse error: Invalid status-code.(%c)", *ptr);
458458 throw -1;
459459 }
@@ -464,7 +464,7 @@ void http_response::parse(std::string response)
464464 if (isdigit(*ptr)) {
465465 pos = RESPONSE_STATUS_CODE3;
466466 } else {
467- LOGGER_PUT_LOG_ERROR(LOG_CAT_PACKET_EDIT_HTTP, 35,
467+ LOGGER_PUT_LOG_INFO(LOG_CAT_PACKET_EDIT_HTTP, 26,
468468 "Parse error: Invalid status-code.(%c)", *ptr);
469469 throw -1;
470470 }
@@ -476,7 +476,7 @@ void http_response::parse(std::string response)
476476 pos = RESPONSE_STATUS_CODE_SP;
477477 this->_status_code.assign(start, ptr);
478478 } else {
479- LOGGER_PUT_LOG_ERROR(LOG_CAT_PACKET_EDIT_HTTP, 36,
479+ LOGGER_PUT_LOG_INFO(LOG_CAT_PACKET_EDIT_HTTP, 27,
480480 "Parse error: Invalid status-code.(%c)", *ptr);
481481 throw -1;
482482 }
@@ -494,7 +494,7 @@ void http_response::parse(std::string response)
494494 pos = RESPONSE_REASON_PHRASE;
495495 start = ptr;
496496 } else {
497- LOGGER_PUT_LOG_ERROR(LOG_CAT_PACKET_EDIT_HTTP, 37,
497+ LOGGER_PUT_LOG_INFO(LOG_CAT_PACKET_EDIT_HTTP, 28,
498498 "Parse error: Invalid reason-phrase.(%c)", *ptr);
499499 throw -1;
500500 }
@@ -506,7 +506,7 @@ void http_response::parse(std::string response)
506506 pos = RESPONSE_CR;
507507 this->_reason_phrase.assign(start, ptr);
508508 } else if (*ptr == '\n') {
509- LOGGER_PUT_LOG_ERROR(LOG_CAT_PACKET_EDIT_HTTP, 38,
509+ LOGGER_PUT_LOG_INFO(LOG_CAT_PACKET_EDIT_HTTP, 29,
510510 "Parse error: Invalid reason-phrase.(%c)", *ptr);
511511 throw -1;
512512 }
@@ -518,7 +518,7 @@ void http_response::parse(std::string response)
518518 pos = RESPONSE_LF;
519519 http_message::parse(std::string(ptr + 1, end));
520520 } else {
521- LOGGER_PUT_LOG_ERROR(LOG_CAT_PACKET_EDIT_HTTP, 39,
521+ LOGGER_PUT_LOG_INFO(LOG_CAT_PACKET_EDIT_HTTP, 30,
522522 "Parse error: No LF.(%c)", *ptr);
523523 throw -1;
524524 }
@@ -530,7 +530,7 @@ void http_response::parse(std::string response)
530530 }
531531 }
532532 catch (...) {
533- LOGGER_PUT_LOG_ERROR(LOG_CAT_PACKET_EDIT_HTTP, 40,
533+ LOGGER_PUT_LOG_INFO(LOG_CAT_PACKET_EDIT_HTTP, 31,
534534 "Exception occured by parsing HTTP response.");
535535 }
536536
旧リポジトリブラウザで表示