diff options
author | Matthias Wachs <wachs@net.in.tum.de> | 2012-03-06 13:44:15 +0000 |
---|---|---|
committer | Matthias Wachs <wachs@net.in.tum.de> | 2012-03-06 13:44:15 +0000 |
commit | c7c6d105dfed910ddb4fa3465137b425999a3928 (patch) | |
tree | 8677e1fbef55d2ebf3776667ef164825d55a089c /src/namestore/namestore_api.c | |
parent | 0a6ac36c18891cbff721def0f66dee9991c7c220 (diff) | |
download | gnunet-c7c6d105dfed910ddb4fa3465137b425999a3928.tar.gz gnunet-c7c6d105dfed910ddb4fa3465137b425999a3928.zip |
- checkin nbo conversion
Diffstat (limited to 'src/namestore/namestore_api.c')
-rw-r--r-- | src/namestore/namestore_api.c | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/src/namestore/namestore_api.c b/src/namestore/namestore_api.c index f96fc88cf..31de00c81 100644 --- a/src/namestore/namestore_api.c +++ b/src/namestore/namestore_api.c | |||
@@ -324,22 +324,22 @@ handle_record_put_response (struct GNUNET_NAMESTORE_QueueEntry *qe, | |||
324 | { | 324 | { |
325 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Received `%s' \n", | 325 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Received `%s' \n", |
326 | "RECORD_PUT_RESPONSE"); | 326 | "RECORD_PUT_RESPONSE"); |
327 | |||
328 | struct GNUNET_NAMESTORE_Handle *h = qe->nsh; | 327 | struct GNUNET_NAMESTORE_Handle *h = qe->nsh; |
328 | int res = ntohl (msg->op_result); | ||
329 | 329 | ||
330 | if (ntohs (msg->op_result) == GNUNET_OK) | 330 | if (res == GNUNET_OK) |
331 | { | 331 | { |
332 | if (qe->cont != NULL) | 332 | if (qe->cont != NULL) |
333 | { | 333 | { |
334 | qe->cont (qe->cont_cls, GNUNET_OK, _("Namestore added record successfully")); | 334 | qe->cont (qe->cont_cls, res, _("Namestore added record successfully")); |
335 | } | 335 | } |
336 | 336 | ||
337 | } | 337 | } |
338 | else if (ntohs (msg->op_result) == GNUNET_SYSERR) | 338 | else if (res == GNUNET_SYSERR) |
339 | { | 339 | { |
340 | if (qe->cont != NULL) | 340 | if (qe->cont != NULL) |
341 | { | 341 | { |
342 | qe->cont (qe->cont_cls, GNUNET_SYSERR, _("Namestore failed to add record")); | 342 | qe->cont (qe->cont_cls, res, _("Namestore failed to add record")); |
343 | } | 343 | } |
344 | } | 344 | } |
345 | else | 345 | else |
@@ -362,24 +362,24 @@ handle_record_create_response (struct GNUNET_NAMESTORE_QueueEntry *qe, | |||
362 | { | 362 | { |
363 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Received `%s' \n", | 363 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Received `%s' \n", |
364 | "RECORD_CREATE_RESPONSE"); | 364 | "RECORD_CREATE_RESPONSE"); |
365 | |||
366 | struct GNUNET_NAMESTORE_Handle *h = qe->nsh; | 365 | struct GNUNET_NAMESTORE_Handle *h = qe->nsh; |
366 | int res = ntohl (msg->op_result); | ||
367 | 367 | ||
368 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Received `%s' %i\n", | 368 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Received `%s' %i\n", |
369 | "RECORD_CREATE_RESPONSE", ntohs (msg->op_result)); | 369 | "RECORD_CREATE_RESPONSE", ntohs (msg->op_result)); |
370 | if (ntohs (msg->op_result) == GNUNET_YES) | 370 | if (res == GNUNET_YES) |
371 | { | 371 | { |
372 | if (qe->cont != NULL) | 372 | if (qe->cont != NULL) |
373 | { | 373 | { |
374 | qe->cont (qe->cont_cls, GNUNET_YES, _("Namestore added record successfully")); | 374 | qe->cont (qe->cont_cls, res, _("Namestore added record successfully")); |
375 | } | 375 | } |
376 | 376 | ||
377 | } | 377 | } |
378 | else if (ntohs (msg->op_result) == GNUNET_NO) | 378 | else if (res == GNUNET_NO) |
379 | { | 379 | { |
380 | if (qe->cont != NULL) | 380 | if (qe->cont != NULL) |
381 | { | 381 | { |
382 | qe->cont (qe->cont_cls, GNUNET_NO, _("Namestore record already existed")); | 382 | qe->cont (qe->cont_cls, res, _("Namestore record already existed")); |
383 | } | 383 | } |
384 | } | 384 | } |
385 | else | 385 | else |
@@ -406,7 +406,7 @@ handle_record_remove_response (struct GNUNET_NAMESTORE_QueueEntry *qe, | |||
406 | "RECORD_REMOVE_RESPONSE"); | 406 | "RECORD_REMOVE_RESPONSE"); |
407 | 407 | ||
408 | struct GNUNET_NAMESTORE_Handle *h = qe->nsh; | 408 | struct GNUNET_NAMESTORE_Handle *h = qe->nsh; |
409 | int res = ntohs (msg->op_result); | 409 | int res = ntohl (msg->op_result); |
410 | 410 | ||
411 | /** | 411 | /** |
412 | * result: | 412 | * result: |
@@ -909,7 +909,7 @@ void | |||
909 | GNUNET_NAMESTORE_disconnect (struct GNUNET_NAMESTORE_Handle *h, int drop) | 909 | GNUNET_NAMESTORE_disconnect (struct GNUNET_NAMESTORE_Handle *h, int drop) |
910 | { | 910 | { |
911 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Disconnecting from namestore service\n"); | 911 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Disconnecting from namestore service\n"); |
912 | GNUNET_SCHEDULER_add_now (&clean_up_task, h); | 912 | GNUNET_SCHEDULER_add_now (&clean_up_task, h); |
913 | } | 913 | } |
914 | 914 | ||
915 | 915 | ||
@@ -1312,8 +1312,8 @@ GNUNET_NAMESTORE_lookup_record (struct GNUNET_NAMESTORE_Handle *h, | |||
1312 | msg->gns_header.header.size = htons (msg_size); | 1312 | msg->gns_header.header.size = htons (msg_size); |
1313 | msg->gns_header.r_id = htonl (rid); | 1313 | msg->gns_header.r_id = htonl (rid); |
1314 | msg->record_type = htonl (record_type); | 1314 | msg->record_type = htonl (record_type); |
1315 | msg->zone = *zone; | ||
1316 | msg->name_len = htonl (name_len); | 1315 | msg->name_len = htonl (name_len); |
1316 | msg->zone = *zone; | ||
1317 | memcpy (&msg[1], name, name_len); | 1317 | memcpy (&msg[1], name, name_len); |
1318 | 1318 | ||
1319 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Sending `%s' message for name `%s'\n", "NAMESTORE_LOOKUP_NAME", name); | 1319 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Sending `%s' message for name `%s'\n", "NAMESTORE_LOOKUP_NAME", name); |