diff options
author | LRN <lrn1986@gmail.com> | 2013-12-15 01:56:00 +0000 |
---|---|---|
committer | LRN <lrn1986@gmail.com> | 2013-12-15 01:56:00 +0000 |
commit | 4e67f0c94b70b5c84502080485fee34d546a76cf (patch) | |
tree | 98e9aa18e390910831e8212c2bccc3641b02f23e /src/transport/plugin_transport_udp.c | |
parent | 5d8f6a7b2711cbabb7bd2d0104da03e2f67b4fd8 (diff) | |
download | gnunet-4e67f0c94b70b5c84502080485fee34d546a76cf.tar.gz gnunet-4e67f0c94b70b5c84502080485fee34d546a76cf.zip |
Non-uniform keepalive timeout for different plugins
Diffstat (limited to 'src/transport/plugin_transport_udp.c')
-rw-r--r-- | src/transport/plugin_transport_udp.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/transport/plugin_transport_udp.c b/src/transport/plugin_transport_udp.c index 904473ace..fb08e4349 100644 --- a/src/transport/plugin_transport_udp.c +++ b/src/transport/plugin_transport_udp.c | |||
@@ -1314,6 +1314,21 @@ udp_disconnect_session (void *cls, | |||
1314 | 1314 | ||
1315 | 1315 | ||
1316 | /** | 1316 | /** |
1317 | * Function that is called to get the keepalive factor. | ||
1318 | * GNUNET_CONSTANTS_IDLE_CONNECTION_TIMEOUT is divided by this number to | ||
1319 | * calculate the interval between keepalive packets. | ||
1320 | * | ||
1321 | * @param cls closure with the `struct Plugin` | ||
1322 | * @return keepalive factor | ||
1323 | */ | ||
1324 | static unsigned int | ||
1325 | udp_query_keepalive_factor (void *cls) | ||
1326 | { | ||
1327 | return 15; | ||
1328 | } | ||
1329 | |||
1330 | |||
1331 | /** | ||
1317 | * Destroy a session, plugin is being unloaded. | 1332 | * Destroy a session, plugin is being unloaded. |
1318 | * | 1333 | * |
1319 | * @param cls the `struct Plugin` | 1334 | * @param cls the `struct Plugin` |
@@ -3169,6 +3184,7 @@ libgnunet_plugin_transport_udp_init (void *cls) | |||
3169 | api->cls = p; | 3184 | api->cls = p; |
3170 | api->send = NULL; | 3185 | api->send = NULL; |
3171 | api->disconnect_session = &udp_disconnect_session; | 3186 | api->disconnect_session = &udp_disconnect_session; |
3187 | api->query_keepalive_factor = &udp_query_keepalive_factor; | ||
3172 | api->disconnect_peer = &udp_disconnect; | 3188 | api->disconnect_peer = &udp_disconnect; |
3173 | api->address_pretty_printer = &udp_plugin_address_pretty_printer; | 3189 | api->address_pretty_printer = &udp_plugin_address_pretty_printer; |
3174 | api->address_to_string = &udp_address_to_string; | 3190 | api->address_to_string = &udp_address_to_string; |