diff options
author | Philipp Tölke <toelke@in.tum.de> | 2011-07-27 07:28:24 +0000 |
---|---|---|
committer | Philipp Tölke <toelke@in.tum.de> | 2011-07-27 07:28:24 +0000 |
commit | 66728692d4f79d4dd72e794900a1b4f6e0a39300 (patch) | |
tree | 9de5d90160ae7762c4d526c7165945f64ec19e0c /src/vpn | |
parent | 3b2f2088bdf9b864faebb484bddd4fd7ca0a8455 (diff) | |
download | gnunet-66728692d4f79d4dd72e794900a1b4f6e0a39300.tar.gz gnunet-66728692d4f79d4dd72e794900a1b4f6e0a39300.zip |
tcp is not udp!
Diffstat (limited to 'src/vpn')
-rw-r--r-- | src/vpn/gnunet-daemon-exit.c | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/src/vpn/gnunet-daemon-exit.c b/src/vpn/gnunet-daemon-exit.c index c061780a1..d29765627 100644 --- a/src/vpn/gnunet-daemon-exit.c +++ b/src/vpn/gnunet-daemon-exit.c | |||
@@ -408,7 +408,11 @@ tcp_from_helper (struct tcp_pkt *tcp, unsigned char *dadr, size_t addrlen, | |||
408 | struct redirect_state *state = | 408 | struct redirect_state *state = |
409 | GNUNET_CONTAINER_multihashmap_get (tcp_connections, &hash); | 409 | GNUNET_CONTAINER_multihashmap_get (tcp_connections, &hash); |
410 | 410 | ||
411 | if (state == NULL) return; | 411 | if (state == NULL) |
412 | { | ||
413 | GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, "No mapping for this connection; hash is %x\n", *((uint32_t*)&hash)); | ||
414 | return; | ||
415 | } | ||
412 | 416 | ||
413 | /* Mark this connection as freshly used */ | 417 | /* Mark this connection as freshly used */ |
414 | GNUNET_CONTAINER_heap_update_cost (tcp_connections_heap, state->heap_node, | 418 | GNUNET_CONTAINER_heap_update_cost (tcp_connections_heap, state->heap_node, |
@@ -1051,19 +1055,21 @@ receive_tcp_remote (void *cls __attribute__((unused)), | |||
1051 | 1055 | ||
1052 | hash_redirect_info (&state->hash, &state->redirect_info, s->addrlen); | 1056 | hash_redirect_info (&state->hash, &state->redirect_info, s->addrlen); |
1053 | 1057 | ||
1058 | GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, "Packet from remote; hash is %x\n", *((uint32_t*)&state->hash)); | ||
1059 | |||
1054 | if (GNUNET_NO == | 1060 | if (GNUNET_NO == |
1055 | GNUNET_CONTAINER_multihashmap_contains (udp_connections, &state->hash)) | 1061 | GNUNET_CONTAINER_multihashmap_contains (tcp_connections, &state->hash)) |
1056 | { | 1062 | { |
1057 | GNUNET_CONTAINER_multihashmap_put (udp_connections, &state->hash, state, | 1063 | GNUNET_CONTAINER_multihashmap_put (tcp_connections, &state->hash, state, |
1058 | GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_ONLY); | 1064 | GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_ONLY); |
1059 | 1065 | ||
1060 | state->heap_node = | 1066 | state->heap_node = |
1061 | GNUNET_CONTAINER_heap_insert (udp_connections_heap, state, | 1067 | GNUNET_CONTAINER_heap_insert (tcp_connections_heap, state, |
1062 | GNUNET_TIME_absolute_get ().abs_value); | 1068 | GNUNET_TIME_absolute_get ().abs_value); |
1063 | 1069 | ||
1064 | if (GNUNET_CONTAINER_heap_get_size (udp_connections_heap) > | 1070 | if (GNUNET_CONTAINER_heap_get_size (tcp_connections_heap) > |
1065 | max_udp_connections) | 1071 | max_tcp_connections) |
1066 | GNUNET_SCHEDULER_add_now (collect_connections, udp_connections_heap); | 1072 | GNUNET_SCHEDULER_add_now (collect_connections, tcp_connections_heap); |
1067 | } | 1073 | } |
1068 | else | 1074 | else |
1069 | GNUNET_free (state); | 1075 | GNUNET_free (state); |