diff options
author | Christian Grothoff <christian@grothoff.org> | 2011-06-06 11:26:59 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2011-06-06 11:26:59 +0000 |
commit | 59e49f5bfd27f228c73dfbefbc010bbb3fd94774 (patch) | |
tree | 5a60b79cddbbcb6c984b42fa99ec0fe8fef5f67f /src/transport/plugin_transport_tcp.c | |
parent | 8eb690e76dce9788acfc83ea0991f64c31145a01 (diff) | |
download | gnunet-59e49f5bfd27f228c73dfbefbc010bbb3fd94774.tar.gz gnunet-59e49f5bfd27f228c73dfbefbc010bbb3fd94774.zip |
indentation fixed, logging
Diffstat (limited to 'src/transport/plugin_transport_tcp.c')
-rw-r--r-- | src/transport/plugin_transport_tcp.c | 53 |
1 files changed, 33 insertions, 20 deletions
diff --git a/src/transport/plugin_transport_tcp.c b/src/transport/plugin_transport_tcp.c index bbce0d199..8d1f90590 100644 --- a/src/transport/plugin_transport_tcp.c +++ b/src/transport/plugin_transport_tcp.c | |||
@@ -2101,10 +2101,21 @@ handle_tcp_data (void *cls, | |||
2101 | (GNUNET_YES == session->inbound) ? NULL : session->connect_addr, | 2101 | (GNUNET_YES == session->inbound) ? NULL : session->connect_addr, |
2102 | (GNUNET_YES == session->inbound) ? 0 : session->connect_alen); | 2102 | (GNUNET_YES == session->inbound) ? 0 : session->connect_alen); |
2103 | if (delay.rel_value == 0) | 2103 | if (delay.rel_value == 0) |
2104 | GNUNET_SERVER_receive_done (client, GNUNET_OK); | 2104 | { |
2105 | GNUNET_SERVER_receive_done (client, GNUNET_OK); | ||
2106 | } | ||
2105 | else | 2107 | else |
2106 | session->receive_delay_task = | 2108 | { |
2107 | GNUNET_SCHEDULER_add_delayed (delay, &delayed_done, session); | 2109 | #if DEBUG_TCP || 1 |
2110 | GNUNET_log_from (GNUNET_ERROR_TYPE_INFO, | ||
2111 | "tcp", | ||
2112 | "Throttling receiving from `%s' for %llu ms\n", | ||
2113 | GNUNET_i2s (&session->target), | ||
2114 | (unsigned long long) delay.rel_value); | ||
2115 | #endif | ||
2116 | session->receive_delay_task = | ||
2117 | GNUNET_SCHEDULER_add_delayed (delay, &delayed_done, session); | ||
2118 | } | ||
2108 | } | 2119 | } |
2109 | 2120 | ||
2110 | 2121 | ||
@@ -2926,18 +2937,20 @@ libgnunet_plugin_transport_tcp_init (void *cls) | |||
2926 | } | 2937 | } |
2927 | 2938 | ||
2928 | if ((bind_address != NULL) && (internal_address != NULL)) | 2939 | if ((bind_address != NULL) && (internal_address != NULL)) |
2929 | { | 2940 | { |
2930 | if (0 != strcmp(internal_address, bind_address )) | 2941 | if (0 != strcmp(internal_address, bind_address )) |
2931 | { | 2942 | { |
2932 | GNUNET_log_from (GNUNET_ERROR_TYPE_ERROR, | 2943 | GNUNET_log_from (GNUNET_ERROR_TYPE_ERROR, |
2933 | "tcp","Specific bind address `%s' and internal address `%s' must not differ, forcing internal address to bind address!\n", bind_address, internal_address); | 2944 | "tcp", |
2934 | GNUNET_free (internal_address); | 2945 | "Specific bind address `%s' and internal address `%s' must not differ, forcing internal address to bind address!\n", |
2935 | internal_address = bind_address; | 2946 | bind_address, internal_address); |
2936 | GNUNET_log_from (GNUNET_ERROR_TYPE_ERROR, | 2947 | GNUNET_free (internal_address); |
2937 | "tcp","New internal address `%s'\n", internal_address); | 2948 | internal_address = bind_address; |
2938 | } | 2949 | GNUNET_log_from (GNUNET_ERROR_TYPE_ERROR, |
2939 | } | 2950 | "tcp","New internal address `%s'\n", internal_address); |
2940 | 2951 | } | |
2952 | } | ||
2953 | |||
2941 | aport = 0; | 2954 | aport = 0; |
2942 | if ( (GNUNET_OK != | 2955 | if ( (GNUNET_OK != |
2943 | GNUNET_CONFIGURATION_get_value_number (env->cfg, | 2956 | GNUNET_CONFIGURATION_get_value_number (env->cfg, |
@@ -2963,13 +2976,13 @@ libgnunet_plugin_transport_tcp_init (void *cls) | |||
2963 | 2976 | ||
2964 | use_localaddresses = GNUNET_NO; | 2977 | use_localaddresses = GNUNET_NO; |
2965 | if (GNUNET_CONFIGURATION_have_value (env->cfg, | 2978 | if (GNUNET_CONFIGURATION_have_value (env->cfg, |
2966 | "transport-tcp", "USE_LOCALADDR")) | 2979 | "transport-tcp", "USE_LOCALADDR")) |
2967 | { | 2980 | { |
2968 | use_localaddresses = GNUNET_CONFIGURATION_get_value_yesno (env->cfg, | 2981 | use_localaddresses = GNUNET_CONFIGURATION_get_value_yesno (env->cfg, |
2969 | "transport-tcp", | 2982 | "transport-tcp", |
2970 | "USE_LOCALADDR"); | 2983 | "USE_LOCALADDR"); |
2971 | } | 2984 | } |
2972 | 2985 | ||
2973 | if (aport == 0) | 2986 | if (aport == 0) |
2974 | aport = bport; | 2987 | aport = bport; |
2975 | if (bport == 0) | 2988 | if (bport == 0) |