aboutsummaryrefslogtreecommitdiff
path: root/src/namestore
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2013-07-09 14:37:12 +0000
committerChristian Grothoff <christian@grothoff.org>2013-07-09 14:37:12 +0000
commit15e649e0158e4e591779dbba8bb89a9b1aceecc6 (patch)
treec3c941a8bb476648148c1ab26ca193f9f3788555 /src/namestore
parent733629155b27695e462e43a4883b79769ebecbb5 (diff)
downloadgnunet-15e649e0158e4e591779dbba8bb89a9b1aceecc6.tar.gz
gnunet-15e649e0158e4e591779dbba8bb89a9b1aceecc6.zip
-fixes in monitoring code
Diffstat (limited to 'src/namestore')
-rw-r--r--src/namestore/gnunet-service-namestore.c3
-rw-r--r--src/namestore/namestore_api_monitor.c13
-rw-r--r--src/namestore/test_namestore_api_monitoring.c23
3 files changed, 11 insertions, 28 deletions
diff --git a/src/namestore/gnunet-service-namestore.c b/src/namestore/gnunet-service-namestore.c
index eb1dc17b8..d43e5110d 100644
--- a/src/namestore/gnunet-service-namestore.c
+++ b/src/namestore/gnunet-service-namestore.c
@@ -2020,9 +2020,10 @@ handle_monitor_start (void *cls,
2020 } 2020 }
2021 GNUNET_CONTAINER_DLL_insert (monitor_head, monitor_tail, zm); 2021 GNUNET_CONTAINER_DLL_insert (monitor_head, monitor_tail, zm);
2022 GNUNET_SERVER_client_mark_monitor (client); 2022 GNUNET_SERVER_client_mark_monitor (client);
2023 GNUNET_SERVER_disable_receive_done_warning (client);
2023 GNUNET_SERVER_notification_context_add (monitor_nc, 2024 GNUNET_SERVER_notification_context_add (monitor_nc,
2024 client); 2025 client);
2025 zm->task = GNUNET_SCHEDULER_add_now (&monitor_next, zm); 2026 zm->task = GNUNET_SCHEDULER_add_now (&monitor_next, zm);
2026} 2027}
2027 2028
2028 2029
diff --git a/src/namestore/namestore_api_monitor.c b/src/namestore/namestore_api_monitor.c
index 8f6aacf19..a6a014839 100644
--- a/src/namestore/namestore_api_monitor.c
+++ b/src/namestore/namestore_api_monitor.c
@@ -205,10 +205,10 @@ handle_updates (void *cls,
205 &handle_updates, 205 &handle_updates,
206 zm, 206 zm,
207 GNUNET_TIME_UNIT_FOREVER_REL); 207 GNUNET_TIME_UNIT_FOREVER_REL);
208 zm->monitor(zm->cls, 208 zm->monitor (zm->cls,
209 &lrm->public_key, expire, 209 &lrm->public_key, expire,
210 name_tmp, 210 name_tmp,
211 rd_count, rd, &lrm->signature); 211 rd_count, rd, NULL);
212 } 212 }
213} 213}
214 214
@@ -229,12 +229,15 @@ transmit_monitor_message (void *cls,
229 struct GNUNET_NAMESTORE_ZoneMonitor *zm = cls; 229 struct GNUNET_NAMESTORE_ZoneMonitor *zm = cls;
230 struct ZoneMonitorStartMessage sm; 230 struct ZoneMonitorStartMessage sm;
231 231
232 zm->th = NULL;
232 if (size < sizeof (struct ZoneMonitorStartMessage)) 233 if (size < sizeof (struct ZoneMonitorStartMessage))
233 { 234 {
234 reconnect (zm); 235 reconnect (zm);
235 return 0; 236 return 0;
236 } 237 }
237 238 sm.gns_header.header.type = htons (GNUNET_MESSAGE_TYPE_NAMESTORE_MONITOR_START);
239 sm.gns_header.header.size = htons (sizeof (struct ZoneMonitorStartMessage));
240 sm.gns_header.r_id = htonl (0);
238 sm.zone = zm->zone; 241 sm.zone = zm->zone;
239 sm.all_zones = htonl (zm->all_zones); 242 sm.all_zones = htonl (zm->all_zones);
240 memcpy (buf, &sm, sizeof (sm)); 243 memcpy (buf, &sm, sizeof (sm));
diff --git a/src/namestore/test_namestore_api_monitoring.c b/src/namestore/test_namestore_api_monitoring.c
index a55e8b525..b3147c43a 100644
--- a/src/namestore/test_namestore_api_monitoring.c
+++ b/src/namestore/test_namestore_api_monitoring.c
@@ -159,28 +159,7 @@ zone_proc (void *cls,
159 const struct GNUNET_NAMESTORE_RecordData *rd, 159 const struct GNUNET_NAMESTORE_RecordData *rd,
160 const struct GNUNET_CRYPTO_EccSignature *signature) 160 const struct GNUNET_CRYPTO_EccSignature *signature)
161{ 161{
162 fprintf (stderr, 162 GNUNET_break (NULL == signature);
163 "Monitor cb for %s\n",
164 name);
165 if (GNUNET_OK != GNUNET_NAMESTORE_verify_signature (zone_key,
166 expire, name,
167 rd_count, rd,
168 signature))
169 {
170 struct GNUNET_HashCode zone_key_hash;
171
172 GNUNET_CRYPTO_hash (zone_key,
173 sizeof (struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded),
174 &zone_key_hash);
175 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
176 "Verifying signature for `%s' in zone `%s' with %u records and expiration %llu failed\n",
177 name,
178 GNUNET_h2s(&zone_key_hash),
179 rd_count,
180 expire.abs_value);
181 GNUNET_break (0);
182 }
183
184 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 163 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
185 "Comparing results name %s\n", 164 "Comparing results name %s\n",
186 name); 165 name);