diff options
author | Matthias Wachs <wachs@net.in.tum.de> | 2013-12-12 10:43:34 +0000 |
---|---|---|
committer | Matthias Wachs <wachs@net.in.tum.de> | 2013-12-12 10:43:34 +0000 |
commit | 8dfec60ba8c701bcec31ac71c3d6f65f0c09570d (patch) | |
tree | a9e9b9c3789a0ff3dd94b92777e32dc4cdd842a6 /src/transport/plugin_transport_udp.c | |
parent | 56bfc1608f8cb90f13bd2263ce0f1bd14f77159e (diff) | |
download | gnunet-8dfec60ba8c701bcec31ac71c3d6f65f0c09570d.tar.gz gnunet-8dfec60ba8c701bcec31ac71c3d6f65f0c09570d.zip |
shorter session timeout for UDP
Diffstat (limited to 'src/transport/plugin_transport_udp.c')
-rw-r--r-- | src/transport/plugin_transport_udp.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/transport/plugin_transport_udp.c b/src/transport/plugin_transport_udp.c index 7f442cff0..9bc579b2f 100644 --- a/src/transport/plugin_transport_udp.c +++ b/src/transport/plugin_transport_udp.c | |||
@@ -42,6 +42,8 @@ | |||
42 | 42 | ||
43 | #define LOG(kind,...) GNUNET_log_from (kind, "transport-udp", __VA_ARGS__) | 43 | #define LOG(kind,...) GNUNET_log_from (kind, "transport-udp", __VA_ARGS__) |
44 | 44 | ||
45 | #define UDP_SESSION_TIME_OUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 60) | ||
46 | |||
45 | #define PLUGIN_NAME "udp" | 47 | #define PLUGIN_NAME "udp" |
46 | 48 | ||
47 | /** | 49 | /** |
@@ -1324,7 +1326,7 @@ session_timeout (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
1324 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 1326 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
1325 | "Session %p was idle for %s, disconnecting\n", | 1327 | "Session %p was idle for %s, disconnecting\n", |
1326 | s, | 1328 | s, |
1327 | GNUNET_STRINGS_relative_time_to_string (GNUNET_CONSTANTS_IDLE_CONNECTION_TIMEOUT, | 1329 | GNUNET_STRINGS_relative_time_to_string (UDP_SESSION_TIME_OUT, |
1328 | GNUNET_YES)); | 1330 | GNUNET_YES)); |
1329 | /* call session destroy function */ | 1331 | /* call session destroy function */ |
1330 | disconnect_session (s); | 1332 | disconnect_session (s); |
@@ -1339,13 +1341,13 @@ start_session_timeout (struct Session *s) | |||
1339 | { | 1341 | { |
1340 | GNUNET_assert (NULL != s); | 1342 | GNUNET_assert (NULL != s); |
1341 | GNUNET_assert (GNUNET_SCHEDULER_NO_TASK == s->timeout_task); | 1343 | GNUNET_assert (GNUNET_SCHEDULER_NO_TASK == s->timeout_task); |
1342 | s->timeout_task = GNUNET_SCHEDULER_add_delayed (GNUNET_CONSTANTS_IDLE_CONNECTION_TIMEOUT, | 1344 | s->timeout_task = GNUNET_SCHEDULER_add_delayed (UDP_SESSION_TIME_OUT, |
1343 | &session_timeout, | 1345 | &session_timeout, |
1344 | s); | 1346 | s); |
1345 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 1347 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
1346 | "Timeout for session %p set to %s\n", | 1348 | "Timeout for session %p set to %s\n", |
1347 | s, | 1349 | s, |
1348 | GNUNET_STRINGS_relative_time_to_string (GNUNET_CONSTANTS_IDLE_CONNECTION_TIMEOUT, | 1350 | GNUNET_STRINGS_relative_time_to_string (UDP_SESSION_TIME_OUT, |
1349 | GNUNET_YES)); | 1351 | GNUNET_YES)); |
1350 | } | 1352 | } |
1351 | 1353 | ||
@@ -1360,13 +1362,13 @@ reschedule_session_timeout (struct Session *s) | |||
1360 | GNUNET_assert (GNUNET_SCHEDULER_NO_TASK != s->timeout_task); | 1362 | GNUNET_assert (GNUNET_SCHEDULER_NO_TASK != s->timeout_task); |
1361 | 1363 | ||
1362 | GNUNET_SCHEDULER_cancel (s->timeout_task); | 1364 | GNUNET_SCHEDULER_cancel (s->timeout_task); |
1363 | s->timeout_task = GNUNET_SCHEDULER_add_delayed (GNUNET_CONSTANTS_IDLE_CONNECTION_TIMEOUT, | 1365 | s->timeout_task = GNUNET_SCHEDULER_add_delayed (UDP_SESSION_TIME_OUT, |
1364 | &session_timeout, | 1366 | &session_timeout, |
1365 | s); | 1367 | s); |
1366 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 1368 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
1367 | "Timeout rescheduled for session %p set to %s\n", | 1369 | "Timeout rescheduled for session %p set to %s\n", |
1368 | s, | 1370 | s, |
1369 | GNUNET_STRINGS_relative_time_to_string (GNUNET_CONSTANTS_IDLE_CONNECTION_TIMEOUT, | 1371 | GNUNET_STRINGS_relative_time_to_string (UDP_SESSION_TIME_OUT, |
1370 | GNUNET_YES)); | 1372 | GNUNET_YES)); |
1371 | } | 1373 | } |
1372 | 1374 | ||