aboutsummaryrefslogtreecommitdiff
path: root/src/namestore
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2013-09-06 12:05:24 +0000
committerChristian Grothoff <christian@grothoff.org>2013-09-06 12:05:24 +0000
commit8675d5f1a8906b4255562f878e140acc0ee8fafc (patch)
tree40f140e61d6b2a5212d2aa94b7379ec0d9f03494 /src/namestore
parent3a56bf7aa7e6de7d096cb509054b5dab1e50d119 (diff)
downloadgnunet-8675d5f1a8906b4255562f878e140acc0ee8fafc.tar.gz
gnunet-8675d5f1a8906b4255562f878e140acc0ee8fafc.zip
-misc fixes
Diffstat (limited to 'src/namestore')
-rw-r--r--src/namestore/gnunet-namestore-fcfsd.c37
-rw-r--r--src/namestore/gnunet-service-namestore.c2
-rw-r--r--src/namestore/namestore_api_common.c5
3 files changed, 26 insertions, 18 deletions
diff --git a/src/namestore/gnunet-namestore-fcfsd.c b/src/namestore/gnunet-namestore-fcfsd.c
index c0b9f4da6..041b046ba 100644
--- a/src/namestore/gnunet-namestore-fcfsd.c
+++ b/src/namestore/gnunet-namestore-fcfsd.c
@@ -23,6 +23,8 @@
23 * @author Christian Grothoff 23 * @author Christian Grothoff
24 * 24 *
25 * TODO: 25 * TODO:
26 * - need to track active zone info requests so we can cancel them
27 * during shutdown, right?
26 * - the code currently contains a 'race' between checking that the 28 * - the code currently contains a 'race' between checking that the
27 * domain name is available and allocating it to the new public key 29 * domain name is available and allocating it to the new public key
28 * (should this race be solved by namestore or by fcfsd?) 30 * (should this race be solved by namestore or by fcfsd?)
@@ -921,6 +923,8 @@ identity_cb (void *cls,
921 void **ctx, 923 void **ctx,
922 const char *name) 924 const char *name)
923{ 925{
926 int options;
927
924 id_op = NULL; 928 id_op = NULL;
925 if (NULL == ego) 929 if (NULL == ego)
926 { 930 {
@@ -930,21 +934,24 @@ identity_cb (void *cls,
930 } 934 }
931 fcfs_zone_pkey = *GNUNET_IDENTITY_ego_get_private_key (ego); 935 fcfs_zone_pkey = *GNUNET_IDENTITY_ego_get_private_key (ego);
932 936
933 937 options = MHD_USE_DUAL_STACK | MHD_USE_DEBUG;
934 httpd = MHD_start_daemon ( 938 do
935#ifdef MHD_USE_DUAL_STACK 939 {
936 MHD_USE_DUAL_STACK | 940 httpd = MHD_start_daemon (options,
937#endif 941 (uint16_t) port,
938 MHD_USE_DEBUG, 942 NULL, NULL,
939 (uint16_t) port, 943 &create_response, NULL,
940 NULL, NULL, 944 MHD_OPTION_CONNECTION_LIMIT, (unsigned int) 128,
941 &create_response, NULL, 945 MHD_OPTION_PER_IP_CONNECTION_LIMIT, (unsigned int) 1,
942 MHD_OPTION_CONNECTION_LIMIT, (unsigned int) 128, 946 MHD_OPTION_CONNECTION_TIMEOUT, (unsigned int) 16,
943 MHD_OPTION_PER_IP_CONNECTION_LIMIT, (unsigned int) 1, 947 MHD_OPTION_CONNECTION_MEMORY_LIMIT, (size_t) (4 * 1024),
944 MHD_OPTION_CONNECTION_TIMEOUT, (unsigned int) 16, 948 MHD_OPTION_NOTIFY_COMPLETED, &request_completed_callback, NULL,
945 MHD_OPTION_CONNECTION_MEMORY_LIMIT, (size_t) (4 * 1024), 949 MHD_OPTION_END);
946 MHD_OPTION_NOTIFY_COMPLETED, &request_completed_callback, NULL, 950 if (MHD_USE_DEBUG == options)
947 MHD_OPTION_END); 951 break;
952 options = MHD_USE_DEBUG;
953 }
954 while (NULL == httpd);
948 if (NULL == httpd) 955 if (NULL == httpd)
949 { 956 {
950 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, 957 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
diff --git a/src/namestore/gnunet-service-namestore.c b/src/namestore/gnunet-service-namestore.c
index a1ce120d8..b58f43613 100644
--- a/src/namestore/gnunet-service-namestore.c
+++ b/src/namestore/gnunet-service-namestore.c
@@ -752,7 +752,7 @@ handle_zone_to_name_it (void *cls,
752 "Found result for zone-to-name lookup: `%s'\n", 752 "Found result for zone-to-name lookup: `%s'\n",
753 name); 753 name);
754 res = GNUNET_YES; 754 res = GNUNET_YES;
755 name_len = strlen (name) + 1; 755 name_len = (NULL == name) ? 0 : strlen (name) + 1;
756 rd_ser_len = GNUNET_NAMESTORE_records_get_size (rd_count, rd); 756 rd_ser_len = GNUNET_NAMESTORE_records_get_size (rd_count, rd);
757 msg_size = sizeof (struct ZoneToNameResponseMessage) + name_len + rd_ser_len; 757 msg_size = sizeof (struct ZoneToNameResponseMessage) + name_len + rd_ser_len;
758 if (msg_size >= GNUNET_SERVER_MAX_MESSAGE_SIZE) 758 if (msg_size >= GNUNET_SERVER_MAX_MESSAGE_SIZE)
diff --git a/src/namestore/namestore_api_common.c b/src/namestore/namestore_api_common.c
index 3094d1aad..1956d420e 100644
--- a/src/namestore/namestore_api_common.c
+++ b/src/namestore/namestore_api_common.c
@@ -450,8 +450,8 @@ GNUNET_NAMESTORE_block_decrypt (const struct GNUNET_NAMESTORE_Block *block,
450 struct GNUNET_CRYPTO_AesInitializationVector iv; 450 struct GNUNET_CRYPTO_AesInitializationVector iv;
451 struct GNUNET_CRYPTO_AesSessionKey skey; 451 struct GNUNET_CRYPTO_AesSessionKey skey;
452 452
453 if (ntohl (block->purpose.size) < 453 if (ntohl (block->purpose.size) <
454 sizeof (struct GNUNET_CRYPTO_EccSignaturePurpose) - 454 sizeof (struct GNUNET_CRYPTO_EccSignaturePurpose) +
455 sizeof (struct GNUNET_TIME_AbsoluteNBO)) 455 sizeof (struct GNUNET_TIME_AbsoluteNBO))
456 { 456 {
457 GNUNET_break_op (0); 457 GNUNET_break_op (0);
@@ -979,6 +979,7 @@ GNUNET_NAMESTORE_pkey_to_zkey (const struct GNUNET_CRYPTO_EccPublicKey *pkey)
979 &pkeys[slen / 2], 979 &pkeys[slen / 2],
980 (int) (slen / 2), 980 (int) (slen / 2),
981 pkeys); 981 pkeys);
982 GNUNET_free (pkeys);
982 return ret; 983 return ret;
983} 984}
984 985