From 6c33a3bbe11a98b306b42854812d8af6662b892e Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Tue, 24 Sep 2013 08:28:19 +0000 Subject: [PATCH] -keep reading from client to support multiple GNS requests in parallel --- src/gns/gns.conf.in | 12 ------------ src/gns/gnunet-service-gns.c | 3 +-- src/gns/test_gns_delegated_lookup.sh | 2 +- src/gns/test_gns_lookup.conf | 2 +- src/gns/test_gns_lookup.sh | 14 +++++--------- 5 files changed, 8 insertions(+), 25 deletions(-) diff --git a/src/gns/gns.conf.in b/src/gns/gns.conf.in index f2d65adfe..91fd822f8 100644 --- a/src/gns/gns.conf.in +++ b/src/gns/gns.conf.in @@ -8,13 +8,6 @@ UNIXPATH = /tmp/gnunet-service-gns.sock ZONE_DIR = $SERVICEHOME/gns/ -# Should we hijack DNS queries using the Linux firewall? -# (this only works on GNU/Linux systems) -HIJACK_DNS = NO - -# Automatically import PKEYs we learn into the shorten zone? -AUTO_IMPORT_PKEY = YES - # Do we require users that want to access GNS to run this process # (usually not a good idea) UNIX_MATCH_UID = NO @@ -22,11 +15,6 @@ UNIX_MATCH_UID = NO # Do we require users that want to access GNS to be in the 'gnunet' group? UNIX_MATCH_GID = YES -# When we automatically import PKEYs into shorten zone, require confirmation -# before they become active? (Not useful right now as the GUI to confirm -# doesn't exist -- and neither does the API...) -AUTO_IMPORT_CONFIRMATION_REQ = NO - # How many queries is GADS allowed to perform in the background at the same time? MAX_PARALLEL_BACKGROUND_QUERIES = 25 diff --git a/src/gns/gnunet-service-gns.c b/src/gns/gnunet-service-gns.c index 092bba705..5838dc740 100644 --- a/src/gns/gnunet-service-gns.c +++ b/src/gns/gnunet-service-gns.c @@ -504,8 +504,6 @@ send_lookup_response (void* cls, &rmsg->header, GNUNET_NO); GNUNET_free (rmsg); - GNUNET_SERVER_receive_done (clh->client, - GNUNET_OK); GNUNET_CONTAINER_DLL_remove (clh_head, clh_tail, clh); GNUNET_SERVER_client_set_user_context (clh->client, NULL); GNUNET_free (clh); @@ -564,6 +562,7 @@ handle_lookup (void *cls, return; } GNUNET_STRINGS_utf8_tolower (utf_in, &nameptr); + GNUNET_SERVER_receive_done (client, GNUNET_OK); clh = GNUNET_new (struct ClientLookupHandle); GNUNET_SERVER_client_set_user_context (client, clh); diff --git a/src/gns/test_gns_delegated_lookup.sh b/src/gns/test_gns_delegated_lookup.sh index 2e0f6c8e2..d18f78929 100644 --- a/src/gns/test_gns_delegated_lookup.sh +++ b/src/gns/test_gns_delegated_lookup.sh @@ -10,7 +10,7 @@ gnunet-arm -s -c test_gns_lookup.conf gnunet-namestore -p -z testego -a -n b -t PKEY -V $DELEGATED_PKEY -e never -c test_gns_lookup.conf gnunet-namestore -p -z delegatedego -a -n www -t A -V $TEST_IP -e never -c test_gns_lookup.conf -RES_IP=$(gnunet-gns --raw -z testego -u www.b.gnu -t A -c test_gns_lookup.conf) +RES_IP=$(timeout 5 gnunet-gns --raw -z testego -u www.b.gnu -t A -c test_gns_lookup.conf) gnunet-namestore -z testego -d -n b -t PKEY -V $DELEGATED_PKEY -e never -c test_gns_lookup.conf gnunet-namestore -z delegatedego -d -n www -t A -V $TEST_IP -e never -c test_gns_lookup.conf diff --git a/src/gns/test_gns_lookup.conf b/src/gns/test_gns_lookup.conf index 86c6fc1f8..94042a5e9 100644 --- a/src/gns/test_gns_lookup.conf +++ b/src/gns/test_gns_lookup.conf @@ -12,7 +12,7 @@ DEFAULTSERVICES = SERVICEHOME = /tmp/test-gnunet-gns-peer-1/ [gns] -PREFIX = valgrind --leak-check=full --track-origins=yes +#PREFIX = valgrind --leak-check=full --track-origins=yes AUTOSTART = YES AUTO_IMPORT_PKEY = YES MAX_PARALLEL_BACKGROUND_QUERIES = 10 diff --git a/src/gns/test_gns_lookup.sh b/src/gns/test_gns_lookup.sh index 8c876df61..bfb59c50f 100644 --- a/src/gns/test_gns_lookup.sh +++ b/src/gns/test_gns_lookup.sh @@ -1,23 +1,19 @@ #!/bin/bash trap "gnunet-arm -e -c test_gns_lookup.conf" SIGINT - +rm -r `gnunet-config -c test_gns_lookup.conf -s PATHS -o SERVICEHOME` TEST_IP="127.0.0.1" - gnunet-arm -s -c test_gns_lookup.conf - -#gnunet-identity -C testego -c test_gns_lookup.conf - +gnunet-identity -C testego -c test_gns_lookup.conf gnunet-namestore -p -z testego -a -n www -t A -V $TEST_IP -e never -c test_gns_lookup.conf -RES_IP=$(gnunet-gns --raw -z testego -u www.gnu -t A -c test_gns_lookup.conf) - +RES_IP=$(timeout 5 gnunet-gns --raw -z testego -u www.gnu -t A -c test_gns_lookup.conf) gnunet-namestore -z testego -d -n www -t A -V $TEST_IP -e never -c test_gns_lookup.conf - +gnunet-identity -D testego -c test_gns_lookup.conf gnunet-arm -e -c test_gns_lookup.conf if [ "$RES_IP" == "$TEST_IP" ] then exit 0 else + echo "Failed to resolve to proper IP, got $RES_IP." exit 1 fi - -- 2.25.1