diff options
author | Nathan S. Evans <evans@in.tum.de> | 2010-10-07 09:32:33 +0000 |
---|---|---|
committer | Nathan S. Evans <evans@in.tum.de> | 2010-10-07 09:32:33 +0000 |
commit | b84fdf9ddf4301eeeef3884d788fe863f470d05d (patch) | |
tree | 38eeae6e294e8c1ed24c6bbf2afe0938b4cd2baa /src | |
parent | 3ef49aae956c39eab2062d0bffbe1d3e971329a0 (diff) | |
download | gnunet-b84fdf9ddf4301eeeef3884d788fe863f470d05d.tar.gz gnunet-b84fdf9ddf4301eeeef3884d788fe863f470d05d.zip |
find peer messages were never getting actually forwarded, factor out some unused cls args
Diffstat (limited to 'src')
-rw-r--r-- | src/dht/gnunet-service-dht.c | 89 |
1 files changed, 38 insertions, 51 deletions
diff --git a/src/dht/gnunet-service-dht.c b/src/dht/gnunet-service-dht.c index 403f0dfcc..73839f271 100644 --- a/src/dht/gnunet-service-dht.c +++ b/src/dht/gnunet-service-dht.c | |||
@@ -1050,14 +1050,12 @@ try_core_send (void *cls, | |||
1050 | * Called both for locally initiated requests and those | 1050 | * Called both for locally initiated requests and those |
1051 | * received from other peers. | 1051 | * received from other peers. |
1052 | * | 1052 | * |
1053 | * @param cls DHT service closure argument | ||
1054 | * @param msg the encapsulated message | 1053 | * @param msg the encapsulated message |
1055 | * @param peer the peer to forward the message to | 1054 | * @param peer the peer to forward the message to |
1056 | * @param msg_ctx the context of the message (hop count, bloom, etc.) | 1055 | * @param msg_ctx the context of the message (hop count, bloom, etc.) |
1057 | */ | 1056 | */ |
1058 | static void | 1057 | static void |
1059 | forward_result_message (void *cls, | 1058 | forward_result_message (const struct GNUNET_MessageHeader *msg, |
1060 | const struct GNUNET_MessageHeader *msg, | ||
1061 | struct PeerInfo *peer, | 1059 | struct PeerInfo *peer, |
1062 | struct DHT_MessageContext *msg_ctx) | 1060 | struct DHT_MessageContext *msg_ctx) |
1063 | { | 1061 | { |
@@ -1881,8 +1879,6 @@ add_pending_message (struct ClientList *client, | |||
1881 | } | 1879 | } |
1882 | 1880 | ||
1883 | 1881 | ||
1884 | |||
1885 | |||
1886 | /** | 1882 | /** |
1887 | * Called when a reply needs to be sent to a client, as | 1883 | * Called when a reply needs to be sent to a client, as |
1888 | * a result it found to a GET or FIND PEER request. | 1884 | * a result it found to a GET or FIND PEER request. |
@@ -1955,15 +1951,13 @@ static int consider_peer (struct GNUNET_PeerIdentity *peer) | |||
1955 | * Main function that handles whether or not to route a result | 1951 | * Main function that handles whether or not to route a result |
1956 | * message to other peers, or to send to our local client. | 1952 | * message to other peers, or to send to our local client. |
1957 | * | 1953 | * |
1958 | * @param cls closure (unused, always should be NULL) | ||
1959 | * @param msg the result message to be routed | 1954 | * @param msg the result message to be routed |
1960 | * @param message_context context of the message we are routing | 1955 | * @param message_context context of the message we are routing |
1961 | * | 1956 | * |
1962 | * @return the number of peers the message was routed to, | 1957 | * @return the number of peers the message was routed to, |
1963 | * GNUNET_SYSERR on failure | 1958 | * GNUNET_SYSERR on failure |
1964 | */ | 1959 | */ |
1965 | static int route_result_message(void *cls, | 1960 | static int route_result_message(struct GNUNET_MessageHeader *msg, |
1966 | struct GNUNET_MessageHeader *msg, | ||
1967 | struct DHT_MessageContext *message_context) | 1961 | struct DHT_MessageContext *message_context) |
1968 | { | 1962 | { |
1969 | struct GNUNET_PeerIdentity new_peer; | 1963 | struct GNUNET_PeerIdentity new_peer; |
@@ -2105,7 +2099,7 @@ static int route_result_message(void *cls, | |||
2105 | message_context->peer, &pos->source); | 2099 | message_context->peer, &pos->source); |
2106 | } | 2100 | } |
2107 | #endif | 2101 | #endif |
2108 | forward_result_message(cls, msg, peer_info, message_context); | 2102 | forward_result_message(msg, peer_info, message_context); |
2109 | } | 2103 | } |
2110 | else | 2104 | else |
2111 | { | 2105 | { |
@@ -2182,7 +2176,7 @@ datacache_get_iterator (void *cls, | |||
2182 | new_msg_ctx->importance = DHT_DEFAULT_P2P_IMPORTANCE * 2; /* Make result routing a higher priority */ | 2176 | new_msg_ctx->importance = DHT_DEFAULT_P2P_IMPORTANCE * 2; /* Make result routing a higher priority */ |
2183 | new_msg_ctx->timeout = DHT_DEFAULT_P2P_TIMEOUT; | 2177 | new_msg_ctx->timeout = DHT_DEFAULT_P2P_TIMEOUT; |
2184 | increment_stats(STAT_GET_RESPONSE_START); | 2178 | increment_stats(STAT_GET_RESPONSE_START); |
2185 | route_result_message(cls, &get_result->header, new_msg_ctx); | 2179 | route_result_message(&get_result->header, new_msg_ctx); |
2186 | GNUNET_free(new_msg_ctx); | 2180 | GNUNET_free(new_msg_ctx); |
2187 | GNUNET_free (get_result); | 2181 | GNUNET_free (get_result); |
2188 | break; | 2182 | break; |
@@ -2229,7 +2223,7 @@ datacache_get_iterator (void *cls, | |||
2229 | * @param message_context the context containing all pertinent information about the message | 2223 | * @param message_context the context containing all pertinent information about the message |
2230 | */ | 2224 | */ |
2231 | static void | 2225 | static void |
2232 | route_message2(const struct GNUNET_MessageHeader *msg, | 2226 | route_message(const struct GNUNET_MessageHeader *msg, |
2233 | struct DHT_MessageContext *message_context); | 2227 | struct DHT_MessageContext *message_context); |
2234 | 2228 | ||
2235 | 2229 | ||
@@ -2237,15 +2231,13 @@ route_message2(const struct GNUNET_MessageHeader *msg, | |||
2237 | * Server handler for all dht get requests, look for data, | 2231 | * Server handler for all dht get requests, look for data, |
2238 | * if found, send response either to clients or other peers. | 2232 | * if found, send response either to clients or other peers. |
2239 | * | 2233 | * |
2240 | * @param cls closure for service | ||
2241 | * @param msg the actual get message | 2234 | * @param msg the actual get message |
2242 | * @param message_context struct containing pertinent information about the get request | 2235 | * @param message_context struct containing pertinent information about the get request |
2243 | * | 2236 | * |
2244 | * @return number of items found for GET request | 2237 | * @return number of items found for GET request |
2245 | */ | 2238 | */ |
2246 | static unsigned int | 2239 | static unsigned int |
2247 | handle_dht_get (void *cls, | 2240 | handle_dht_get (const struct GNUNET_MessageHeader *msg, |
2248 | const struct GNUNET_MessageHeader *msg, | ||
2249 | struct DHT_MessageContext *message_context) | 2241 | struct DHT_MessageContext *message_context) |
2250 | { | 2242 | { |
2251 | const struct GNUNET_DHT_GetMessage *get_msg; | 2243 | const struct GNUNET_DHT_GetMessage *get_msg; |
@@ -2370,7 +2362,7 @@ handle_dht_get (void *cls, | |||
2370 | #endif | 2362 | #endif |
2371 | } | 2363 | } |
2372 | if (message_context->do_forward == GNUNET_YES) | 2364 | if (message_context->do_forward == GNUNET_YES) |
2373 | route_message2 (msg, message_context); | 2365 | route_message (msg, message_context); |
2374 | GNUNET_CONTAINER_bloomfilter_free (message_context->reply_bf); | 2366 | GNUNET_CONTAINER_bloomfilter_free (message_context->reply_bf); |
2375 | return results; | 2367 | return results; |
2376 | } | 2368 | } |
@@ -2387,14 +2379,12 @@ remove_recent_find_peer(void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc | |||
2387 | /** | 2379 | /** |
2388 | * Server handler for initiating local dht find peer requests | 2380 | * Server handler for initiating local dht find peer requests |
2389 | * | 2381 | * |
2390 | * @param cls closure for service | ||
2391 | * @param find_msg the actual find peer message | 2382 | * @param find_msg the actual find peer message |
2392 | * @param message_context struct containing pertinent information about the request | 2383 | * @param message_context struct containing pertinent information about the request |
2393 | * | 2384 | * |
2394 | */ | 2385 | */ |
2395 | static void | 2386 | static void |
2396 | handle_dht_find_peer (void *cls, | 2387 | handle_dht_find_peer (const struct GNUNET_MessageHeader *find_msg, |
2397 | const struct GNUNET_MessageHeader *find_msg, | ||
2398 | struct DHT_MessageContext *message_context) | 2388 | struct DHT_MessageContext *message_context) |
2399 | { | 2389 | { |
2400 | struct GNUNET_MessageHeader *find_peer_result; | 2390 | struct GNUNET_MessageHeader *find_peer_result; |
@@ -2431,13 +2421,13 @@ handle_dht_find_peer (void *cls, | |||
2431 | increment_stats(STAT_HELLOS_PROVIDED); | 2421 | increment_stats(STAT_HELLOS_PROVIDED); |
2432 | GNUNET_TRANSPORT_offer_hello(transport_handle, other_hello); | 2422 | GNUNET_TRANSPORT_offer_hello(transport_handle, other_hello); |
2433 | GNUNET_CORE_peer_request_connect(sched, cfg, GNUNET_TIME_relative_multiply(GNUNET_TIME_UNIT_SECONDS, 5), &peer_id, NULL, NULL); | 2423 | GNUNET_CORE_peer_request_connect(sched, cfg, GNUNET_TIME_relative_multiply(GNUNET_TIME_UNIT_SECONDS, 5), &peer_id, NULL, NULL); |
2434 | route_message2 (find_msg, message_context); | 2424 | route_message (find_msg, message_context); |
2435 | GNUNET_free (other_hello); | 2425 | GNUNET_free (other_hello); |
2436 | return; | 2426 | return; |
2437 | } | 2427 | } |
2438 | else /* We don't want this peer! */ | 2428 | else /* We don't want this peer! */ |
2439 | { | 2429 | { |
2440 | route_message2 (find_msg, message_context); | 2430 | route_message (find_msg, message_context); |
2441 | return; | 2431 | return; |
2442 | } | 2432 | } |
2443 | #endif | 2433 | #endif |
@@ -2458,7 +2448,7 @@ handle_dht_find_peer (void *cls, | |||
2458 | "DHT"); | 2448 | "DHT"); |
2459 | #endif | 2449 | #endif |
2460 | GNUNET_free_non_null (other_hello); | 2450 | GNUNET_free_non_null (other_hello); |
2461 | route_message2 (find_msg, message_context); | 2451 | route_message (find_msg, message_context); |
2462 | return; | 2452 | return; |
2463 | } | 2453 | } |
2464 | 2454 | ||
@@ -2468,7 +2458,7 @@ handle_dht_find_peer (void *cls, | |||
2468 | increment_stats(STAT_BLOOM_FIND_PEER); | 2458 | increment_stats(STAT_BLOOM_FIND_PEER); |
2469 | GNUNET_CONTAINER_bloomfilter_free(incoming_bloom); | 2459 | GNUNET_CONTAINER_bloomfilter_free(incoming_bloom); |
2470 | GNUNET_free_non_null(other_hello); | 2460 | GNUNET_free_non_null(other_hello); |
2471 | route_message2 (find_msg, message_context); | 2461 | route_message (find_msg, message_context); |
2472 | return; /* We match the bloomfilter, do not send a response to this peer (they likely already know us!)*/ | 2462 | return; /* We match the bloomfilter, do not send a response to this peer (they likely already know us!)*/ |
2473 | } | 2463 | } |
2474 | GNUNET_CONTAINER_bloomfilter_free(incoming_bloom); | 2464 | GNUNET_CONTAINER_bloomfilter_free(incoming_bloom); |
@@ -2498,7 +2488,7 @@ handle_dht_find_peer (void *cls, | |||
2498 | { | 2488 | { |
2499 | increment_stats("# dht find peer requests ignored (do not need!)"); | 2489 | increment_stats("# dht find peer requests ignored (do not need!)"); |
2500 | GNUNET_free_non_null(other_hello); | 2490 | GNUNET_free_non_null(other_hello); |
2501 | route_message2 (find_msg, message_context); | 2491 | route_message (find_msg, message_context); |
2502 | return; | 2492 | return; |
2503 | } | 2493 | } |
2504 | #endif | 2494 | #endif |
@@ -2547,7 +2537,7 @@ handle_dht_find_peer (void *cls, | |||
2547 | new_msg_ctx->importance = DHT_DEFAULT_P2P_IMPORTANCE * 2; /* Make find peer requests a higher priority */ | 2537 | new_msg_ctx->importance = DHT_DEFAULT_P2P_IMPORTANCE * 2; /* Make find peer requests a higher priority */ |
2548 | new_msg_ctx->timeout = DHT_DEFAULT_P2P_TIMEOUT; | 2538 | new_msg_ctx->timeout = DHT_DEFAULT_P2P_TIMEOUT; |
2549 | increment_stats(STAT_FIND_PEER_ANSWER); | 2539 | increment_stats(STAT_FIND_PEER_ANSWER); |
2550 | route_result_message(cls, find_peer_result, new_msg_ctx); | 2540 | route_result_message(find_peer_result, new_msg_ctx); |
2551 | GNUNET_free(new_msg_ctx); | 2541 | GNUNET_free(new_msg_ctx); |
2552 | #if DEBUG_DHT_ROUTING | 2542 | #if DEBUG_DHT_ROUTING |
2553 | if ((debug_routes) && (dhtlog_handle != NULL)) | 2543 | if ((debug_routes) && (dhtlog_handle != NULL)) |
@@ -2559,7 +2549,7 @@ handle_dht_find_peer (void *cls, | |||
2559 | #endif | 2549 | #endif |
2560 | GNUNET_free_non_null(other_hello); | 2550 | GNUNET_free_non_null(other_hello); |
2561 | GNUNET_free(find_peer_result); | 2551 | GNUNET_free(find_peer_result); |
2562 | route_message2 (find_msg, message_context); | 2552 | route_message (find_msg, message_context); |
2563 | } | 2553 | } |
2564 | 2554 | ||
2565 | /** | 2555 | /** |
@@ -2575,13 +2565,11 @@ republish_content(void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc); | |||
2575 | /** | 2565 | /** |
2576 | * Server handler for initiating local dht put requests | 2566 | * Server handler for initiating local dht put requests |
2577 | * | 2567 | * |
2578 | * @param cls closure for service | ||
2579 | * @param msg the actual put message | 2568 | * @param msg the actual put message |
2580 | * @param message_context struct containing pertinent information about the request | 2569 | * @param message_context struct containing pertinent information about the request |
2581 | */ | 2570 | */ |
2582 | static void | 2571 | static void |
2583 | handle_dht_put (void *cls, | 2572 | handle_dht_put (const struct GNUNET_MessageHeader *msg, |
2584 | const struct GNUNET_MessageHeader *msg, | ||
2585 | struct DHT_MessageContext *message_context) | 2573 | struct DHT_MessageContext *message_context) |
2586 | { | 2574 | { |
2587 | const struct GNUNET_DHT_PutMessage *put_msg; | 2575 | const struct GNUNET_DHT_PutMessage *put_msg; |
@@ -2642,7 +2630,7 @@ handle_dht_put (void *cls, | |||
2642 | 2630 | ||
2643 | if (message_context->closest != GNUNET_YES) | 2631 | if (message_context->closest != GNUNET_YES) |
2644 | { | 2632 | { |
2645 | route_message2 (msg, message_context); | 2633 | route_message (msg, message_context); |
2646 | return; | 2634 | return; |
2647 | } | 2635 | } |
2648 | 2636 | ||
@@ -2690,7 +2678,7 @@ handle_dht_put (void *cls, | |||
2690 | my_short_id, "DHT", "PUT"); | 2678 | my_short_id, "DHT", "PUT"); |
2691 | 2679 | ||
2692 | if (stop_on_closest == GNUNET_NO) | 2680 | if (stop_on_closest == GNUNET_NO) |
2693 | route_message2 (msg, message_context); | 2681 | route_message (msg, message_context); |
2694 | } | 2682 | } |
2695 | 2683 | ||
2696 | /** | 2684 | /** |
@@ -3365,12 +3353,11 @@ remove_forward_entry (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
3365 | * received we can either forward it to the correct peer | 3353 | * received we can either forward it to the correct peer |
3366 | * or return the result locally. | 3354 | * or return the result locally. |
3367 | * | 3355 | * |
3368 | * @param cls DHT service closure | ||
3369 | * @param msg_ctx Context of the route request | 3356 | * @param msg_ctx Context of the route request |
3370 | * | 3357 | * |
3371 | * @return GNUNET_YES if this response was cached, GNUNET_NO if not | 3358 | * @return GNUNET_YES if this response was cached, GNUNET_NO if not |
3372 | */ | 3359 | */ |
3373 | static int cache_response(void *cls, struct DHT_MessageContext *msg_ctx) | 3360 | static int cache_response(struct DHT_MessageContext *msg_ctx) |
3374 | { | 3361 | { |
3375 | struct DHTQueryRecord *record; | 3362 | struct DHTQueryRecord *record; |
3376 | struct DHTRouteSource *source_info; | 3363 | struct DHTRouteSource *source_info; |
@@ -3449,7 +3436,7 @@ static int cache_response(void *cls, struct DHT_MessageContext *msg_ctx) | |||
3449 | * @param message_context the context containing all pertinent information about the message | 3436 | * @param message_context the context containing all pertinent information about the message |
3450 | */ | 3437 | */ |
3451 | static void | 3438 | static void |
3452 | route_message2(const struct GNUNET_MessageHeader *msg, | 3439 | route_message(const struct GNUNET_MessageHeader *msg, |
3453 | struct DHT_MessageContext *message_context) | 3440 | struct DHT_MessageContext *message_context) |
3454 | { | 3441 | { |
3455 | int i; | 3442 | int i; |
@@ -3613,34 +3600,34 @@ route_message2(const struct GNUNET_MessageHeader *msg, | |||
3613 | * Main function that handles whether or not to route a message to other | 3600 | * Main function that handles whether or not to route a message to other |
3614 | * peers. | 3601 | * peers. |
3615 | * | 3602 | * |
3616 | * @param cls closure for dht service (NULL) | ||
3617 | * @param msg the message to be routed | 3603 | * @param msg the message to be routed |
3618 | * @param message_context the context containing all pertinent information about the message | 3604 | * @param message_context the context containing all pertinent information about the message |
3619 | */ | 3605 | */ |
3620 | static void | 3606 | static void |
3621 | route_message(void *cls, | 3607 | demultiplex_message(const struct GNUNET_MessageHeader *msg, |
3622 | const struct GNUNET_MessageHeader *msg, | 3608 | struct DHT_MessageContext *message_context) |
3623 | struct DHT_MessageContext *message_context) | ||
3624 | { | 3609 | { |
3625 | message_context->closest = am_closest_peer(&message_context->key, NULL); | 3610 | message_context->closest = am_closest_peer(&message_context->key, NULL); |
3626 | switch (ntohs(msg->type)) | 3611 | switch (ntohs(msg->type)) |
3627 | { | 3612 | { |
3628 | case GNUNET_MESSAGE_TYPE_DHT_GET: /* Add to hashmap of requests seen, search for data (always) */ | 3613 | case GNUNET_MESSAGE_TYPE_DHT_GET: /* Add to hashmap of requests seen, search for data (always) */ |
3629 | cache_response (cls, message_context); | 3614 | cache_response (message_context); |
3630 | handle_dht_get (cls, msg, message_context); | 3615 | handle_dht_get (msg, message_context); |
3631 | break; | 3616 | break; |
3632 | case GNUNET_MESSAGE_TYPE_DHT_PUT: /* Check if closest, if so insert data. */ | 3617 | case GNUNET_MESSAGE_TYPE_DHT_PUT: /* Check if closest, if so insert data. */ |
3633 | increment_stats(STAT_PUTS); | 3618 | increment_stats(STAT_PUTS); |
3634 | handle_dht_put (cls, msg, message_context); | 3619 | handle_dht_put (msg, message_context); |
3635 | break; | 3620 | break; |
3636 | case GNUNET_MESSAGE_TYPE_DHT_FIND_PEER: /* Check if closest and not started by us, check options, add to requests seen */ | 3621 | case GNUNET_MESSAGE_TYPE_DHT_FIND_PEER: /* Check if closest and not started by us, check options, add to requests seen */ |
3637 | increment_stats(STAT_FIND_PEER); | 3622 | increment_stats(STAT_FIND_PEER); |
3638 | if (((message_context->hop_count > 0) && (0 != memcmp(message_context->peer, &my_identity, sizeof(struct GNUNET_PeerIdentity)))) || (message_context->client != NULL)) | 3623 | if (((message_context->hop_count > 0) && (0 != memcmp(message_context->peer, &my_identity, sizeof(struct GNUNET_PeerIdentity)))) || (message_context->client != NULL)) |
3639 | { | 3624 | { |
3640 | cache_response (cls, message_context); | 3625 | cache_response (message_context); |
3641 | if ((message_context->closest == GNUNET_YES) || (message_context->msg_options == GNUNET_DHT_RO_DEMULTIPLEX_EVERYWHERE)) | 3626 | if ((message_context->closest == GNUNET_YES) || (message_context->msg_options == GNUNET_DHT_RO_DEMULTIPLEX_EVERYWHERE)) |
3642 | handle_dht_find_peer (cls, msg, message_context); | 3627 | handle_dht_find_peer (msg, message_context); |
3643 | } | 3628 | } |
3629 | else | ||
3630 | route_message (msg, message_context); | ||
3644 | #if DEBUG_DHT_ROUTING | 3631 | #if DEBUG_DHT_ROUTING |
3645 | if (message_context->hop_count == 0) /* Locally initiated request */ | 3632 | if (message_context->hop_count == 0) /* Locally initiated request */ |
3646 | { | 3633 | { |
@@ -3656,8 +3643,8 @@ route_message(void *cls, | |||
3656 | break; | 3643 | break; |
3657 | default: | 3644 | default: |
3658 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, | 3645 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, |
3659 | "`%s': Message type (%d) not handled\n", "DHT", ntohs(msg->type)); | 3646 | "`%s': Message type (%d) not handled, forwarding anyway!\n", "DHT", ntohs(msg->type)); |
3660 | route_message (cls, msg, message_context); | 3647 | route_message (msg, message_context); |
3661 | } | 3648 | } |
3662 | } | 3649 | } |
3663 | 3650 | ||
@@ -3709,7 +3696,7 @@ republish_content_iterator (void *cls, | |||
3709 | new_msg_ctx->importance = DHT_DEFAULT_P2P_IMPORTANCE; | 3696 | new_msg_ctx->importance = DHT_DEFAULT_P2P_IMPORTANCE; |
3710 | new_msg_ctx->timeout = DHT_DEFAULT_P2P_TIMEOUT; | 3697 | new_msg_ctx->timeout = DHT_DEFAULT_P2P_TIMEOUT; |
3711 | increment_stats(STAT_PUT_START); | 3698 | increment_stats(STAT_PUT_START); |
3712 | route_message(cls, &put_msg->header, new_msg_ctx); | 3699 | demultiplex_message(&put_msg->header, new_msg_ctx); |
3713 | 3700 | ||
3714 | GNUNET_free(new_msg_ctx); | 3701 | GNUNET_free(new_msg_ctx); |
3715 | GNUNET_free (put_msg); | 3702 | GNUNET_free (put_msg); |
@@ -3898,7 +3885,7 @@ malicious_put_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
3898 | #endif | 3885 | #endif |
3899 | increment_stats(STAT_PUT_START); | 3886 | increment_stats(STAT_PUT_START); |
3900 | GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, "%s:%s Sending malicious PUT message with hash %s\n", my_short_id, "DHT", GNUNET_h2s(&key)); | 3887 | GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, "%s:%s Sending malicious PUT message with hash %s\n", my_short_id, "DHT", GNUNET_h2s(&key)); |
3901 | route_message(NULL, &put_message.header, &message_context); | 3888 | demultiplex_message(&put_message.header, &message_context); |
3902 | GNUNET_SCHEDULER_add_delayed(sched, GNUNET_TIME_relative_multiply(GNUNET_TIME_UNIT_MILLISECONDS, malicious_put_frequency), &malicious_put_task, NULL); | 3889 | GNUNET_SCHEDULER_add_delayed(sched, GNUNET_TIME_relative_multiply(GNUNET_TIME_UNIT_MILLISECONDS, malicious_put_frequency), &malicious_put_task, NULL); |
3903 | 3890 | ||
3904 | } | 3891 | } |
@@ -3941,7 +3928,7 @@ malicious_get_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
3941 | #endif | 3928 | #endif |
3942 | increment_stats(STAT_GET_START); | 3929 | increment_stats(STAT_GET_START); |
3943 | GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, "%s:%s Sending malicious GET message with hash %s\n", my_short_id, "DHT", GNUNET_h2s(&key)); | 3930 | GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, "%s:%s Sending malicious GET message with hash %s\n", my_short_id, "DHT", GNUNET_h2s(&key)); |
3944 | route_message (NULL, &get_message.header, &message_context); | 3931 | demultiplex_message (&get_message.header, &message_context); |
3945 | GNUNET_SCHEDULER_add_delayed(sched, GNUNET_TIME_relative_multiply(GNUNET_TIME_UNIT_MILLISECONDS, malicious_get_frequency), &malicious_get_task, NULL); | 3932 | GNUNET_SCHEDULER_add_delayed(sched, GNUNET_TIME_relative_multiply(GNUNET_TIME_UNIT_MILLISECONDS, malicious_get_frequency), &malicious_get_task, NULL); |
3946 | } | 3933 | } |
3947 | 3934 | ||
@@ -4038,7 +4025,7 @@ send_find_peer_message (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc | |||
4038 | message_context.importance = DHT_DEFAULT_FIND_PEER_IMPORTANCE; | 4025 | message_context.importance = DHT_DEFAULT_FIND_PEER_IMPORTANCE; |
4039 | message_context.timeout = DHT_DEFAULT_FIND_PEER_TIMEOUT; | 4026 | message_context.timeout = DHT_DEFAULT_FIND_PEER_TIMEOUT; |
4040 | 4027 | ||
4041 | route_message(NULL, &find_peer_msg->header, &message_context); | 4028 | demultiplex_message(&find_peer_msg->header, &message_context); |
4042 | GNUNET_free(find_peer_msg); | 4029 | GNUNET_free(find_peer_msg); |
4043 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 4030 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
4044 | "`%s:%s': Sent `%s' request to some (?) peers\n", my_short_id, "DHT", | 4031 | "`%s:%s': Sent `%s' request to some (?) peers\n", my_short_id, "DHT", |
@@ -4117,7 +4104,7 @@ handle_dht_local_route_request (void *cls, struct GNUNET_SERVER_Client *client, | |||
4117 | else if (ntohs(enc_msg->type) == GNUNET_MESSAGE_TYPE_DHT_FIND_PEER) | 4104 | else if (ntohs(enc_msg->type) == GNUNET_MESSAGE_TYPE_DHT_FIND_PEER) |
4118 | increment_stats(STAT_FIND_PEER_START); | 4105 | increment_stats(STAT_FIND_PEER_START); |
4119 | 4106 | ||
4120 | route_message(cls, enc_msg, &message_context); | 4107 | demultiplex_message(enc_msg, &message_context); |
4121 | 4108 | ||
4122 | GNUNET_SERVER_receive_done (client, GNUNET_OK); | 4109 | GNUNET_SERVER_receive_done (client, GNUNET_OK); |
4123 | 4110 | ||
@@ -4285,7 +4272,7 @@ handle_dht_p2p_route_request (void *cls, | |||
4285 | message_context->peer = peer; | 4272 | message_context->peer = peer; |
4286 | message_context->importance = DHT_DEFAULT_P2P_IMPORTANCE; | 4273 | message_context->importance = DHT_DEFAULT_P2P_IMPORTANCE; |
4287 | message_context->timeout = DHT_DEFAULT_P2P_TIMEOUT; | 4274 | message_context->timeout = DHT_DEFAULT_P2P_TIMEOUT; |
4288 | route_message(cls, enc_msg, message_context); | 4275 | demultiplex_message(enc_msg, message_context); |
4289 | GNUNET_free(message_context); | 4276 | GNUNET_free(message_context); |
4290 | return GNUNET_YES; | 4277 | return GNUNET_YES; |
4291 | } | 4278 | } |
@@ -4325,7 +4312,7 @@ handle_dht_p2p_route_result (void *cls, | |||
4325 | message_context.peer = peer; | 4312 | message_context.peer = peer; |
4326 | message_context.importance = DHT_DEFAULT_P2P_IMPORTANCE * 2; /* Make result routing a higher priority */ | 4313 | message_context.importance = DHT_DEFAULT_P2P_IMPORTANCE * 2; /* Make result routing a higher priority */ |
4327 | message_context.timeout = DHT_DEFAULT_P2P_TIMEOUT; | 4314 | message_context.timeout = DHT_DEFAULT_P2P_TIMEOUT; |
4328 | route_result_message(cls, enc_msg, &message_context); | 4315 | route_result_message(enc_msg, &message_context); |
4329 | return GNUNET_YES; | 4316 | return GNUNET_YES; |
4330 | } | 4317 | } |
4331 | 4318 | ||