diff options
author | Christian Grothoff <christian@grothoff.org> | 2012-09-16 11:27:08 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2012-09-16 11:27:08 +0000 |
commit | f736b24935d66733e9a53798fbc87dbc8aff9fca (patch) | |
tree | b7f865216ca4b40a4a6e4535dfa6677700a27efc /src/core | |
parent | c5784d2c94adcf1fe80e88c9ab1c152ce2fcbe95 (diff) | |
download | gnunet-f736b24935d66733e9a53798fbc87dbc8aff9fca.tar.gz gnunet-f736b24935d66733e9a53798fbc87dbc8aff9fca.zip |
-fixing #2546
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/gnunet-core.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/src/core/gnunet-core.c b/src/core/gnunet-core.c index ebdd8aab3..571a2a53d 100644 --- a/src/core/gnunet-core.c +++ b/src/core/gnunet-core.c | |||
@@ -110,7 +110,8 @@ monitor_notify_connect (void *cls, const struct GNUNET_PeerIdentity *peer, | |||
110 | const struct GNUNET_ATS_Information *ats, uint32_t ats_count) | 110 | const struct GNUNET_ATS_Information *ats, uint32_t ats_count) |
111 | { | 111 | { |
112 | struct GNUNET_TIME_Absolute now = GNUNET_TIME_absolute_get(); | 112 | struct GNUNET_TIME_Absolute now = GNUNET_TIME_absolute_get(); |
113 | char *now_str; | 113 | const char *now_str; |
114 | |||
114 | if (0 != memcmp (&my_id, peer, sizeof (my_id))) | 115 | if (0 != memcmp (&my_id, peer, sizeof (my_id))) |
115 | { | 116 | { |
116 | monitor_connections_counter ++; | 117 | monitor_connections_counter ++; |
@@ -120,8 +121,6 @@ monitor_notify_connect (void *cls, const struct GNUNET_PeerIdentity *peer, | |||
120 | _("Connected to"), | 121 | _("Connected to"), |
121 | GNUNET_i2s (peer), | 122 | GNUNET_i2s (peer), |
122 | monitor_connections_counter); | 123 | monitor_connections_counter); |
123 | |||
124 | GNUNET_free (now_str); | ||
125 | } | 124 | } |
126 | } | 125 | } |
127 | 126 | ||
@@ -137,21 +136,19 @@ static void | |||
137 | monitor_notify_disconnect (void *cls, const struct GNUNET_PeerIdentity *peer) | 136 | monitor_notify_disconnect (void *cls, const struct GNUNET_PeerIdentity *peer) |
138 | { | 137 | { |
139 | struct GNUNET_TIME_Absolute now = GNUNET_TIME_absolute_get(); | 138 | struct GNUNET_TIME_Absolute now = GNUNET_TIME_absolute_get(); |
140 | char *now_str; | 139 | const char *now_str; |
141 | 140 | ||
142 | if (0 != memcmp (&my_id, peer, sizeof (my_id))) | 141 | if (0 != memcmp (&my_id, peer, sizeof (my_id))) |
143 | { | 142 | { |
144 | now_str = GNUNET_STRINGS_absolute_time_to_string (now); | 143 | now_str = GNUNET_STRINGS_absolute_time_to_string (now); |
145 | 144 | ||
146 | GNUNET_assert (monitor_connections_counter > 0); | 145 | GNUNET_assert (monitor_connections_counter > 0); |
147 | monitor_connections_counter --; | 146 | monitor_connections_counter--; |
148 | |||
149 | FPRINTF (stdout, _("%24s: %-17s %4s (%u connections in total)\n"), | 147 | FPRINTF (stdout, _("%24s: %-17s %4s (%u connections in total)\n"), |
150 | now_str, | 148 | now_str, |
151 | _("Disconnected from"), | 149 | _("Disconnected from"), |
152 | GNUNET_i2s (peer), | 150 | GNUNET_i2s (peer), |
153 | monitor_connections_counter); | 151 | monitor_connections_counter); |
154 | GNUNET_free (now_str); | ||
155 | } | 152 | } |
156 | } | 153 | } |
157 | 154 | ||