diff options
author | Sree Harsha Totakura <totakura@in.tum.de> | 2013-05-08 14:26:24 +0000 |
---|---|---|
committer | Sree Harsha Totakura <totakura@in.tum.de> | 2013-05-08 14:26:24 +0000 |
commit | d572acdffc00a8e70912558d99af608a00dc8cdd (patch) | |
tree | abd46c4e74eed450e3ae6f13f416589974de4cc8 | |
parent | 7bf3ac6b107974065f4c91774626506f1e9459a3 (diff) | |
download | gnunet-d572acdffc00a8e70912558d99af608a00dc8cdd.tar.gz gnunet-d572acdffc00a8e70912558d99af608a00dc8cdd.zip |
- flush logger data before disconnecting
-rw-r--r-- | src/nse/gnunet-service-nse.c | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/src/nse/gnunet-service-nse.c b/src/nse/gnunet-service-nse.c index 536d36a35..433274372 100644 --- a/src/nse/gnunet-service-nse.c +++ b/src/nse/gnunet-service-nse.c | |||
@@ -1266,6 +1266,23 @@ handle_core_disconnect (void *cls, const struct GNUNET_PeerIdentity *peer) | |||
1266 | } | 1266 | } |
1267 | 1267 | ||
1268 | 1268 | ||
1269 | #if ENABLE_NSE_HISTOGRAM | ||
1270 | /** | ||
1271 | * Functions of this type are called to notify a successful transmission of the | ||
1272 | * message to the logger service | ||
1273 | * | ||
1274 | * @param cls NULL | ||
1275 | * @param size the amount of data sent | ||
1276 | */ | ||
1277 | static void | ||
1278 | flush_comp_cb (void *cls, size_t size) | ||
1279 | { | ||
1280 | GNUNET_TESTBED_LOGGER_disconnect (lh); | ||
1281 | lh = NULL; | ||
1282 | } | ||
1283 | #endif | ||
1284 | |||
1285 | |||
1269 | /** | 1286 | /** |
1270 | * Task run during shutdown. | 1287 | * Task run during shutdown. |
1271 | * | 1288 | * |
@@ -1317,8 +1334,7 @@ shutdown_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
1317 | my_private_key = NULL; | 1334 | my_private_key = NULL; |
1318 | } | 1335 | } |
1319 | #if ENABLE_NSE_HISTOGRAM | 1336 | #if ENABLE_NSE_HISTOGRAM |
1320 | GNUNET_TESTBED_LOGGER_disconnect (lh); | 1337 | GNUNET_TESTBED_LOGGER_flush (lh, &flush_comp_cb, NULL); /* actual shutdown delayed */ |
1321 | lh = NULL; | ||
1322 | #endif | 1338 | #endif |
1323 | } | 1339 | } |
1324 | 1340 | ||