diff options
Diffstat (limited to 'src/dht/plugin_block_dht.c')
-rw-r--r-- | src/dht/plugin_block_dht.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/src/dht/plugin_block_dht.c b/src/dht/plugin_block_dht.c index 17594efcb..8bb533961 100644 --- a/src/dht/plugin_block_dht.c +++ b/src/dht/plugin_block_dht.c | |||
@@ -70,12 +70,13 @@ block_plugin_dht_evaluate (void *cls, | |||
70 | 70 | ||
71 | if (type != GNUNET_BLOCK_TYPE_DHT_HELLO) | 71 | if (type != GNUNET_BLOCK_TYPE_DHT_HELLO) |
72 | return GNUNET_BLOCK_EVALUATION_TYPE_NOT_SUPPORTED; | 72 | return GNUNET_BLOCK_EVALUATION_TYPE_NOT_SUPPORTED; |
73 | if (xquery_size != 0) | 73 | if (0 != xquery_size) |
74 | { | 74 | { |
75 | GNUNET_break_op (0); | 75 | GNUNET_break_op (0); |
76 | return GNUNET_BLOCK_EVALUATION_REQUEST_INVALID; | 76 | return GNUNET_BLOCK_EVALUATION_REQUEST_INVALID; |
77 | } | 77 | } |
78 | if (NULL == reply_block) | 78 | if ( (NULL == reply_block) || |
79 | (0 == reply_block_size) ) | ||
79 | return GNUNET_BLOCK_EVALUATION_REQUEST_VALID; | 80 | return GNUNET_BLOCK_EVALUATION_REQUEST_VALID; |
80 | if (reply_block_size < sizeof (struct GNUNET_MessageHeader)) | 81 | if (reply_block_size < sizeof (struct GNUNET_MessageHeader)) |
81 | { | 82 | { |
@@ -121,14 +122,16 @@ block_plugin_dht_evaluate (void *cls, | |||
121 | * @param type block type | 122 | * @param type block type |
122 | * @param block block to get the key for | 123 | * @param block block to get the key for |
123 | * @param block_size number of bytes @a block | 124 | * @param block_size number of bytes @a block |
124 | * @param key set to the key (query) for the given block | 125 | * @param[out] key set to the key (query) for the given block |
125 | * @return #GNUNET_OK on success, #GNUNET_SYSERR if type not supported | 126 | * @return #GNUNET_OK on success, #GNUNET_SYSERR if type not supported |
126 | * (or if extracting a key from a block of this type does not work) | 127 | * (or if extracting a key from a block of this type does not work) |
127 | */ | 128 | */ |
128 | static int | 129 | static int |
129 | block_plugin_dht_get_key (void *cls, enum GNUNET_BLOCK_Type type, | 130 | block_plugin_dht_get_key (void *cls, |
130 | const void *block, size_t block_size, | 131 | enum GNUNET_BLOCK_Type type, |
131 | struct GNUNET_HashCode * key) | 132 | const void *block, |
133 | size_t block_size, | ||
134 | struct GNUNET_HashCode *key) | ||
132 | { | 135 | { |
133 | const struct GNUNET_MessageHeader *msg; | 136 | const struct GNUNET_MessageHeader *msg; |
134 | const struct GNUNET_HELLO_Message *hello; | 137 | const struct GNUNET_HELLO_Message *hello; |