diff options
Diffstat (limited to 'src/util/common_logging.c')
-rw-r--r-- | src/util/common_logging.c | 22 |
1 files changed, 9 insertions, 13 deletions
diff --git a/src/util/common_logging.c b/src/util/common_logging.c index 37f630854..ff3ac12ee 100644 --- a/src/util/common_logging.c +++ b/src/util/common_logging.c | |||
@@ -279,8 +279,8 @@ GNUNET_logger_remove (GNUNET_Logger logger, void *logger_cls) | |||
279 | * @param msg the actual message | 279 | * @param msg the actual message |
280 | */ | 280 | */ |
281 | static void | 281 | static void |
282 | output_message (enum GNUNET_ErrorType kind, | 282 | output_message (enum GNUNET_ErrorType kind, const char *comp, |
283 | const char *comp, const char *datestr, const char *msg) | 283 | const char *datestr, const char *msg) |
284 | { | 284 | { |
285 | struct CustomLogger *pos; | 285 | struct CustomLogger *pos; |
286 | 286 | ||
@@ -371,8 +371,8 @@ GNUNET_log_skip (unsigned int n, int check_reset) | |||
371 | * @param va arguments to the format string "message" | 371 | * @param va arguments to the format string "message" |
372 | */ | 372 | */ |
373 | static void | 373 | static void |
374 | mylog (enum GNUNET_ErrorType kind, | 374 | mylog (enum GNUNET_ErrorType kind, const char *comp, const char *message, |
375 | const char *comp, const char *message, va_list va) | 375 | va_list va) |
376 | { | 376 | { |
377 | char date[DATE_STR_SIZE]; | 377 | char date[DATE_STR_SIZE]; |
378 | char date2[DATE_STR_SIZE]; | 378 | char date2[DATE_STR_SIZE]; |
@@ -419,9 +419,8 @@ mylog (enum GNUNET_ErrorType kind, | |||
419 | } | 419 | } |
420 | else | 420 | else |
421 | strcpy (date, "localtime error"); | 421 | strcpy (date, "localtime error"); |
422 | if ((0 != (kind & GNUNET_ERROR_TYPE_BULK)) && | 422 | if ((0 != (kind & GNUNET_ERROR_TYPE_BULK)) && (last_bulk_time.abs_value != 0) |
423 | (last_bulk_time.abs_value != 0) && | 423 | && (0 == strncmp (buf, last_bulk, sizeof (last_bulk)))) |
424 | (0 == strncmp (buf, last_bulk, sizeof (last_bulk)))) | ||
425 | { | 424 | { |
426 | last_bulk_repeat++; | 425 | last_bulk_repeat++; |
427 | if ((GNUNET_TIME_absolute_get_duration (last_bulk_time).rel_value > | 426 | if ((GNUNET_TIME_absolute_get_duration (last_bulk_time).rel_value > |
@@ -469,8 +468,8 @@ GNUNET_log (enum GNUNET_ErrorType kind, const char *message, ...) | |||
469 | * @param ... arguments for format string | 468 | * @param ... arguments for format string |
470 | */ | 469 | */ |
471 | void | 470 | void |
472 | GNUNET_log_from (enum GNUNET_ErrorType kind, | 471 | GNUNET_log_from (enum GNUNET_ErrorType kind, const char *comp, |
473 | const char *comp, const char *message, ...) | 472 | const char *message, ...) |
474 | { | 473 | { |
475 | va_list va; | 474 | va_list va; |
476 | char comp_w_pid[128]; | 475 | char comp_w_pid[128]; |
@@ -614,10 +613,7 @@ GNUNET_a2s (const struct sockaddr *addr, socklen_t addrlen) | |||
614 | off = 0; | 613 | off = 0; |
615 | if (un->sun_path[0] == '\0') | 614 | if (un->sun_path[0] == '\0') |
616 | off++; | 615 | off++; |
617 | snprintf (buf, | 616 | snprintf (buf, sizeof (buf), "%s%.*s", (off == 1) ? "@" : "", |
618 | sizeof (buf), | ||
619 | "%s%.*s", | ||
620 | (off == 1) ? "@" : "", | ||
621 | (int) (addrlen - sizeof (sa_family_t) - 1 - off), | 617 | (int) (addrlen - sizeof (sa_family_t) - 1 - off), |
622 | &un->sun_path[off]); | 618 | &un->sun_path[off]); |
623 | return buf; | 619 | return buf; |