aboutsummaryrefslogtreecommitdiff
path: root/src/util/common_logging.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2010-03-15 13:32:48 +0000
committerChristian Grothoff <christian@grothoff.org>2010-03-15 13:32:48 +0000
commit5492aa554df9bc5b4f98714117732976469325e8 (patch)
tree5af871da8a613db31091f6bcd3d8cfbe98b6918c /src/util/common_logging.c
parent27a1f7a5af21adb6b09d0d642df632e3341f9e35 (diff)
downloadgnunet-5492aa554df9bc5b4f98714117732976469325e8.tar.gz
gnunet-5492aa554df9bc5b4f98714117732976469325e8.zip
copy component name for bulk due to possibility of plugin unloading
Diffstat (limited to 'src/util/common_logging.c')
-rw-r--r--src/util/common_logging.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/util/common_logging.c b/src/util/common_logging.c
index a19821511..9d7b0de1f 100644
--- a/src/util/common_logging.c
+++ b/src/util/common_logging.c
@@ -50,6 +50,12 @@
50#define BULK_TRACK_SIZE 256 50#define BULK_TRACK_SIZE 256
51 51
52/** 52/**
53 * How many characters do we use for matching of
54 * bulk components?
55 */
56#define COMP_TRACK_SIZE 32
57
58/**
53 * How many characters can a date/time string 59 * How many characters can a date/time string
54 * be at most? 60 * be at most?
55 */ 61 */
@@ -99,9 +105,9 @@ static struct GNUNET_TIME_Absolute last_bulk_time;
99static unsigned int last_bulk_repeat; 105static unsigned int last_bulk_repeat;
100 106
101/** 107/**
102 * Component when the last bulk was logged. 108 * Component when the last bulk was logged. Will be 0-terminated.
103 */ 109 */
104static const char *last_bulk_comp; 110static char last_bulk_comp[COMP_TRACK_SIZE+1];
105 111
106/** 112/**
107 * Running component. 113 * Running component.
@@ -379,7 +385,7 @@ mylog (enum GNUNET_ErrorType kind,
379 last_bulk_repeat = 0; 385 last_bulk_repeat = 0;
380 last_bulk_kind = kind; 386 last_bulk_kind = kind;
381 last_bulk_time = GNUNET_TIME_absolute_get (); 387 last_bulk_time = GNUNET_TIME_absolute_get ();
382 last_bulk_comp = comp; 388 strncpy (last_bulk_comp, comp, sizeof (last_bulk_comp));
383 output_message (kind, comp, date, buf); 389 output_message (kind, comp, date, buf);
384 free (buf); 390 free (buf);
385} 391}