diff options
author | Christian Grothoff <christian@grothoff.org> | 2010-01-14 14:56:57 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2010-01-14 14:56:57 +0000 |
commit | 7864d3fc9dc21f7a91e6f7b5a380840a2b4d7f7a (patch) | |
tree | 9272b3863e92b6170dff071e4f77736d4e4cb4a4 /src/topology | |
parent | 852f1310d147ac6767bdcb5d9c11110db60c14e6 (diff) | |
download | gnunet-7864d3fc9dc21f7a91e6f7b5a380840a2b4d7f7a.tar.gz gnunet-7864d3fc9dc21f7a91e6f7b5a380840a2b4d7f7a.zip |
debugging, found a few more crashes with the hostlist test
Diffstat (limited to 'src/topology')
-rw-r--r-- | src/topology/gnunet-daemon-topology.c | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/src/topology/gnunet-daemon-topology.c b/src/topology/gnunet-daemon-topology.c index f63cc0d85..ad306e03c 100644 --- a/src/topology/gnunet-daemon-topology.c +++ b/src/topology/gnunet-daemon-topology.c | |||
@@ -251,13 +251,23 @@ static size_t | |||
251 | ready_callback (void *cls, | 251 | ready_callback (void *cls, |
252 | size_t size, void *buf) | 252 | size_t size, void *buf) |
253 | { | 253 | { |
254 | struct GNUNET_MessageHeader hdr; | ||
255 | if (buf == NULL) | ||
256 | { | ||
257 | #if DEBUG_TOPOLOGY | ||
258 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | ||
259 | "Core told us that our attempt to connect failed.\n"); | ||
260 | #endif | ||
261 | return 0; | ||
262 | } | ||
254 | #if DEBUG_TOPOLOGY | 263 | #if DEBUG_TOPOLOGY |
255 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 264 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
256 | (buf == NULL) | 265 | "Sending dummy message to establish connection.\n"); |
257 | ? "Core told us that our attempt to connect failed.\n" | ||
258 | : "Core told us that our attempt to connect worked. Good!\n"); | ||
259 | #endif | 266 | #endif |
260 | return 0; | 267 | hdr.size = htons (sizeof (struct GNUNET_MessageHeader)); |
268 | hdr.type = htons (GNUNET_MESSAGE_TYPE_TOPOLOGY_DUMMY); | ||
269 | memcpy (buf, &hdr, sizeof (struct GNUNET_MessageHeader)); | ||
270 | return sizeof (struct GNUNET_MessageHeader); | ||
261 | } | 271 | } |
262 | 272 | ||
263 | 273 | ||