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_tcp.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_tcp.c')
-rw-r--r-- | src/transport/plugin_transport_tcp.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/transport/plugin_transport_tcp.c b/src/transport/plugin_transport_tcp.c index e22e01cee..992729911 100644 --- a/src/transport/plugin_transport_tcp.c +++ b/src/transport/plugin_transport_tcp.c | |||
@@ -865,6 +865,21 @@ tcp_disconnect_session (void *cls, | |||
865 | 865 | ||
866 | 866 | ||
867 | /** | 867 | /** |
868 | * Function that is called to get the keepalive factor. | ||
869 | * GNUNET_CONSTANTS_IDLE_CONNECTION_TIMEOUT is divided by this number to | ||
870 | * calculate the interval between keepalive packets. | ||
871 | * | ||
872 | * @param cls closure with the `struct Plugin` | ||
873 | * @return keepalive factor | ||
874 | */ | ||
875 | static unsigned int | ||
876 | tcp_query_keepalive_factor (void *cls) | ||
877 | { | ||
878 | return 3; | ||
879 | } | ||
880 | |||
881 | |||
882 | /** | ||
868 | * Session was idle, so disconnect it | 883 | * Session was idle, so disconnect it |
869 | * | 884 | * |
870 | * @param cls the `struct Session` of the idle session | 885 | * @param cls the `struct Session` of the idle session |
@@ -2665,6 +2680,7 @@ libgnunet_plugin_transport_tcp_init (void *cls) | |||
2665 | api->get_session = &tcp_plugin_get_session; | 2680 | api->get_session = &tcp_plugin_get_session; |
2666 | 2681 | ||
2667 | api->disconnect_session = &tcp_disconnect_session; | 2682 | api->disconnect_session = &tcp_disconnect_session; |
2683 | api->query_keepalive_factor = &tcp_query_keepalive_factor; | ||
2668 | api->disconnect_peer = &tcp_plugin_disconnect; | 2684 | api->disconnect_peer = &tcp_plugin_disconnect; |
2669 | api->address_pretty_printer = &tcp_plugin_address_pretty_printer; | 2685 | api->address_pretty_printer = &tcp_plugin_address_pretty_printer; |
2670 | api->check_address = &tcp_plugin_check_address; | 2686 | api->check_address = &tcp_plugin_check_address; |