diff options
Diffstat (limited to 'src/namestore/gnunet-namestore-fcfsd.c')
-rw-r--r-- | src/namestore/gnunet-namestore-fcfsd.c | 58 |
1 files changed, 29 insertions, 29 deletions
diff --git a/src/namestore/gnunet-namestore-fcfsd.c b/src/namestore/gnunet-namestore-fcfsd.c index 4b110a548..7455c0ba5 100644 --- a/src/namestore/gnunet-namestore-fcfsd.c +++ b/src/namestore/gnunet-namestore-fcfsd.c | |||
@@ -120,7 +120,7 @@ struct Request | |||
120 | struct MHD_PostProcessor *pp; | 120 | struct MHD_PostProcessor *pp; |
121 | 121 | ||
122 | /** | 122 | /** |
123 | * URL to serve in response to this POST (if this request | 123 | * URL to serve in response to this POST (if this request |
124 | * was a 'POST') | 124 | * was a 'POST') |
125 | */ | 125 | */ |
126 | const char *post_url; | 126 | const char *post_url; |
@@ -129,7 +129,7 @@ struct Request | |||
129 | * Active request with the namestore. | 129 | * Active request with the namestore. |
130 | */ | 130 | */ |
131 | struct GNUNET_NAMESTORE_QueueEntry *qe; | 131 | struct GNUNET_NAMESTORE_QueueEntry *qe; |
132 | 132 | ||
133 | /** | 133 | /** |
134 | * Current processing phase. | 134 | * Current processing phase. |
135 | */ | 135 | */ |
@@ -171,7 +171,7 @@ struct ZoneinfoRequest | |||
171 | * Buffer length | 171 | * Buffer length |
172 | */ | 172 | */ |
173 | size_t buf_len; | 173 | size_t buf_len; |
174 | 174 | ||
175 | /** | 175 | /** |
176 | * Buffer write offset | 176 | * Buffer write offset |
177 | */ | 177 | */ |
@@ -270,8 +270,8 @@ iterate_cb (void *cls, | |||
270 | MHD_add_response_header (response, | 270 | MHD_add_response_header (response, |
271 | MHD_HTTP_HEADER_CONTENT_TYPE, | 271 | MHD_HTTP_HEADER_CONTENT_TYPE, |
272 | MIME_HTML); | 272 | MIME_HTML); |
273 | MHD_queue_response (zr->connection, | 273 | MHD_queue_response (zr->connection, |
274 | MHD_HTTP_OK, | 274 | MHD_HTTP_OK, |
275 | response); | 275 | response); |
276 | MHD_destroy_response (response); | 276 | MHD_destroy_response (response); |
277 | GNUNET_free (zr->zoneinfo); | 277 | GNUNET_free (zr->zoneinfo); |
@@ -305,9 +305,9 @@ iterate_cb (void *cls, | |||
305 | zr->zoneinfo = new_buf; | 305 | zr->zoneinfo = new_buf; |
306 | zr->buf_len *= 2; | 306 | zr->buf_len *= 2; |
307 | } | 307 | } |
308 | sprintf (zr->zoneinfo + zr->write_offset, | 308 | sprintf (zr->zoneinfo + zr->write_offset, |
309 | "<tr><td>%s</td><td>%s</td></tr>", | 309 | "<tr><td>%s</td><td>%s</td></tr>", |
310 | name, | 310 | name, |
311 | pkey); | 311 | pkey); |
312 | zr->write_offset = strlen (zr->zoneinfo); | 312 | zr->write_offset = strlen (zr->zoneinfo); |
313 | GNUNET_NAMESTORE_zone_iterator_next (zr->list_it); | 313 | GNUNET_NAMESTORE_zone_iterator_next (zr->list_it); |
@@ -359,8 +359,8 @@ serve_main_page (struct MHD_Connection *connection) | |||
359 | MHD_add_response_header (response, | 359 | MHD_add_response_header (response, |
360 | MHD_HTTP_HEADER_CONTENT_TYPE, | 360 | MHD_HTTP_HEADER_CONTENT_TYPE, |
361 | MIME_HTML); | 361 | MIME_HTML); |
362 | ret = MHD_queue_response (connection, | 362 | ret = MHD_queue_response (connection, |
363 | MHD_HTTP_OK, | 363 | MHD_HTTP_OK, |
364 | response); | 364 | response); |
365 | MHD_destroy_response (response); | 365 | MHD_destroy_response (response); |
366 | return ret; | 366 | return ret; |
@@ -394,8 +394,8 @@ fill_s_reply (const char *info, | |||
394 | MHD_add_response_header (response, | 394 | MHD_add_response_header (response, |
395 | MHD_HTTP_HEADER_CONTENT_TYPE, | 395 | MHD_HTTP_HEADER_CONTENT_TYPE, |
396 | MIME_HTML); | 396 | MIME_HTML); |
397 | ret = MHD_queue_response (connection, | 397 | ret = MHD_queue_response (connection, |
398 | MHD_HTTP_OK, | 398 | MHD_HTTP_OK, |
399 | response); | 399 | response); |
400 | MHD_destroy_response (response); | 400 | MHD_destroy_response (response); |
401 | return ret; | 401 | return ret; |
@@ -471,7 +471,7 @@ post_iterator (void *cls, | |||
471 | * GNUNET_YES (or other positive value) on success | 471 | * GNUNET_YES (or other positive value) on success |
472 | * @param emsg NULL on success, otherwise an error message | 472 | * @param emsg NULL on success, otherwise an error message |
473 | */ | 473 | */ |
474 | static void | 474 | static void |
475 | put_continuation (void *cls, | 475 | put_continuation (void *cls, |
476 | int32_t success, | 476 | int32_t success, |
477 | const char *emsg) | 477 | const char *emsg) |
@@ -502,7 +502,7 @@ put_continuation (void *cls, | |||
502 | * @param rd_count number of entries in 'rd' array | 502 | * @param rd_count number of entries in 'rd' array |
503 | * @param rd array of records with data to store | 503 | * @param rd array of records with data to store |
504 | */ | 504 | */ |
505 | static void | 505 | static void |
506 | zone_to_name_cb (void *cls, | 506 | zone_to_name_cb (void *cls, |
507 | const struct GNUNET_CRYPTO_EccPrivateKey *zone_key, | 507 | const struct GNUNET_CRYPTO_EccPrivateKey *zone_key, |
508 | const char *name, | 508 | const char *name, |
@@ -512,7 +512,7 @@ zone_to_name_cb (void *cls, | |||
512 | struct Request *request = cls; | 512 | struct Request *request = cls; |
513 | struct GNUNET_NAMESTORE_RecordData r; | 513 | struct GNUNET_NAMESTORE_RecordData r; |
514 | struct GNUNET_CRYPTO_EccPublicSignKey pub; | 514 | struct GNUNET_CRYPTO_EccPublicSignKey pub; |
515 | 515 | ||
516 | request->qe = NULL; | 516 | request->qe = NULL; |
517 | if (NULL != name) | 517 | if (NULL != name) |
518 | { | 518 | { |
@@ -548,14 +548,14 @@ zone_to_name_cb (void *cls, | |||
548 | * @param rd_count number of entries in 'rd' array | 548 | * @param rd_count number of entries in 'rd' array |
549 | * @param rd array of records with data to store | 549 | * @param rd array of records with data to store |
550 | */ | 550 | */ |
551 | static void | 551 | static void |
552 | lookup_result_processor (void *cls, | 552 | lookup_result_processor (void *cls, |
553 | unsigned int rd_count, | 553 | unsigned int rd_count, |
554 | const struct GNUNET_NAMESTORE_RecordData *rd) | 554 | const struct GNUNET_NAMESTORE_RecordData *rd) |
555 | { | 555 | { |
556 | struct Request *request = cls; | 556 | struct Request *request = cls; |
557 | struct GNUNET_CRYPTO_EccPublicSignKey pub; | 557 | struct GNUNET_CRYPTO_EccPublicSignKey pub; |
558 | 558 | ||
559 | if (0 != rd_count) | 559 | if (0 != rd_count) |
560 | { | 560 | { |
561 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, | 561 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, |
@@ -606,7 +606,7 @@ lookup_block_processor (void *cls, | |||
606 | } | 606 | } |
607 | GNUNET_CRYPTO_ecc_key_get_public_for_signature (&fcfs_zone_pkey, | 607 | GNUNET_CRYPTO_ecc_key_get_public_for_signature (&fcfs_zone_pkey, |
608 | &pub); | 608 | &pub); |
609 | if (GNUNET_OK != | 609 | if (GNUNET_OK != |
610 | GNUNET_NAMESTORE_block_decrypt (block, | 610 | GNUNET_NAMESTORE_block_decrypt (block, |
611 | &pub, | 611 | &pub, |
612 | request->domain_name, | 612 | request->domain_name, |
@@ -650,7 +650,7 @@ create_response (void *cls, | |||
650 | const char *url, | 650 | const char *url, |
651 | const char *method, | 651 | const char *method, |
652 | const char *version, | 652 | const char *version, |
653 | const char *upload_data, | 653 | const char *upload_data, |
654 | size_t *upload_data_size, | 654 | size_t *upload_data_size, |
655 | void **ptr) | 655 | void **ptr) |
656 | { | 656 | { |
@@ -688,7 +688,7 @@ create_response (void *cls, | |||
688 | _("Failed to setup post processor for `%s'\n"), | 688 | _("Failed to setup post processor for `%s'\n"), |
689 | url); | 689 | url); |
690 | return MHD_NO; /* internal error */ | 690 | return MHD_NO; /* internal error */ |
691 | } | 691 | } |
692 | return MHD_YES; | 692 | return MHD_YES; |
693 | } | 693 | } |
694 | if (NULL != request->pp) | 694 | if (NULL != request->pp) |
@@ -759,14 +759,14 @@ create_response (void *cls, | |||
759 | GNUNET_break (0); | 759 | GNUNET_break (0); |
760 | return MHD_NO; | 760 | return MHD_NO; |
761 | } | 761 | } |
762 | return MHD_YES; /* will have a reply later... */ | 762 | return MHD_YES; /* will have a reply later... */ |
763 | } | 763 | } |
764 | /* unsupported HTTP method */ | 764 | /* unsupported HTTP method */ |
765 | response = MHD_create_response_from_buffer (strlen (METHOD_ERROR), | 765 | response = MHD_create_response_from_buffer (strlen (METHOD_ERROR), |
766 | (void *) METHOD_ERROR, | 766 | (void *) METHOD_ERROR, |
767 | MHD_RESPMEM_PERSISTENT); | 767 | MHD_RESPMEM_PERSISTENT); |
768 | ret = MHD_queue_response (connection, | 768 | ret = MHD_queue_response (connection, |
769 | MHD_HTTP_METHOD_NOT_ACCEPTABLE, | 769 | MHD_HTTP_METHOD_NOT_ACCEPTABLE, |
770 | response); | 770 | response); |
771 | MHD_destroy_response (response); | 771 | MHD_destroy_response (response); |
772 | return ret; | 772 | return ret; |
@@ -900,7 +900,7 @@ do_shutdown (void *cls, | |||
900 | } | 900 | } |
901 | 901 | ||
902 | 902 | ||
903 | /** | 903 | /** |
904 | * Method called to inform about the egos of this peer. | 904 | * Method called to inform about the egos of this peer. |
905 | * | 905 | * |
906 | * When used with #GNUNET_IDENTITY_create or #GNUNET_IDENTITY_get, | 906 | * When used with #GNUNET_IDENTITY_create or #GNUNET_IDENTITY_get, |
@@ -908,7 +908,7 @@ do_shutdown (void *cls, | |||
908 | * @a ego does indicate an error (i.e. name is taken or no default | 908 | * @a ego does indicate an error (i.e. name is taken or no default |
909 | * value is known). If @a ego is non-NULL and if '*ctx' | 909 | * value is known). If @a ego is non-NULL and if '*ctx' |
910 | * is set in those callbacks, the value WILL be passed to a subsequent | 910 | * is set in those callbacks, the value WILL be passed to a subsequent |
911 | * call to the identity callback of #GNUNET_IDENTITY_connect (if | 911 | * call to the identity callback of #GNUNET_IDENTITY_connect (if |
912 | * that one was not NULL). | 912 | * that one was not NULL). |
913 | * | 913 | * |
914 | * @param cls closure, NULL | 914 | * @param cls closure, NULL |
@@ -941,12 +941,12 @@ identity_cb (void *cls, | |||
941 | { | 941 | { |
942 | httpd = MHD_start_daemon (options, | 942 | httpd = MHD_start_daemon (options, |
943 | (uint16_t) port, | 943 | (uint16_t) port, |
944 | NULL, NULL, | 944 | NULL, NULL, |
945 | &create_response, NULL, | 945 | &create_response, NULL, |
946 | MHD_OPTION_CONNECTION_LIMIT, (unsigned int) 128, | 946 | MHD_OPTION_CONNECTION_LIMIT, (unsigned int) 128, |
947 | MHD_OPTION_PER_IP_CONNECTION_LIMIT, (unsigned int) 1, | 947 | MHD_OPTION_PER_IP_CONNECTION_LIMIT, (unsigned int) 1, |
948 | MHD_OPTION_CONNECTION_TIMEOUT, (unsigned int) 16, | 948 | MHD_OPTION_CONNECTION_TIMEOUT, (unsigned int) 16, |
949 | MHD_OPTION_CONNECTION_MEMORY_LIMIT, (size_t) (4 * 1024), | 949 | MHD_OPTION_CONNECTION_MEMORY_LIMIT, (size_t) (4 * 1024), |
950 | MHD_OPTION_NOTIFY_COMPLETED, &request_completed_callback, NULL, | 950 | MHD_OPTION_NOTIFY_COMPLETED, &request_completed_callback, NULL, |
951 | MHD_OPTION_END); | 951 | MHD_OPTION_END); |
952 | if (MHD_USE_DEBUG == options) | 952 | if (MHD_USE_DEBUG == options) |
@@ -1026,7 +1026,7 @@ main (int argc, char *const *argv) | |||
1026 | ret = | 1026 | ret = |
1027 | (GNUNET_OK == | 1027 | (GNUNET_OK == |
1028 | GNUNET_PROGRAM_run (argc, argv, "fcfsd", | 1028 | GNUNET_PROGRAM_run (argc, argv, "fcfsd", |
1029 | _("GNU Name System First Come First Serve name registration service"), | 1029 | _("GNU Name System First Come First Serve name registration service"), |
1030 | options, | 1030 | options, |
1031 | &run, NULL)) ? 0 : 1; | 1031 | &run, NULL)) ? 0 : 1; |
1032 | GNUNET_free ((void*) argv); | 1032 | GNUNET_free ((void*) argv); |