aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2013-07-16 07:42:11 +0000
committerChristian Grothoff <christian@grothoff.org>2013-07-16 07:42:11 +0000
commit1cd462e473e674fa5ab78110ec4f4c26dce1fb73 (patch)
treeb368b320349aebec6d825c87676dfa4fb3998c79
parentac9ec4a3dadd323c8b03c1e804748ac987b7c972 (diff)
downloadgnunet-1cd462e473e674fa5ab78110ec4f4c26dce1fb73.tar.gz
gnunet-1cd462e473e674fa5ab78110ec4f4c26dce1fb73.zip
-handle get failure properly
-rw-r--r--src/identity/gnunet-service-identity.c2
-rw-r--r--src/identity/identity_api.c13
2 files changed, 7 insertions, 8 deletions
diff --git a/src/identity/gnunet-service-identity.c b/src/identity/gnunet-service-identity.c
index 95fb79c38..25352170b 100644
--- a/src/identity/gnunet-service-identity.c
+++ b/src/identity/gnunet-service-identity.c
@@ -315,7 +315,6 @@ handle_get_default_message (void *cls, struct GNUNET_SERVER_Client *client,
315 "DEFAULT_IDENTIFIER", 315 "DEFAULT_IDENTIFIER",
316 &identifier)) 316 &identifier))
317 { 317 {
318 /* FIXME: not sure client API handles this case correctly right now... */
319 send_result_code (client, 1, gettext_noop ("no default known")); 318 send_result_code (client, 1, gettext_noop ("no default known"));
320 GNUNET_SERVER_receive_done (client, GNUNET_OK); 319 GNUNET_SERVER_receive_done (client, GNUNET_OK);
321 return; 320 return;
@@ -333,7 +332,6 @@ handle_get_default_message (void *cls, struct GNUNET_SERVER_Client *client,
333 return; 332 return;
334 } 333 }
335 } 334 }
336 /* FIXME: not sure client API handles this case correctly right now... */
337 send_result_code (client, 1, 335 send_result_code (client, 1,
338 gettext_noop ("default configured, but ego unknown (internal error)")); 336 gettext_noop ("default configured, but ego unknown (internal error)"));
339 GNUNET_SERVER_receive_done (client, GNUNET_OK); 337 GNUNET_SERVER_receive_done (client, GNUNET_OK);
diff --git a/src/identity/identity_api.c b/src/identity/identity_api.c
index 8be81e124..f7f1530fc 100644
--- a/src/identity/identity_api.c
+++ b/src/identity/identity_api.c
@@ -276,7 +276,8 @@ message_handler (void *cls,
276 if (NULL != op->cont) 276 if (NULL != op->cont)
277 op->cont (op->cls, 277 op->cont (op->cls,
278 str); 278 str);
279 GNUNET_break (NULL == op->cb); 279 else if (NULL != op->cb)
280 op->cb (op->cls, NULL, NULL, NULL);
280 GNUNET_free (op); 281 GNUNET_free (op);
281 break; 282 break;
282 case GNUNET_MESSAGE_TYPE_IDENTITY_UPDATE: 283 case GNUNET_MESSAGE_TYPE_IDENTITY_UPDATE:
@@ -340,10 +341,11 @@ message_handler (void *cls,
340 GNUNET_CRYPTO_ecc_key_free (priv); 341 GNUNET_CRYPTO_ecc_key_free (priv);
341 } 342 }
342 /* inform application about change */ 343 /* inform application about change */
343 h->cb (h->cb_cls, 344 if (NULL != h->cb)
344 ego, 345 h->cb (h->cb_cls,
345 &ego->ctx, 346 ego,
346 str); 347 &ego->ctx,
348 str);
347 if (NULL == str) 349 if (NULL == str)
348 { 350 {
349 /* ego was deleted */ 351 /* ego was deleted */
@@ -413,7 +415,6 @@ message_handler (void *cls,
413 ego, 415 ego,
414 &ego->ctx, 416 &ego->ctx,
415 ego->identifier); 417 ego->identifier);
416 GNUNET_break (NULL == op->cont);
417 GNUNET_free (op); 418 GNUNET_free (op);
418 break; 419 break;
419 default: 420 default: