diff options
author | Matthias Wachs <wachs@net.in.tum.de> | 2013-10-07 11:17:02 +0000 |
---|---|---|
committer | Matthias Wachs <wachs@net.in.tum.de> | 2013-10-07 11:17:02 +0000 |
commit | 17056f5c94a79ed04ac10680e5d90d6e17f19b95 (patch) | |
tree | a77040049cb804e09c65233f91332800015ffa82 /src/transport/plugin_transport_udp.c | |
parent | a129eafa4c349d30f6a1323f854bf31d69bb776f (diff) | |
download | gnunet-17056f5c94a79ed04ac10680e5d90d6e17f19b95.tar.gz gnunet-17056f5c94a79ed04ac10680e5d90d6e17f19b95.zip |
- fixing udp address handling for inbound sessions
- fixing some indentation
Diffstat (limited to 'src/transport/plugin_transport_udp.c')
-rw-r--r-- | src/transport/plugin_transport_udp.c | 23 |
1 files changed, 5 insertions, 18 deletions
diff --git a/src/transport/plugin_transport_udp.c b/src/transport/plugin_transport_udp.c index 6327d744f..043633ab1 100644 --- a/src/transport/plugin_transport_udp.c +++ b/src/transport/plugin_transport_udp.c | |||
@@ -578,11 +578,6 @@ udp_address_to_string (void *cls, const void *addr, size_t addrlen) | |||
578 | memcpy (&a4, &t4->ipv4_addr, sizeof (a4)); | 578 | memcpy (&a4, &t4->ipv4_addr, sizeof (a4)); |
579 | sb = &a4; | 579 | sb = &a4; |
580 | } | 580 | } |
581 | else if (addrlen == 0) | ||
582 | { | ||
583 | GNUNET_snprintf (rbuf, sizeof (rbuf), "%s", TRANSPORT_SESSION_INBOUND_STRING); | ||
584 | return rbuf; | ||
585 | } | ||
586 | else | 581 | else |
587 | { | 582 | { |
588 | return NULL; | 583 | return NULL; |
@@ -825,12 +820,6 @@ udp_plugin_address_pretty_printer (void *cls, const char *type, | |||
825 | sb = &a4; | 820 | sb = &a4; |
826 | sbs = sizeof (a4); | 821 | sbs = sizeof (a4); |
827 | } | 822 | } |
828 | else if (0 == addrlen) | ||
829 | { | ||
830 | asc (asc_cls, TRANSPORT_SESSION_INBOUND_STRING); | ||
831 | asc (asc_cls, NULL); | ||
832 | return; | ||
833 | } | ||
834 | else | 823 | else |
835 | { | 824 | { |
836 | /* invalid address */ | 825 | /* invalid address */ |
@@ -2051,9 +2040,7 @@ process_udp_message (struct Plugin *plugin, const struct UDPMessage *msg, | |||
2051 | { | 2040 | { |
2052 | s = udp_plugin_create_session (plugin, address, GNUNET_YES); | 2041 | s = udp_plugin_create_session (plugin, address, GNUNET_YES); |
2053 | plugin->env->session_start (NULL, &address->peer, PLUGIN_NAME, | 2042 | plugin->env->session_start (NULL, &address->peer, PLUGIN_NAME, |
2054 | (GNUNET_YES == s->inbound) ? NULL : address->address, | 2043 | address->address, address->address_length, s, NULL, 0); |
2055 | (GNUNET_YES == s->inbound) ? 0 : address->address_length, | ||
2056 | s, NULL, 0); | ||
2057 | } | 2044 | } |
2058 | GNUNET_free (address); | 2045 | GNUNET_free (address); |
2059 | 2046 | ||
@@ -3118,13 +3105,13 @@ libgnunet_plugin_transport_udp_init (void *cls) | |||
3118 | p->defrag_ctxs = GNUNET_CONTAINER_heap_create (GNUNET_CONTAINER_HEAP_ORDER_MIN); | 3105 | p->defrag_ctxs = GNUNET_CONTAINER_heap_create (GNUNET_CONTAINER_HEAP_ORDER_MIN); |
3119 | p->mst = GNUNET_SERVER_mst_create (&process_inbound_tokenized_messages, p); | 3106 | p->mst = GNUNET_SERVER_mst_create (&process_inbound_tokenized_messages, p); |
3120 | GNUNET_BANDWIDTH_tracker_init (&p->tracker, | 3107 | GNUNET_BANDWIDTH_tracker_init (&p->tracker, |
3121 | GNUNET_BANDWIDTH_value_init ((uint32_t)udp_max_bps), 30); | 3108 | GNUNET_BANDWIDTH_value_init ((uint32_t) udp_max_bps), 30); |
3122 | plugin = p; | 3109 | plugin = p; |
3123 | 3110 | ||
3124 | LOG (GNUNET_ERROR_TYPE_DEBUG, "Setting up sockets\n"); | 3111 | LOG(GNUNET_ERROR_TYPE_DEBUG, "Setting up sockets\n"); |
3125 | res = setup_sockets (p, (GNUNET_YES == have_bind6) ? &serverAddrv6 : NULL, | 3112 | res = setup_sockets (p, (GNUNET_YES == have_bind6) ? &serverAddrv6 : NULL, |
3126 | (GNUNET_YES == have_bind4) ? &serverAddrv4 : NULL); | 3113 | (GNUNET_YES == have_bind4) ? &serverAddrv4 : NULL ); |
3127 | if ((res == 0) || ((p->sockv4 == NULL) && (p->sockv6 == NULL))) | 3114 | if ((res == 0) || ((p->sockv4 == NULL )&& (p->sockv6 == NULL))) |
3128 | { | 3115 | { |
3129 | LOG (GNUNET_ERROR_TYPE_ERROR, | 3116 | LOG (GNUNET_ERROR_TYPE_ERROR, |
3130 | _("Failed to create network sockets, plugin failed\n")); | 3117 | _("Failed to create network sockets, plugin failed\n")); |