diff options
author | Christian Grothoff <christian@grothoff.org> | 2012-11-14 15:53:47 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2012-11-14 15:53:47 +0000 |
commit | 6d5f2d7b3d3daefada86869e8a4b2930f80b7ee3 (patch) | |
tree | 10457517c78e89d739ae38fd8955f9ffe6653c2d | |
parent | 958367dc3eb8bcef571c9f05ace9dbfcaee037e1 (diff) | |
download | gnunet-6d5f2d7b3d3daefada86869e8a4b2930f80b7ee3.tar.gz gnunet-6d5f2d7b3d3daefada86869e8a4b2930f80b7ee3.zip |
fixing crash of mesh service -- reproduced by regex profiler w 100 peers -- on shutdown due to failure to initialize dht_handle field
-rw-r--r-- | src/dht/dht_api.c | 1 | ||||
-rw-r--r-- | src/dht/gnunet-service-dht_clients.c | 23 | ||||
-rw-r--r-- | src/dht/gnunet-service-dht_neighbours.c | 15 |
3 files changed, 35 insertions, 4 deletions
diff --git a/src/dht/dht_api.c b/src/dht/dht_api.c index f46900778..0e709a83f 100644 --- a/src/dht/dht_api.c +++ b/src/dht/dht_api.c | |||
@@ -1268,6 +1268,7 @@ GNUNET_DHT_get_start (struct GNUNET_DHT_Handle *handle, | |||
1268 | pending); | 1268 | pending); |
1269 | pending->in_pending_queue = GNUNET_YES; | 1269 | pending->in_pending_queue = GNUNET_YES; |
1270 | get_handle = GNUNET_malloc (sizeof (struct GNUNET_DHT_GetHandle)); | 1270 | get_handle = GNUNET_malloc (sizeof (struct GNUNET_DHT_GetHandle)); |
1271 | get_handle->dht_handle = handle; | ||
1271 | get_handle->iter = iter; | 1272 | get_handle->iter = iter; |
1272 | get_handle->iter_cls = iter_cls; | 1273 | get_handle->iter_cls = iter_cls; |
1273 | get_handle->message = pending; | 1274 | get_handle->message = pending; |
diff --git a/src/dht/gnunet-service-dht_clients.c b/src/dht/gnunet-service-dht_clients.c index 85cdf8252..0e309e59e 100644 --- a/src/dht/gnunet-service-dht_clients.c +++ b/src/dht/gnunet-service-dht_clients.c | |||
@@ -37,6 +37,12 @@ | |||
37 | 37 | ||
38 | 38 | ||
39 | /** | 39 | /** |
40 | * Should routing details be logged to stderr (for debugging)? | ||
41 | */ | ||
42 | #define LOG_ROUTE_DETAILS_STDERR GNUNET_YES | ||
43 | |||
44 | |||
45 | /** | ||
40 | * Linked list of messages to send to clients. | 46 | * Linked list of messages to send to clients. |
41 | */ | 47 | */ |
42 | struct PendingMessage | 48 | struct PendingMessage |
@@ -581,6 +587,16 @@ handle_dht_local_get (void *cls, struct GNUNET_SERVER_Client *client, | |||
581 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 587 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
582 | "Received request for %s from local client %p\n", | 588 | "Received request for %s from local client %p\n", |
583 | GNUNET_h2s (&get->key), client); | 589 | GNUNET_h2s (&get->key), client); |
590 | |||
591 | if (LOG_ROUTE_DETAILS_STDERR) | ||
592 | { | ||
593 | fprintf (stderr, | ||
594 | "XDHT CLIENT-GET %s @ %u\n", | ||
595 | GNUNET_h2s (&get->key), | ||
596 | getpid ()); | ||
597 | } | ||
598 | |||
599 | |||
584 | cqr = GNUNET_malloc (sizeof (struct ClientQueryRecord) + xquery_size); | 600 | cqr = GNUNET_malloc (sizeof (struct ClientQueryRecord) + xquery_size); |
585 | cqr->key = get->key; | 601 | cqr->key = get->key; |
586 | cqr->client = find_active_client (client); | 602 | cqr->client = find_active_client (client); |
@@ -1002,6 +1018,13 @@ forward_reply (void *cls, const struct GNUNET_HashCode * key, void *value) | |||
1002 | struct GNUNET_HashCode ch; | 1018 | struct GNUNET_HashCode ch; |
1003 | unsigned int i; | 1019 | unsigned int i; |
1004 | 1020 | ||
1021 | if (LOG_ROUTE_DETAILS_STDERR) | ||
1022 | { | ||
1023 | fprintf (stderr, | ||
1024 | "XDHT CLIENT-RESULT %s @ %u\n", | ||
1025 | GNUNET_h2s (key), | ||
1026 | getpid ()); | ||
1027 | } | ||
1005 | if ((record->type != GNUNET_BLOCK_TYPE_ANY) && (record->type != frc->type)) | 1028 | if ((record->type != GNUNET_BLOCK_TYPE_ANY) && (record->type != frc->type)) |
1006 | { | 1029 | { |
1007 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 1030 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
diff --git a/src/dht/gnunet-service-dht_neighbours.c b/src/dht/gnunet-service-dht_neighbours.c index 5d11e55ae..ea4baa9e9 100644 --- a/src/dht/gnunet-service-dht_neighbours.c +++ b/src/dht/gnunet-service-dht_neighbours.c | |||
@@ -97,7 +97,7 @@ | |||
97 | /** | 97 | /** |
98 | * Should routing details be logged to stderr (for debugging)? | 98 | * Should routing details be logged to stderr (for debugging)? |
99 | */ | 99 | */ |
100 | #define LOG_ROUTE_DETAILS_STDERR GNUNET_NO | 100 | #define LOG_ROUTE_DETAILS_STDERR GNUNET_YES |
101 | 101 | ||
102 | 102 | ||
103 | GNUNET_NETWORK_STRUCT_BEGIN | 103 | GNUNET_NETWORK_STRUCT_BEGIN |
@@ -1598,7 +1598,9 @@ handle_dht_p2p_put (void *cls, const struct GNUNET_PeerIdentity *peer, | |||
1598 | char *tmp; | 1598 | char *tmp; |
1599 | 1599 | ||
1600 | tmp = GNUNET_strdup (GNUNET_i2s (&my_identity)); | 1600 | tmp = GNUNET_strdup (GNUNET_i2s (&my_identity)); |
1601 | fprintf (stderr, "XDHT PUT %s: %s<-%s\n", GNUNET_h2s (&put->key), tmp, GNUNET_i2s (peer)); | 1601 | fprintf (stderr, "XDHT PUT %s: %s(%u)<-%s\n", |
1602 | GNUNET_h2s (&put->key), tmp, getpid (), | ||
1603 | GNUNET_i2s (peer)); | ||
1602 | GNUNET_free (tmp); | 1604 | GNUNET_free (tmp); |
1603 | } | 1605 | } |
1604 | 1606 | ||
@@ -1855,7 +1857,9 @@ handle_dht_p2p_get (void *cls, const struct GNUNET_PeerIdentity *peer, | |||
1855 | char *tmp; | 1857 | char *tmp; |
1856 | 1858 | ||
1857 | tmp = GNUNET_strdup (GNUNET_i2s (&my_identity)); | 1859 | tmp = GNUNET_strdup (GNUNET_i2s (&my_identity)); |
1858 | fprintf (stderr, "XDHT GET %s: %s<-%s\n", GNUNET_h2s (&get->key), tmp, GNUNET_i2s (peer)); | 1860 | fprintf (stderr, "XDHT GET %s: %s(%u)<-%s\n", |
1861 | GNUNET_h2s (&get->key), tmp, getpid(), | ||
1862 | GNUNET_i2s (peer)); | ||
1859 | GNUNET_free (tmp); | 1863 | GNUNET_free (tmp); |
1860 | } | 1864 | } |
1861 | 1865 | ||
@@ -1989,7 +1993,10 @@ handle_dht_p2p_result (void *cls, const struct GNUNET_PeerIdentity *peer, | |||
1989 | char *tmp; | 1993 | char *tmp; |
1990 | 1994 | ||
1991 | tmp = GNUNET_strdup (GNUNET_i2s (&my_identity)); | 1995 | tmp = GNUNET_strdup (GNUNET_i2s (&my_identity)); |
1992 | fprintf (stderr, "XDHT RESULT %s: %s<-%s\n", GNUNET_h2s (&prm->key), tmp, GNUNET_i2s (peer)); | 1996 | fprintf (stderr, |
1997 | "XDHT RESULT %s: %s(%u)<-%s\n", | ||
1998 | GNUNET_h2s (&prm->key), tmp, | ||
1999 | getpid(), GNUNET_i2s (peer)); | ||
1993 | GNUNET_free (tmp); | 2000 | GNUNET_free (tmp); |
1994 | } | 2001 | } |
1995 | 2002 | ||