diff options
author | Christian Grothoff <christian@grothoff.org> | 2015-01-25 21:10:45 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2015-01-25 21:10:45 +0000 |
commit | e01037e54bc0a7b4134b38be25e2eb5985c6ac81 (patch) | |
tree | be914cf302c045ec567445e0273cf7c2c2e35ad3 | |
parent | facc8baebdfd3957732f118912e2655ff4bb4baf (diff) | |
download | gnunet-e01037e54bc0a7b4134b38be25e2eb5985c6ac81.tar.gz gnunet-e01037e54bc0a7b4134b38be25e2eb5985c6ac81.zip |
-pass closure, indentation fixes
-rw-r--r-- | src/transport/plugin_transport_tcp.c | 46 |
1 files changed, 28 insertions, 18 deletions
diff --git a/src/transport/plugin_transport_tcp.c b/src/transport/plugin_transport_tcp.c index 01a4eade8..770525f21 100644 --- a/src/transport/plugin_transport_tcp.c +++ b/src/transport/plugin_transport_tcp.c | |||
@@ -2261,8 +2261,9 @@ handle_tcp_welcome (void *cls, | |||
2261 | struct GNUNET_ATS_Information ats; | 2261 | struct GNUNET_ATS_Information ats; |
2262 | 2262 | ||
2263 | 2263 | ||
2264 | if (0 == memcmp (&wm->clientIdentity, plugin->env->my_identity, | 2264 | if (0 == memcmp (&wm->clientIdentity, |
2265 | sizeof(struct GNUNET_PeerIdentity))) | 2265 | plugin->env->my_identity, |
2266 | sizeof(struct GNUNET_PeerIdentity))) | ||
2266 | { | 2267 | { |
2267 | /* refuse connections from ourselves */ | 2268 | /* refuse connections from ourselves */ |
2268 | GNUNET_SERVER_receive_done (client, GNUNET_SYSERR); | 2269 | GNUNET_SERVER_receive_done (client, GNUNET_SYSERR); |
@@ -2277,10 +2278,14 @@ handle_tcp_welcome (void *cls, | |||
2277 | return; | 2278 | return; |
2278 | } | 2279 | } |
2279 | 2280 | ||
2280 | LOG(GNUNET_ERROR_TYPE_DEBUG, "Received %s message from `%4s' %p\n", "WELCOME", | 2281 | LOG(GNUNET_ERROR_TYPE_DEBUG, |
2282 | "Received %s message from `%4s' %p\n", | ||
2283 | "WELCOME", | ||
2281 | GNUNET_i2s (&wm->clientIdentity), client); | 2284 | GNUNET_i2s (&wm->clientIdentity), client); |
2282 | GNUNET_STATISTICS_update (plugin->env->stats, | 2285 | GNUNET_STATISTICS_update (plugin->env->stats, |
2283 | gettext_noop ("# TCP WELCOME messages received"), 1, GNUNET_NO); | 2286 | gettext_noop ("# TCP WELCOME messages received"), |
2287 | 1, | ||
2288 | GNUNET_NO); | ||
2284 | session = lookup_session_by_client (plugin, client); | 2289 | session = lookup_session_by_client (plugin, client); |
2285 | if (NULL != session) | 2290 | if (NULL != session) |
2286 | { | 2291 | { |
@@ -2288,8 +2293,9 @@ handle_tcp_welcome (void *cls, | |||
2288 | { | 2293 | { |
2289 | LOG (GNUNET_ERROR_TYPE_DEBUG, | 2294 | LOG (GNUNET_ERROR_TYPE_DEBUG, |
2290 | "Found existing session %p for peer `%s'\n", | 2295 | "Found existing session %p for peer `%s'\n", |
2291 | session, GNUNET_a2s (vaddr, alen)); | 2296 | session, |
2292 | GNUNET_free(vaddr); | 2297 | GNUNET_a2s (vaddr, alen)); |
2298 | GNUNET_free (vaddr); | ||
2293 | } | 2299 | } |
2294 | } | 2300 | } |
2295 | else | 2301 | else |
@@ -2337,23 +2343,27 @@ handle_tcp_welcome (void *cls, | |||
2337 | session->ats_address_network_type = plugin->env->get_address_type (plugin->env->cls, vaddr, alen); | 2343 | session->ats_address_network_type = plugin->env->get_address_type (plugin->env->cls, vaddr, alen); |
2338 | ats.type = htonl (GNUNET_ATS_NETWORK_TYPE); | 2344 | ats.type = htonl (GNUNET_ATS_NETWORK_TYPE); |
2339 | ats.value = htonl (session->ats_address_network_type); | 2345 | ats.value = htonl (session->ats_address_network_type); |
2340 | LOG(GNUNET_ERROR_TYPE_DEBUG, | 2346 | LOG (GNUNET_ERROR_TYPE_DEBUG, |
2341 | "Creating new%s session %p for peer `%s' client %p \n", | 2347 | "Creating new%s session %p for peer `%s' client %p \n", |
2342 | GNUNET_HELLO_address_check_option (session->address, | 2348 | GNUNET_HELLO_address_check_option (session->address, |
2343 | GNUNET_HELLO_ADDRESS_INFO_INBOUND) | 2349 | GNUNET_HELLO_ADDRESS_INFO_INBOUND) |
2344 | ? " inbound" : "", | 2350 | ? " inbound" : "", |
2345 | session, | 2351 | session, |
2346 | tcp_plugin_address_to_string(NULL, (void *) session->address->address, | 2352 | tcp_plugin_address_to_string (NULL, |
2347 | session->address->address_length), | 2353 | (void *) session->address->address, |
2348 | client); | 2354 | session->address->address_length), |
2349 | GNUNET_free(vaddr); | 2355 | client); |
2350 | GNUNET_SERVER_client_set_user_context(session->client, session); | 2356 | GNUNET_free (vaddr); |
2357 | GNUNET_SERVER_client_set_user_context (session->client, session); | ||
2351 | GNUNET_CONTAINER_multipeermap_put (plugin->sessionmap, | 2358 | GNUNET_CONTAINER_multipeermap_put (plugin->sessionmap, |
2352 | &session->target, | 2359 | &session->target, |
2353 | session, | 2360 | session, |
2354 | GNUNET_CONTAINER_MULTIHASHMAPOPTION_MULTIPLE); | 2361 | GNUNET_CONTAINER_MULTIHASHMAPOPTION_MULTIPLE); |
2355 | /* Notify transport and ATS about new session */ | 2362 | /* Notify transport and ATS about new session */ |
2356 | plugin->env->session_start (NULL, session->address, session, &ats, 1); | 2363 | plugin->env->session_start (plugin->env->cls, |
2364 | session->address, | ||
2365 | session, | ||
2366 | &ats, 1); | ||
2357 | notify_session_monitor (plugin, | 2367 | notify_session_monitor (plugin, |
2358 | session, | 2368 | session, |
2359 | GNUNET_TRANSPORT_SS_INIT); | 2369 | GNUNET_TRANSPORT_SS_INIT); |