aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2020-07-18 00:44:39 +0200
committerChristian Grothoff <christian@grothoff.org>2020-07-18 00:44:39 +0200
commit7f4ddbcab8598e3d5e29c23ce883cdfa664408f1 (patch)
tree5f1b18463f641f24fad519e0aefb60b97d707b52
parent28ab2c446fba4980a8295d59fdf203a028a35dd6 (diff)
downloadgnunet-7f4ddbcab8598e3d5e29c23ce883cdfa664408f1.tar.gz
gnunet-7f4ddbcab8598e3d5e29c23ce883cdfa664408f1.zip
merge flags into enum for GNUNET_DISK_pipe() API, fixing #6188
-rw-r--r--src/abd/gnunet-abd.c31
-rw-r--r--src/abd/plugin_gnsrecord_abd.c3
-rw-r--r--src/arm/arm_api.c5
-rw-r--r--src/arm/gnunet-service-arm.c33
-rw-r--r--src/cadet/cadet.h4
-rw-r--r--src/cadet/cadet_api.c4
-rw-r--r--src/cadet/cadet_api_drop_message.c16
-rw-r--r--src/cadet/cadet_protocol.h4
-rw-r--r--src/cadet/gnunet-service-cadet.c100
-rw-r--r--src/cadet/gnunet-service-cadet.h1
-rw-r--r--src/cadet/gnunet-service-cadet_channel.c28
-rw-r--r--src/cadet/gnunet-service-cadet_connection.c3
-rw-r--r--src/cadet/gnunet-service-cadet_core.c6
-rw-r--r--src/cadet/gnunet-service-cadet_peer.c2
-rw-r--r--src/cadet/gnunet-service-cadet_tunnels.c2
-rw-r--r--src/cadet/gnunet-service-cadet_tunnels.h2
-rw-r--r--src/cadet/test_cadet.c11
-rw-r--r--src/conversation/test_conversation_api.c6
-rw-r--r--src/conversation/test_conversation_api_reject.c6
-rw-r--r--src/conversation/test_conversation_api_twocalls.c6
-rw-r--r--src/curl/curl.c8
-rw-r--r--src/fs/fs_namespace.c22
-rw-r--r--src/fs/gnunet-auto-share.c11
-rw-r--r--src/gns/gns_api.c1
-rw-r--r--src/gns/gnunet-dns2gns.c2
-rw-r--r--src/gns/nss/nss_gns.c2
-rw-r--r--src/gns/nss/nss_gns_query.c2
-rw-r--r--src/gnsrecord/gnsrecord.c8
-rw-r--r--src/hostlist/gnunet-daemon-hostlist_client.c20
-rw-r--r--src/identity/gnunet-identity.c6
-rw-r--r--src/identity/plugin_rest_identity.c3
-rw-r--r--src/include/gnunet_bio_lib.h35
-rw-r--r--src/include/gnunet_buffer_lib.h2
-rw-r--r--src/include/gnunet_common.h38
-rw-r--r--src/include/gnunet_configuration_lib.h2
-rw-r--r--src/include/gnunet_constants.h3
-rw-r--r--src/include/gnunet_container_lib.h52
-rw-r--r--src/include/gnunet_curl_lib.h2
-rw-r--r--src/include/gnunet_disk_lib.h46
-rw-r--r--src/include/gnunet_mq_lib.h6
-rw-r--r--src/include/gnunet_reclaim_lib.h2
-rw-r--r--src/include/gnunet_reclaim_plugin.h6
-rw-r--r--src/include/gnunet_reclaim_service.h6
-rw-r--r--src/include/platform.h4
-rw-r--r--src/json/json_generator.c4
-rw-r--r--src/json/json_gnsrecord.c4
-rw-r--r--src/namestore/gnunet-namestore.c3
-rw-r--r--src/namestore/gnunet-service-namestore.c2
-rw-r--r--src/namestore/plugin_rest_namestore.c54
-rw-r--r--src/nat/gnunet-service-nat_helper.c2
-rw-r--r--src/nat/gnunet-service-nat_mini.c2
-rw-r--r--src/reclaim/gnunet-service-reclaim_tickets.c2
-rw-r--r--src/reclaim/json_reclaim.h1
-rw-r--r--src/reclaim/plugin_reclaim_attribute_basic.c1
-rw-r--r--src/reclaim/plugin_rest_reclaim.c5
-rw-r--r--src/reclaim/reclaim_attestation.c2
-rw-r--r--src/reclaim/reclaim_attribute.c3
-rw-r--r--src/revocation/gnunet-revocation-tvg.c19
-rw-r--r--src/revocation/revocation_api.c8
-rw-r--r--src/rps/gnunet-rps-profiler.c6
-rw-r--r--src/rps/test_rps.c6
-rw-r--r--src/set/gnunet-service-set_intersection.c2
-rw-r--r--src/set/gnunet-service-set_union_strata_estimator.c4
-rw-r--r--src/statistics/gnunet-service-statistics.c3
-rw-r--r--src/testbed/generate-underlay-topology.c12
-rw-r--r--src/testbed/gnunet-daemon-latency-logger.c4
-rw-r--r--src/testbed/gnunet-daemon-testbed-underlay.c4
-rw-r--r--src/testbed/gnunet-helper-testbed.c2
-rw-r--r--src/testbed/gnunet-service-testbed.h2
-rw-r--r--src/testbed/gnunet_testbed_mpi_spawn.c3
-rw-r--r--src/testbed/test_testbed_api.c2
-rw-r--r--src/testbed/test_testbed_api_2peers_1controller.c2
-rw-r--r--src/testbed/test_testbed_api_controllerlink.c2
-rw-r--r--src/testbed/test_testbed_api_peer_reconfiguration.c2
-rw-r--r--src/testbed/test_testbed_api_peers_manage_services.c2
-rw-r--r--src/testbed/test_testbed_api_statistics.c2
-rw-r--r--src/testbed/test_testbed_api_test.c4
-rw-r--r--src/testbed/testbed_api_hosts.c2
-rw-r--r--src/transport/gnunet-communicator-tcp.c19
-rw-r--r--src/transport/gnunet-communicator-udp.c3
-rw-r--r--src/transport/gnunet-communicator-unix.c5
-rw-r--r--src/transport/plugin_transport_smtp.c6
-rw-r--r--src/transport/test_communicator_basic.c54
-rw-r--r--src/transport/transport-testing2.c28
-rw-r--r--src/transport/transport.h1
-rw-r--r--src/transport/transport_api2_communication.c3
-rw-r--r--src/util/bio.c41
-rw-r--r--src/util/configuration.c7
-rw-r--r--src/util/crypto_ecc.c10
-rw-r--r--src/util/crypto_hash.c4
-rw-r--r--src/util/crypto_mpi.c4
-rw-r--r--src/util/disk.c44
-rw-r--r--src/util/gnunet-qr.c7
-rw-r--r--src/util/gnunet-uri.c2
-rw-r--r--src/util/helper.c7
-rw-r--r--src/util/os_priority.c4
-rw-r--r--src/util/perf_malloc.c4
-rw-r--r--src/util/perf_scheduler.c4
-rw-r--r--src/util/scheduler.c5
-rw-r--r--src/util/service.c4
-rw-r--r--src/util/strings.c2
-rw-r--r--src/util/test_bio.c14
-rw-r--r--src/util/test_common_logging_runtime_loglevels.c5
-rw-r--r--src/util/test_container_multihashmap.c2
-rw-r--r--src/util/test_container_multipeermap.c2
-rw-r--r--src/util/test_scheduler.c2
106 files changed, 556 insertions, 477 deletions
diff --git a/src/abd/gnunet-abd.c b/src/abd/gnunet-abd.c
index 963d9207a..ff7dd09c5 100644
--- a/src/abd/gnunet-abd.c
+++ b/src/abd/gnunet-abd.c
@@ -513,8 +513,8 @@ get_existing_record (void *cls,
513 const struct GNUNET_GNSRECORD_Data *rd) 513 const struct GNUNET_GNSRECORD_Data *rd)
514{ 514{
515 struct GNUNET_GNSRECORD_Data *rde; 515 struct GNUNET_GNSRECORD_Data *rde;
516 struct GNUNET_GNSRECORD_Data* rdn = 516 struct GNUNET_GNSRECORD_Data*rdn =
517 GNUNET_malloc(sizeof(*rdn)*(rd_count + 1)); 517 GNUNET_malloc (sizeof(*rdn) * (rd_count + 1));
518 518
519 memset (rdn, 0, sizeof (struct GNUNET_GNSRECORD_Data)); 519 memset (rdn, 0, sizeof (struct GNUNET_GNSRECORD_Data));
520 GNUNET_memcpy (&rdn[1], rd, 520 GNUNET_memcpy (&rdn[1], rd,
@@ -541,7 +541,7 @@ get_existing_record (void *cls,
541 rde, 541 rde,
542 &add_continuation, 542 &add_continuation,
543 &add_qe); 543 &add_qe);
544 GNUNET_free(rdn); 544 GNUNET_free (rdn);
545 return; 545 return;
546} 546}
547 547
@@ -604,13 +604,18 @@ store_cb (void *cls, struct GNUNET_IDENTITY_Ego *ego)
604 if (GNUNET_OK != 604 if (GNUNET_OK !=
605 GNUNET_GNSRECORD_string_to_value (type, subject, &data, &data_size)) 605 GNUNET_GNSRECORD_string_to_value (type, subject, &data, &data_size))
606 { 606 {
607 if(typestring == NULL) { 607 if (typestring == NULL)
608 fputs("No value for unknown record type\n", stderr); 608 {
609 } else if(subject == NULL) { 609 fputs ("No value for unknown record type\n", stderr);
610 fprintf(stderr, 610 }
611 "No value for record type`%s'\n", 611 else if (subject == NULL)
612 typestring); 612 {
613 } else { 613 fprintf (stderr,
614 "No value for record type`%s'\n",
615 typestring);
616 }
617 else
618 {
614 fprintf (stderr, 619 fprintf (stderr,
615 "Value `%s' invalid for record type `%s'\n", 620 "Value `%s' invalid for record type `%s'\n",
616 subject, 621 subject,
@@ -927,8 +932,8 @@ run (void *cls,
927 int i; 932 int i;
928 while (NULL != (tok = strtok (NULL, ","))) 933 while (NULL != (tok = strtok (NULL, ",")))
929 count++; 934 count++;
930 struct GNUNET_ABD_Delegate* delegates = 935 struct GNUNET_ABD_Delegate*delegates =
931 GNUNET_malloc(sizeof(*delegates)*count); 936 GNUNET_malloc (sizeof(*delegates) * count);
932 struct GNUNET_ABD_Delegate *dele; 937 struct GNUNET_ABD_Delegate *dele;
933 GNUNET_free (tmp); 938 GNUNET_free (tmp);
934 tmp = GNUNET_strdup (subject_delegate); 939 tmp = GNUNET_strdup (subject_delegate);
@@ -961,7 +966,7 @@ run (void *cls,
961 delegates[i].issuer_attribute = NULL; 966 delegates[i].issuer_attribute = NULL;
962 } 967 }
963 GNUNET_free (tmp); 968 GNUNET_free (tmp);
964 GNUNET_free(delegates); 969 GNUNET_free (delegates);
965 } 970 }
966 else 971 else
967 { 972 {
diff --git a/src/abd/plugin_gnsrecord_abd.c b/src/abd/plugin_gnsrecord_abd.c
index 850fa9a45..272872e24 100644
--- a/src/abd/plugin_gnsrecord_abd.c
+++ b/src/abd/plugin_gnsrecord_abd.c
@@ -235,7 +235,8 @@ abd_string_to_value (void *cls,
235 (char *) &sets[1]); 235 (char *) &sets[1]);
236 for (i = 0; i < entries; i++) 236 for (i = 0; i < entries; i++)
237 { 237 {
238 if (0 != set[i].subject_attribute_len) { 238 if (0 != set[i].subject_attribute_len)
239 {
239 GNUNET_free_nz ((char *) set[i].subject_attribute); 240 GNUNET_free_nz ((char *) set[i].subject_attribute);
240 set[i].subject_attribute = NULL; 241 set[i].subject_attribute = NULL;
241 } 242 }
diff --git a/src/arm/arm_api.c b/src/arm/arm_api.c
index dea7a70be..899b6f152 100644
--- a/src/arm/arm_api.c
+++ b/src/arm/arm_api.c
@@ -972,10 +972,7 @@ GNUNET_ARM_request_service_start (struct GNUNET_ARM_Handle *h,
972 the above check should catch 99.99% of the cases where ARM 972 the above check should catch 99.99% of the cases where ARM
973 is already running. */LOG (GNUNET_ERROR_TYPE_DEBUG, 973 is already running. */LOG (GNUNET_ERROR_TYPE_DEBUG,
974 "Starting ARM service\n"); 974 "Starting ARM service\n");
975 if (NULL == (sig = GNUNET_DISK_pipe (GNUNET_NO, 975 if (NULL == (sig = GNUNET_DISK_pipe (GNUNET_DISK_PF_NONE)))
976 GNUNET_NO,
977 GNUNET_NO,
978 GNUNET_YES)))
979 { 976 {
980 GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, 977 GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING,
981 "pipe"); 978 "pipe");
diff --git a/src/arm/gnunet-service-arm.c b/src/arm/gnunet-service-arm.c
index 00b6e7196..263c99cc4 100644
--- a/src/arm/gnunet-service-arm.c
+++ b/src/arm/gnunet-service-arm.c
@@ -859,7 +859,8 @@ start_process (struct ServiceList *sl,
859 if (NULL != options) 859 if (NULL != options)
860 options = GNUNET_CONFIGURATION_expand_dollar (cfg, options); 860 options = GNUNET_CONFIGURATION_expand_dollar (cfg, options);
861 sl->proc = GNUNET_OS_start_process_s (sl->pipe_control 861 sl->proc = GNUNET_OS_start_process_s (sl->pipe_control
862 ? GNUNET_OS_INHERIT_STD_OUT_AND_ERR | GNUNET_OS_USE_PIPE_CONTROL 862 ? GNUNET_OS_INHERIT_STD_OUT_AND_ERR
863 | GNUNET_OS_USE_PIPE_CONTROL
863 : GNUNET_OS_INHERIT_STD_OUT_AND_ERR, 864 : GNUNET_OS_INHERIT_STD_OUT_AND_ERR,
864 lsocks, 865 lsocks,
865 loprefix, 866 loprefix,
@@ -882,8 +883,11 @@ start_process (struct ServiceList *sl,
882 { 883 {
883 if (NULL == sl->config) 884 if (NULL == sl->config)
884 sl->proc = GNUNET_OS_start_process_s (sl->pipe_control 885 sl->proc = GNUNET_OS_start_process_s (sl->pipe_control
885 ? GNUNET_OS_INHERIT_STD_OUT_AND_ERR | GNUNET_OS_USE_PIPE_CONTROL 886 ?
886 : GNUNET_OS_INHERIT_STD_OUT_AND_ERR, 887 GNUNET_OS_INHERIT_STD_OUT_AND_ERR
888 | GNUNET_OS_USE_PIPE_CONTROL
889 :
890 GNUNET_OS_INHERIT_STD_OUT_AND_ERR,
887 lsocks, 891 lsocks,
888 loprefix, 892 loprefix,
889 quotedbinary, 893 quotedbinary,
@@ -893,8 +897,11 @@ start_process (struct ServiceList *sl,
893 NULL); 897 NULL);
894 else 898 else
895 sl->proc = GNUNET_OS_start_process_s (sl->pipe_control 899 sl->proc = GNUNET_OS_start_process_s (sl->pipe_control
896 ? GNUNET_OS_INHERIT_STD_OUT_AND_ERR | GNUNET_OS_USE_PIPE_CONTROL 900 ?
897 : GNUNET_OS_INHERIT_STD_OUT_AND_ERR, 901 GNUNET_OS_INHERIT_STD_OUT_AND_ERR
902 | GNUNET_OS_USE_PIPE_CONTROL
903 :
904 GNUNET_OS_INHERIT_STD_OUT_AND_ERR,
898 lsocks, 905 lsocks,
899 loprefix, 906 loprefix,
900 quotedbinary, 907 quotedbinary,
@@ -909,8 +916,11 @@ start_process (struct ServiceList *sl,
909 { 916 {
910 if (NULL == sl->config) 917 if (NULL == sl->config)
911 sl->proc = GNUNET_OS_start_process_s (sl->pipe_control 918 sl->proc = GNUNET_OS_start_process_s (sl->pipe_control
912 ? GNUNET_OS_INHERIT_STD_OUT_AND_ERR | GNUNET_OS_USE_PIPE_CONTROL 919 ?
913 : GNUNET_OS_INHERIT_STD_OUT_AND_ERR, 920 GNUNET_OS_INHERIT_STD_OUT_AND_ERR
921 | GNUNET_OS_USE_PIPE_CONTROL
922 :
923 GNUNET_OS_INHERIT_STD_OUT_AND_ERR,
914 lsocks, 924 lsocks,
915 loprefix, 925 loprefix,
916 quotedbinary, 926 quotedbinary,
@@ -918,8 +928,11 @@ start_process (struct ServiceList *sl,
918 NULL); 928 NULL);
919 else 929 else
920 sl->proc = GNUNET_OS_start_process_s (sl->pipe_control 930 sl->proc = GNUNET_OS_start_process_s (sl->pipe_control
921 ? GNUNET_OS_INHERIT_STD_OUT_AND_ERR | GNUNET_OS_USE_PIPE_CONTROL 931 ?
922 : GNUNET_OS_INHERIT_STD_OUT_AND_ERR, 932 GNUNET_OS_INHERIT_STD_OUT_AND_ERR
933 | GNUNET_OS_USE_PIPE_CONTROL
934 :
935 GNUNET_OS_INHERIT_STD_OUT_AND_ERR,
923 lsocks, 936 lsocks,
924 loprefix, 937 loprefix,
925 quotedbinary, 938 quotedbinary,
@@ -2157,7 +2170,7 @@ main (int argc, char *const *argv)
2157 GNUNET_MQ_handler_end () 2170 GNUNET_MQ_handler_end ()
2158 }; 2171 };
2159 2172
2160 sigpipe = GNUNET_DISK_pipe (GNUNET_NO, GNUNET_NO, GNUNET_NO, GNUNET_NO); 2173 sigpipe = GNUNET_DISK_pipe (GNUNET_DISK_PF_NONE);
2161 GNUNET_assert (NULL != sigpipe); 2174 GNUNET_assert (NULL != sigpipe);
2162 shc_chld = 2175 shc_chld =
2163 GNUNET_SIGNAL_handler_install (GNUNET_SIGCHLD, 2176 GNUNET_SIGNAL_handler_install (GNUNET_SIGCHLD,
diff --git a/src/cadet/cadet.h b/src/cadet/cadet.h
index d17eab1d6..31dad4117 100644
--- a/src/cadet/cadet.h
+++ b/src/cadet/cadet.h
@@ -325,7 +325,7 @@ struct GNUNET_CADET_RequestDropCadetMessage
325 * Type: #GNUNET_MESSAGE_TYPE_CADET_DROP_CADET_MESSAGE 325 * Type: #GNUNET_MESSAGE_TYPE_CADET_DROP_CADET_MESSAGE
326 */ 326 */
327 struct GNUNET_MessageHeader header; 327 struct GNUNET_MessageHeader header;
328 328
329 /** 329 /**
330 * Type of the message this handler covers, in host byte order. 330 * Type of the message this handler covers, in host byte order.
331 */ 331 */
@@ -337,7 +337,7 @@ struct GNUNET_CADET_RequestDropCadetMessage
337 struct GNUNET_CADET_ClientChannelNumber ccn; 337 struct GNUNET_CADET_ClientChannelNumber ccn;
338 338
339}; 339};
340 340
341/** 341/**
342 * Message to inform the client about channels in the service. 342 * Message to inform the client about channels in the service.
343 */ 343 */
diff --git a/src/cadet/cadet_api.c b/src/cadet/cadet_api.c
index 67f6571c5..45cc508a6 100644
--- a/src/cadet/cadet_api.c
+++ b/src/cadet/cadet_api.c
@@ -1001,8 +1001,8 @@ GNUNET_CADET_open_port (struct GNUNET_CADET_Handle *h,
1001 p->window_changes = window_changes; 1001 p->window_changes = window_changes;
1002 p->disconnects = disconnects; 1002 p->disconnects = disconnects;
1003 p->handlers = (NULL == pd->agpl_url) 1003 p->handlers = (NULL == pd->agpl_url)
1004 ? GNUNET_MQ_copy_handlers (handlers) 1004 ? GNUNET_MQ_copy_handlers (handlers)
1005 : GNUNET_MQ_copy_handlers2 (handlers, &return_agpl, NULL); 1005 : GNUNET_MQ_copy_handlers2 (handlers, &return_agpl, NULL);
1006 1006
1007 GNUNET_assert (GNUNET_OK == open_port_cb (h, &p->id, p)); 1007 GNUNET_assert (GNUNET_OK == open_port_cb (h, &p->id, p));
1008 return p; 1008 return p;
diff --git a/src/cadet/cadet_api_drop_message.c b/src/cadet/cadet_api_drop_message.c
index d9f7e003e..2b031b5c0 100644
--- a/src/cadet/cadet_api_drop_message.c
+++ b/src/cadet/cadet_api_drop_message.c
@@ -11,7 +11,7 @@
11 WITHOUT ANY WARRANTY; without even the implied warranty of 11 WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Affero General Public License for more details. 13 Affero General Public License for more details.
14 14
15 You should have received a copy of the GNU Affero General Public License 15 You should have received a copy of the GNU Affero General Public License
16 along with this program. If not, see <http://www.gnu.org/licenses/>. 16 along with this program. If not, see <http://www.gnu.org/licenses/>.
17 17
@@ -35,8 +35,8 @@
35 */ 35 */
36void 36void
37GNUNET_CADET_drop_message (struct GNUNET_MQ_Handle *mq, 37GNUNET_CADET_drop_message (struct GNUNET_MQ_Handle *mq,
38 struct GNUNET_CADET_ClientChannelNumber ccn, 38 struct GNUNET_CADET_ClientChannelNumber ccn,
39 uint16_t type) 39 uint16_t type)
40{ 40{
41 struct GNUNET_CADET_RequestDropCadetMessage *message; 41 struct GNUNET_CADET_RequestDropCadetMessage *message;
42 struct GNUNET_MQ_Envelope *env; 42 struct GNUNET_MQ_Envelope *env;
@@ -45,15 +45,15 @@ GNUNET_CADET_drop_message (struct GNUNET_MQ_Handle *mq,
45 45
46 message->ccn = ccn; 46 message->ccn = ccn;
47 message->type = type; 47 message->type = type;
48 48
49 GNUNET_log (GNUNET_ERROR_TYPE_INFO, 49 GNUNET_log (GNUNET_ERROR_TYPE_INFO,
50 "Dropping message for channel of type %s (%d)\n", type == GNUNET_MESSAGE_TYPE_CADET_CHANNEL_DESTROY ? "GNUNET_MESSAGE_TYPE_CADET_CHANNEL_DESTROY" : "UNKNOWN", type); 50 "Dropping message for channel of type %s (%d)\n", type ==
51 GNUNET_MESSAGE_TYPE_CADET_CHANNEL_DESTROY ?
52 "GNUNET_MESSAGE_TYPE_CADET_CHANNEL_DESTROY" : "UNKNOWN", type);
51 53
52 GNUNET_MQ_send (mq, env); 54 GNUNET_MQ_send (mq, env);
53
54}
55
56 55
56}
57 57
58 58
59/* end of cadet_api_drop_message.c */ 59/* end of cadet_api_drop_message.c */
diff --git a/src/cadet/cadet_protocol.h b/src/cadet/cadet_protocol.h
index 08298e224..117a7922e 100644
--- a/src/cadet/cadet_protocol.h
+++ b/src/cadet/cadet_protocol.h
@@ -85,11 +85,11 @@ struct GNUNET_CADET_ConnectionCreateMessage
85 uint32_t options GNUNET_PACKED; 85 uint32_t options GNUNET_PACKED;
86 86
87 /** 87 /**
88 * This flag indicates the peer sending the connection create 88 * This flag indicates the peer sending the connection create
89 * meassage likes to trigger a KX handshake. 89 * meassage likes to trigger a KX handshake.
90 */ 90 */
91 int has_monotime; 91 int has_monotime;
92 92
93 /** 93 /**
94 * This monotonic time is set, if a peer likes to trigger a KX, but is not 94 * This monotonic time is set, if a peer likes to trigger a KX, but is not
95 * the peer that should start the KX. (xrs,t3ss) 95 * the peer that should start the KX. (xrs,t3ss)
diff --git a/src/cadet/gnunet-service-cadet.c b/src/cadet/gnunet-service-cadet.c
index f3767fb01..2d3b548dd 100644
--- a/src/cadet/gnunet-service-cadet.c
+++ b/src/cadet/gnunet-service-cadet.c
@@ -1010,6 +1010,7 @@ handle_info_tunnels (void *cls,
1010 GNUNET_SERVICE_client_continue (c->client); 1010 GNUNET_SERVICE_client_continue (c->client);
1011} 1011}
1012 1012
1013
1013/** 1014/**
1014 * Handler for client's #GNUNET_MESSAGE_TYPE_CADET_DROP_CADET_MESSAGE request. 1015 * Handler for client's #GNUNET_MESSAGE_TYPE_CADET_DROP_CADET_MESSAGE request.
1015 * 1016 *
@@ -1026,11 +1027,12 @@ handle_drop_message (void *cls,
1026 ch = lookup_channel (c, 1027 ch = lookup_channel (c,
1027 message->ccn); 1028 message->ccn);
1028 1029
1029 GCCH_assign_type_to_drop(ch, message); 1030 GCCH_assign_type_to_drop (ch, message);
1030 1031
1031 GNUNET_SERVICE_client_continue (c->client); 1032 GNUNET_SERVICE_client_continue (c->client);
1032} 1033}
1033 1034
1035
1034/** 1036/**
1035 * Callback called when a client connects to the service. 1037 * Callback called when a client connects to the service.
1036 * 1038 *
@@ -1327,52 +1329,52 @@ run (void *cls,
1327 * Define "main" method using service macro. 1329 * Define "main" method using service macro.
1328 */ 1330 */
1329GNUNET_SERVICE_MAIN 1331GNUNET_SERVICE_MAIN
1330("cadet", 1332 ("cadet",
1331 GNUNET_SERVICE_OPTION_NONE, 1333 GNUNET_SERVICE_OPTION_NONE,
1332 &run, 1334 &run,
1333 &client_connect_cb, 1335 &client_connect_cb,
1334 &client_disconnect_cb, 1336 &client_disconnect_cb,
1335 NULL, 1337 NULL,
1336 GNUNET_MQ_hd_fixed_size (port_open, 1338 GNUNET_MQ_hd_fixed_size (port_open,
1337 GNUNET_MESSAGE_TYPE_CADET_LOCAL_PORT_OPEN, 1339 GNUNET_MESSAGE_TYPE_CADET_LOCAL_PORT_OPEN,
1338 struct GNUNET_CADET_PortMessage, 1340 struct GNUNET_CADET_PortMessage,
1339 NULL), 1341 NULL),
1340 GNUNET_MQ_hd_fixed_size (port_close, 1342 GNUNET_MQ_hd_fixed_size (port_close,
1341 GNUNET_MESSAGE_TYPE_CADET_LOCAL_PORT_CLOSE, 1343 GNUNET_MESSAGE_TYPE_CADET_LOCAL_PORT_CLOSE,
1342 struct GNUNET_CADET_PortMessage, 1344 struct GNUNET_CADET_PortMessage,
1343 NULL), 1345 NULL),
1344 GNUNET_MQ_hd_fixed_size (channel_create, 1346 GNUNET_MQ_hd_fixed_size (channel_create,
1345 GNUNET_MESSAGE_TYPE_CADET_LOCAL_CHANNEL_CREATE, 1347 GNUNET_MESSAGE_TYPE_CADET_LOCAL_CHANNEL_CREATE,
1346 struct GNUNET_CADET_LocalChannelCreateMessage, 1348 struct GNUNET_CADET_LocalChannelCreateMessage,
1347 NULL), 1349 NULL),
1348 GNUNET_MQ_hd_fixed_size (channel_destroy, 1350 GNUNET_MQ_hd_fixed_size (channel_destroy,
1349 GNUNET_MESSAGE_TYPE_CADET_LOCAL_CHANNEL_DESTROY, 1351 GNUNET_MESSAGE_TYPE_CADET_LOCAL_CHANNEL_DESTROY,
1350 struct GNUNET_CADET_LocalChannelDestroyMessage, 1352 struct GNUNET_CADET_LocalChannelDestroyMessage,
1351 NULL), 1353 NULL),
1352 GNUNET_MQ_hd_var_size (local_data, 1354 GNUNET_MQ_hd_var_size (local_data,
1353 GNUNET_MESSAGE_TYPE_CADET_LOCAL_DATA, 1355 GNUNET_MESSAGE_TYPE_CADET_LOCAL_DATA,
1354 struct GNUNET_CADET_LocalData, 1356 struct GNUNET_CADET_LocalData,
1355 NULL), 1357 NULL),
1356 GNUNET_MQ_hd_fixed_size (local_ack, 1358 GNUNET_MQ_hd_fixed_size (local_ack,
1357 GNUNET_MESSAGE_TYPE_CADET_LOCAL_ACK, 1359 GNUNET_MESSAGE_TYPE_CADET_LOCAL_ACK,
1358 struct GNUNET_CADET_LocalAck, 1360 struct GNUNET_CADET_LocalAck,
1359 NULL), 1361 NULL),
1360 GNUNET_MQ_hd_fixed_size (get_peers, 1362 GNUNET_MQ_hd_fixed_size (get_peers,
1361 GNUNET_MESSAGE_TYPE_CADET_LOCAL_REQUEST_INFO_PEERS, 1363 GNUNET_MESSAGE_TYPE_CADET_LOCAL_REQUEST_INFO_PEERS,
1362 struct GNUNET_MessageHeader, 1364 struct GNUNET_MessageHeader,
1363 NULL), 1365 NULL),
1364 GNUNET_MQ_hd_fixed_size (show_path, 1366 GNUNET_MQ_hd_fixed_size (show_path,
1365 GNUNET_MESSAGE_TYPE_CADET_LOCAL_REQUEST_INFO_PATH, 1367 GNUNET_MESSAGE_TYPE_CADET_LOCAL_REQUEST_INFO_PATH,
1366 struct GNUNET_CADET_RequestPathInfoMessage, 1368 struct GNUNET_CADET_RequestPathInfoMessage,
1367 NULL), 1369 NULL),
1368 GNUNET_MQ_hd_fixed_size (info_tunnels, 1370 GNUNET_MQ_hd_fixed_size (info_tunnels,
1369 GNUNET_MESSAGE_TYPE_CADET_LOCAL_REQUEST_INFO_TUNNELS, 1371 GNUNET_MESSAGE_TYPE_CADET_LOCAL_REQUEST_INFO_TUNNELS,
1370 struct GNUNET_MessageHeader, 1372 struct GNUNET_MessageHeader,
1371 NULL), 1373 NULL),
1372 GNUNET_MQ_hd_fixed_size (drop_message, 1374 GNUNET_MQ_hd_fixed_size (drop_message,
1373 GNUNET_MESSAGE_TYPE_CADET_DROP_CADET_MESSAGE, 1375 GNUNET_MESSAGE_TYPE_CADET_DROP_CADET_MESSAGE,
1374 struct GNUNET_CADET_RequestDropCadetMessage, 1376 struct GNUNET_CADET_RequestDropCadetMessage,
1375 NULL), 1377 NULL),
1376 GNUNET_MQ_handler_end ()); 1378 GNUNET_MQ_handler_end ());
1377 1379
1378/* end of gnunet-service-cadet-new.c */ 1380/* end of gnunet-service-cadet-new.c */
diff --git a/src/cadet/gnunet-service-cadet.h b/src/cadet/gnunet-service-cadet.h
index ff216f8c3..6da0950f1 100644
--- a/src/cadet/gnunet-service-cadet.h
+++ b/src/cadet/gnunet-service-cadet.h
@@ -325,5 +325,4 @@ const char *
325GSC_2s (struct CadetClient *c); 325GSC_2s (struct CadetClient *c);
326 326
327 327
328
329#endif 328#endif
diff --git a/src/cadet/gnunet-service-cadet_channel.c b/src/cadet/gnunet-service-cadet_channel.c
index e6fce562f..dab53b8c4 100644
--- a/src/cadet/gnunet-service-cadet_channel.c
+++ b/src/cadet/gnunet-service-cadet_channel.c
@@ -385,29 +385,32 @@ struct CadetChannel
385 * Type of message to be droped. See GCT_send. 385 * Type of message to be droped. See GCT_send.
386 */ 386 */
387 uint16_t type GNUNET_PACKED; 387 uint16_t type GNUNET_PACKED;
388 388
389}; 389};
390 390
391/** 391/**
392 * Assign type of message to drop. 392 * Assign type of message to drop.
393 * @param ch CadetChannel to assign type to drop. 393 * @param ch CadetChannel to assign type to drop.
394 * @param message GNUNET_CADET_RequestDropCadetMessage to get the type from. 394 * @param message GNUNET_CADET_RequestDropCadetMessage to get the type from.
395 */ 395 */
396void 396void
397GCCH_assign_type_to_drop(struct CadetChannel *ch, const struct GNUNET_CADET_RequestDropCadetMessage *message) 397GCCH_assign_type_to_drop (struct CadetChannel *ch, const struct
398 GNUNET_CADET_RequestDropCadetMessage *message)
398{ 399{
399 400
400 ch->type = message->type; 401 ch->type = message->type;
401 402
402} 403}
403 404
405
404/** 406/**
405 * Check if type of message is the one to drop. 407 * Check if type of message is the one to drop.
406 * @param ch CadetChannel to check for message type to drop. 408 * @param ch CadetChannel to check for message type to drop.
407 * @param message GNUNET_MessageHeader to compare the type with. 409 * @param message GNUNET_MessageHeader to compare the type with.
408 */ 410 */
409int 411int
410GCCH_is_type_to_drop(struct CadetChannel *ch, const struct GNUNET_MessageHeader *message) 412GCCH_is_type_to_drop (struct CadetChannel *ch, const struct
413 GNUNET_MessageHeader *message)
411{ 414{
412 415
413 if (ch->type == message->type) 416 if (ch->type == message->type)
@@ -419,6 +422,7 @@ GCCH_is_type_to_drop(struct CadetChannel *ch, const struct GNUNET_MessageHeader
419 return GNUNET_NO; 422 return GNUNET_NO;
420} 423}
421 424
425
422/** 426/**
423 * Get the static string for identification of the channel. 427 * Get the static string for identification of the channel.
424 * 428 *
@@ -854,7 +858,8 @@ send_channel_data_ack (struct CadetChannel *ch)
854 GCCH_2s (ch)); 858 GCCH_2s (ch));
855 if (NULL != ch->last_control_qe) 859 if (NULL != ch->last_control_qe)
856 GCT_send_cancel (ch->last_control_qe); 860 GCT_send_cancel (ch->last_control_qe);
857 ch->last_control_qe = GCT_send (ch->t, &msg.header, &send_ack_cb, ch, &msg.ctn); 861 ch->last_control_qe = GCT_send (ch->t, &msg.header, &send_ack_cb, ch,
862 &msg.ctn);
858} 863}
859 864
860 865
@@ -881,7 +886,8 @@ send_open_ack (void *cls)
881 msg.port = ch->port; 886 msg.port = ch->port;
882 if (NULL != ch->last_control_qe) 887 if (NULL != ch->last_control_qe)
883 GCT_send_cancel (ch->last_control_qe); 888 GCT_send_cancel (ch->last_control_qe);
884 ch->last_control_qe = GCT_send (ch->t, &msg.header, &send_ack_cb, ch, &msg.ctn); 889 ch->last_control_qe = GCT_send (ch->t, &msg.header, &send_ack_cb, ch,
890 &msg.ctn);
885} 891}
886 892
887 893
@@ -1513,7 +1519,8 @@ retry_transmission (void *cls)
1513 "Retrying transmission on %s of message %u\n", 1519 "Retrying transmission on %s of message %u\n",
1514 GCCH_2s (ch), 1520 GCCH_2s (ch),
1515 (unsigned int) ntohl (crm->data_message->mid.mid)); 1521 (unsigned int) ntohl (crm->data_message->mid.mid));
1516 crm->qe = GCT_send (ch->t, &crm->data_message->header, &data_sent_cb, crm, &crm->data_message->ctn); 1522 crm->qe = GCT_send (ch->t, &crm->data_message->header, &data_sent_cb, crm,
1523 &crm->data_message->ctn);
1517 GNUNET_assert (NULL == ch->retry_data_task); 1524 GNUNET_assert (NULL == ch->retry_data_task);
1518} 1525}
1519 1526
@@ -1901,7 +1908,8 @@ GCCH_handle_local_data (struct CadetChannel *ch,
1901 GNUNET_SCHEDULER_cancel (ch->retry_data_task); 1908 GNUNET_SCHEDULER_cancel (ch->retry_data_task);
1902 ch->retry_data_task = NULL; 1909 ch->retry_data_task = NULL;
1903 } 1910 }
1904 crm->qe = GCT_send (ch->t, &crm->data_message->header, &data_sent_cb, crm, &crm->data_message->ctn); 1911 crm->qe = GCT_send (ch->t, &crm->data_message->header, &data_sent_cb, crm,
1912 &crm->data_message->ctn);
1905 GNUNET_assert (NULL == ch->retry_data_task); 1913 GNUNET_assert (NULL == ch->retry_data_task);
1906 return GNUNET_OK; 1914 return GNUNET_OK;
1907} 1915}
diff --git a/src/cadet/gnunet-service-cadet_connection.c b/src/cadet/gnunet-service-cadet_connection.c
index a7c1d9fb0..3e1f779ad 100644
--- a/src/cadet/gnunet-service-cadet_connection.c
+++ b/src/cadet/gnunet-service-cadet_connection.c
@@ -614,6 +614,7 @@ set_monotime_sig (struct GNUNET_CADET_ConnectionCreateMessage *msg)
614 614
615} 615}
616 616
617
617/** 618/**
618 * Send a #GNUNET_MESSAGE_TYPE_CADET_CONNECTION_CREATE message to the 619 * Send a #GNUNET_MESSAGE_TYPE_CADET_CONNECTION_CREATE message to the
619 * first hop. 620 * first hop.
@@ -641,7 +642,7 @@ send_create (void *cls)
641 642
642 // check for tunnel state and set signed monotime (xrs,t3ss) 643 // check for tunnel state and set signed monotime (xrs,t3ss)
643 t = GCP_get_tunnel (cc->destination, GNUNET_YES); 644 t = GCP_get_tunnel (cc->destination, GNUNET_YES);
644 if ((NULL != t)&& (GCT_get_estate (t) == CADET_TUNNEL_KEY_UNINITIALIZED) && 645 if ((NULL != t) && (GCT_get_estate (t) == CADET_TUNNEL_KEY_UNINITIALIZED) &&
645 (GCT_alice_or_betty (GCP_get_id (cc->destination)) == GNUNET_NO)) 646 (GCT_alice_or_betty (GCP_get_id (cc->destination)) == GNUNET_NO))
646 { 647 {
647 create_msg->has_monotime = GNUNET_YES; 648 create_msg->has_monotime = GNUNET_YES;
diff --git a/src/cadet/gnunet-service-cadet_core.c b/src/cadet/gnunet-service-cadet_core.c
index db47c8a90..9a83fa31d 100644
--- a/src/cadet/gnunet-service-cadet_core.c
+++ b/src/cadet/gnunet-service-cadet_core.c
@@ -826,9 +826,9 @@ handle_connection_create (
826 826
827 // Check for CADET state in case the other side has lost the tunnel (xrs,t3ss) 827 // Check for CADET state in case the other side has lost the tunnel (xrs,t3ss)
828 if ((GNUNET_YES == msg->has_monotime) && 828 if ((GNUNET_YES == msg->has_monotime) &&
829 (GNUNET_YES == GCP_check_and_update_monotime(origin, msg->monotime)) && 829 (GNUNET_YES == GCP_check_and_update_monotime (origin, msg->monotime)) &&
830 ( GNUNET_OK == GCP_check_monotime_sig(origin, msg)) && 830 (GNUNET_OK == GCP_check_monotime_sig (origin, msg)) &&
831 (CADET_TUNNEL_KEY_OK == GCT_get_estate(t))) 831 (CADET_TUNNEL_KEY_OK == GCT_get_estate (t)))
832 { 832 {
833 GCT_change_estate (t, CADET_TUNNEL_KEY_UNINITIALIZED); 833 GCT_change_estate (t, CADET_TUNNEL_KEY_UNINITIALIZED);
834 } 834 }
diff --git a/src/cadet/gnunet-service-cadet_peer.c b/src/cadet/gnunet-service-cadet_peer.c
index e5885278b..a2068b31b 100644
--- a/src/cadet/gnunet-service-cadet_peer.c
+++ b/src/cadet/gnunet-service-cadet_peer.c
@@ -1552,6 +1552,7 @@ GCP_send_ooo (struct CadetPeer *cp,
1552 env); 1552 env);
1553} 1553}
1554 1554
1555
1555/** 1556/**
1556 * Checking if a monotime value is newer than the last monotime value received from a peer. If the time value is newer it will be stored at the peer. 1557 * Checking if a monotime value is newer than the last monotime value received from a peer. If the time value is newer it will be stored at the peer.
1557 * 1558 *
@@ -1574,6 +1575,7 @@ GCP_check_and_update_monotime (struct CadetPeer *peer,
1574 return GNUNET_NO; 1575 return GNUNET_NO;
1575} 1576}
1576 1577
1578
1577/** 1579/**
1578 * Checking the signature for a monotime of a GNUNET_CADET_ConnectionCreateMessage. 1580 * Checking the signature for a monotime of a GNUNET_CADET_ConnectionCreateMessage.
1579 * 1581 *
diff --git a/src/cadet/gnunet-service-cadet_tunnels.c b/src/cadet/gnunet-service-cadet_tunnels.c
index 66e7d5b1e..2ca46b5aa 100644
--- a/src/cadet/gnunet-service-cadet_tunnels.c
+++ b/src/cadet/gnunet-service-cadet_tunnels.c
@@ -3476,7 +3476,7 @@ GCT_send (struct CadetTunnel *t,
3476 { 3476 {
3477 ch = lookup_channel (t, 3477 ch = lookup_channel (t,
3478 *ctn); 3478 *ctn);
3479 if ((NULL != ch)&& GCCH_is_type_to_drop (ch, message)) 3479 if ((NULL != ch) && GCCH_is_type_to_drop (ch, message))
3480 { 3480 {
3481 GNUNET_break (0); 3481 GNUNET_break (0);
3482 return NULL; 3482 return NULL;
diff --git a/src/cadet/gnunet-service-cadet_tunnels.h b/src/cadet/gnunet-service-cadet_tunnels.h
index 147f2e56f..075cd03f8 100644
--- a/src/cadet/gnunet-service-cadet_tunnels.h
+++ b/src/cadet/gnunet-service-cadet_tunnels.h
@@ -235,7 +235,7 @@ GCT_send (struct CadetTunnel *t,
235 const struct GNUNET_MessageHeader *message, 235 const struct GNUNET_MessageHeader *message,
236 GCT_SendContinuation cont, 236 GCT_SendContinuation cont,
237 void *cont_cls, 237 void *cont_cls,
238 struct GNUNET_CADET_ChannelTunnelNumber *ctn); 238 struct GNUNET_CADET_ChannelTunnelNumber *ctn);
239 239
240 240
241/** 241/**
diff --git a/src/cadet/test_cadet.c b/src/cadet/test_cadet.c
index 779d3bc9f..23f2ccbe3 100644
--- a/src/cadet/test_cadet.c
+++ b/src/cadet/test_cadet.c
@@ -550,6 +550,7 @@ get_from_p_ids ()
550 } 550 }
551} 551}
552 552
553
553static struct GNUNET_CADET_Handle * 554static struct GNUNET_CADET_Handle *
554get_from_cadets () 555get_from_cadets ()
555{ 556{
@@ -568,6 +569,7 @@ get_from_cadets ()
568 569
569} 570}
570 571
572
571static unsigned int 573static unsigned int
572get_peer_nr (int outgoing) 574get_peer_nr (int outgoing)
573{ 575{
@@ -581,6 +583,7 @@ get_peer_nr (int outgoing)
581 } 583 }
582} 584}
583 585
586
584/** 587/**
585 * Task to reconnect to other peer. 588 * Task to reconnect to other peer.
586 * 589 *
@@ -626,6 +629,7 @@ reconnect_op (void *cls)
626 send_test_message (outgoing_ch); 629 send_test_message (outgoing_ch);
627} 630}
628 631
632
629void 633void
630reopen_channel () 634reopen_channel ()
631{ 635{
@@ -659,6 +663,7 @@ reopen_channel ()
659 send_test_message (outgoing_ch); 663 send_test_message (outgoing_ch);
660} 664}
661 665
666
662static void 667static void
663peers_callback (void *cls, const struct GNUNET_CADET_PeerListEntry *ple); 668peers_callback (void *cls, const struct GNUNET_CADET_PeerListEntry *ple);
664 669
@@ -676,6 +681,7 @@ get_peers (void *cls)
676 681
677} 682}
678 683
684
679/** 685/**
680 * Method called to retrieve information about all peers in CADET, called 686 * Method called to retrieve information about all peers in CADET, called
681 * once per peer. 687 * once per peer.
@@ -712,7 +718,7 @@ peers_callback (void *cls, const struct GNUNET_CADET_PeerListEntry *ple)
712 "p_id %s\n", 718 "p_id %s\n",
713 GNUNET_i2s_full (p_id)); 719 GNUNET_i2s_full (p_id));
714 720
715 if ((0 == GNUNET_memcmp (&ple->peer, p_id))&& ple->have_tunnel) 721 if ((0 == GNUNET_memcmp (&ple->peer, p_id)) && ple->have_tunnel)
716 { 722 {
717 723
718 GNUNET_log (GNUNET_ERROR_TYPE_INFO, 724 GNUNET_log (GNUNET_ERROR_TYPE_INFO,
@@ -733,6 +739,7 @@ peers_callback (void *cls, const struct GNUNET_CADET_PeerListEntry *ple)
733 } 739 }
734} 740}
735 741
742
736/** 743/**
737 * Function called whenever an MQ-channel is destroyed, unless the destruction 744 * Function called whenever an MQ-channel is destroyed, unless the destruction
738 * was requested by #GNUNET_CADET_channel_destroy. 745 * was requested by #GNUNET_CADET_channel_destroy.
@@ -1169,7 +1176,7 @@ connect_handler (void *cls,
1169 1176
1170 if (peer == get_peer_nr (GNUNET_NO)) 1177 if (peer == get_peer_nr (GNUNET_NO))
1171 { 1178 {
1172 if ((DESTROY != test)&&(NULL != incoming_ch)) 1179 if ((DESTROY != test) && (NULL != incoming_ch))
1173 { 1180 {
1174 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, 1181 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
1175 "Duplicate incoming channel for client %lu\n", 1182 "Duplicate incoming channel for client %lu\n",
diff --git a/src/conversation/test_conversation_api.c b/src/conversation/test_conversation_api.c
index dbb742d91..b51186dc8 100644
--- a/src/conversation/test_conversation_api.c
+++ b/src/conversation/test_conversation_api.c
@@ -402,7 +402,8 @@ namestore_put_cont (void *cls, int32_t success, const char *emsg)
402 GNUNET_assert (GNUNET_YES == success); 402 GNUNET_assert (GNUNET_YES == success);
403 GNUNET_assert (NULL == emsg); 403 GNUNET_assert (NULL == emsg);
404 GNUNET_assert (NULL == op); 404 GNUNET_assert (NULL == op);
405 op = GNUNET_IDENTITY_create (id, "caller-ego", NULL, &caller_ego_create_cont, NULL); 405 op = GNUNET_IDENTITY_create (id, "caller-ego", NULL, &caller_ego_create_cont,
406 NULL);
406} 407}
407 408
408 409
@@ -483,7 +484,8 @@ run (void *cls,
483 cfg = c; 484 cfg = c;
484 GNUNET_SCHEDULER_add_delayed (TIMEOUT, &end_test, NULL); 485 GNUNET_SCHEDULER_add_delayed (TIMEOUT, &end_test, NULL);
485 id = GNUNET_IDENTITY_connect (cfg, &identity_cb, NULL); 486 id = GNUNET_IDENTITY_connect (cfg, &identity_cb, NULL);
486 op = GNUNET_IDENTITY_create (id, "phone-ego", NULL, &phone_ego_create_cont, NULL); 487 op = GNUNET_IDENTITY_create (id, "phone-ego", NULL, &phone_ego_create_cont,
488 NULL);
487 ns = GNUNET_NAMESTORE_connect (cfg); 489 ns = GNUNET_NAMESTORE_connect (cfg);
488} 490}
489 491
diff --git a/src/conversation/test_conversation_api_reject.c b/src/conversation/test_conversation_api_reject.c
index 855b21fd7..69fa9f1dc 100644
--- a/src/conversation/test_conversation_api_reject.c
+++ b/src/conversation/test_conversation_api_reject.c
@@ -255,7 +255,8 @@ namestore_put_cont (void *cls, int32_t success, const char *emsg)
255 GNUNET_assert (GNUNET_YES == success); 255 GNUNET_assert (GNUNET_YES == success);
256 GNUNET_assert (NULL == emsg); 256 GNUNET_assert (NULL == emsg);
257 GNUNET_assert (NULL == op); 257 GNUNET_assert (NULL == op);
258 op = GNUNET_IDENTITY_create (id, "caller-ego", NULL, &caller_ego_create_cont, NULL); 258 op = GNUNET_IDENTITY_create (id, "caller-ego", NULL, &caller_ego_create_cont,
259 NULL);
259} 260}
260 261
261 262
@@ -336,7 +337,8 @@ run (void *cls,
336 cfg = c; 337 cfg = c;
337 GNUNET_SCHEDULER_add_delayed (TIMEOUT, &end_test, NULL); 338 GNUNET_SCHEDULER_add_delayed (TIMEOUT, &end_test, NULL);
338 id = GNUNET_IDENTITY_connect (cfg, &identity_cb, NULL); 339 id = GNUNET_IDENTITY_connect (cfg, &identity_cb, NULL);
339 op = GNUNET_IDENTITY_create (id, "phone-ego", NULL, &phone_ego_create_cont, NULL); 340 op = GNUNET_IDENTITY_create (id, "phone-ego", NULL, &phone_ego_create_cont,
341 NULL);
340 ns = GNUNET_NAMESTORE_connect (cfg); 342 ns = GNUNET_NAMESTORE_connect (cfg);
341} 343}
342 344
diff --git a/src/conversation/test_conversation_api_twocalls.c b/src/conversation/test_conversation_api_twocalls.c
index 6d434a3e1..83e8cb55a 100644
--- a/src/conversation/test_conversation_api_twocalls.c
+++ b/src/conversation/test_conversation_api_twocalls.c
@@ -524,7 +524,8 @@ namestore_put_cont (void *cls, int32_t success, const char *emsg)
524 GNUNET_assert (GNUNET_YES == success); 524 GNUNET_assert (GNUNET_YES == success);
525 GNUNET_assert (NULL == emsg); 525 GNUNET_assert (NULL == emsg);
526 GNUNET_assert (NULL == op); 526 GNUNET_assert (NULL == op);
527 op = GNUNET_IDENTITY_create (id, "caller-ego", NULL, &caller_ego_create_cont, NULL); 527 op = GNUNET_IDENTITY_create (id, "caller-ego", NULL, &caller_ego_create_cont,
528 NULL);
528} 529}
529 530
530 531
@@ -613,7 +614,8 @@ run (void *cls,
613 timeout_task = GNUNET_SCHEDULER_add_delayed (TIMEOUT, &end_test, NULL); 614 timeout_task = GNUNET_SCHEDULER_add_delayed (TIMEOUT, &end_test, NULL);
614 GNUNET_SCHEDULER_add_shutdown (&do_shutdown, NULL); 615 GNUNET_SCHEDULER_add_shutdown (&do_shutdown, NULL);
615 id = GNUNET_IDENTITY_connect (cfg, &identity_cb, NULL); 616 id = GNUNET_IDENTITY_connect (cfg, &identity_cb, NULL);
616 op = GNUNET_IDENTITY_create (id, "phone-ego", NULL, &phone_ego_create_cont, NULL); 617 op = GNUNET_IDENTITY_create (id, "phone-ego", NULL, &phone_ego_create_cont,
618 NULL);
617 ns = GNUNET_NAMESTORE_connect (cfg); 619 ns = GNUNET_NAMESTORE_connect (cfg);
618} 620}
619 621
diff --git a/src/curl/curl.c b/src/curl/curl.c
index b3d2af252..eb9dd6a29 100644
--- a/src/curl/curl.c
+++ b/src/curl/curl.c
@@ -195,14 +195,14 @@ struct GNUNET_CURL_Context
195 195
196 /** 196 /**
197 * Passphrase to decrypt @e keyfile, or NULL. 197 * Passphrase to decrypt @e keyfile, or NULL.
198 */ 198 */
199 char *keypass; 199 char *keypass;
200 200
201}; 201};
202 202
203 203
204/** 204/**
205 * Force use of the provided username and password 205 * Force use of the provided username and password
206 * for client authentication for all operations performed 206 * for client authentication for all operations performed
207 * with @a ctx. 207 * with @a ctx.
208 * 208 *
@@ -605,8 +605,8 @@ GNUNET_CURL_job_add_with_ct_json (struct GNUNET_CURL_Context *ctx,
605 struct curl_slist *job_headers = NULL; 605 struct curl_slist *job_headers = NULL;
606 606
607 GNUNET_assert (NULL != (job_headers = 607 GNUNET_assert (NULL != (job_headers =
608 curl_slist_append (NULL, 608 curl_slist_append (NULL,
609 "Content-Type: application/json"))); 609 "Content-Type: application/json")));
610 job = GNUNET_CURL_job_add2 (ctx, 610 job = GNUNET_CURL_job_add2 (ctx,
611 eh, 611 eh,
612 job_headers, 612 job_headers,
diff --git a/src/fs/fs_namespace.c b/src/fs/fs_namespace.c
index 508f9cadc..155486be5 100644
--- a/src/fs/fs_namespace.c
+++ b/src/fs/fs_namespace.c
@@ -214,13 +214,13 @@ write_update_information_graph (struct GNUNET_FS_UpdateInformationGraph *uig)
214 n = uig->update_nodes[i]; 214 n = uig->update_nodes[i];
215 uris = GNUNET_FS_uri_to_string (n->uri); 215 uris = GNUNET_FS_uri_to_string (n->uri);
216 struct GNUNET_BIO_WriteSpec ws[] = { 216 struct GNUNET_BIO_WriteSpec ws[] = {
217 GNUNET_BIO_write_spec_string("fs-namespace-node-id", n->id), 217 GNUNET_BIO_write_spec_string ("fs-namespace-node-id", n->id),
218 GNUNET_BIO_write_spec_meta_data("fs-namespace-node-meta", n->md), 218 GNUNET_BIO_write_spec_meta_data ("fs-namespace-node-meta", n->md),
219 GNUNET_BIO_write_spec_string("fs-namespace-node-update", n->update), 219 GNUNET_BIO_write_spec_string ("fs-namespace-node-update", n->update),
220 GNUNET_BIO_write_spec_string("fs-namespace-uris", uris), 220 GNUNET_BIO_write_spec_string ("fs-namespace-uris", uris),
221 GNUNET_BIO_write_spec_end(), 221 GNUNET_BIO_write_spec_end (),
222 }; 222 };
223 if (GNUNET_OK != GNUNET_BIO_write_spec_commit(wh, ws)) 223 if (GNUNET_OK != GNUNET_BIO_write_spec_commit (wh, ws))
224 { 224 {
225 GNUNET_free (uris); 225 GNUNET_free (uris);
226 break; 226 break;
@@ -292,11 +292,11 @@ read_update_information_graph (struct GNUNET_FS_Handle *h,
292 { 292 {
293 n = GNUNET_new (struct NamespaceUpdateNode); 293 n = GNUNET_new (struct NamespaceUpdateNode);
294 struct GNUNET_BIO_ReadSpec rs[] = { 294 struct GNUNET_BIO_ReadSpec rs[] = {
295 GNUNET_BIO_read_spec_string("identifier", &n->id, 1024), 295 GNUNET_BIO_read_spec_string ("identifier", &n->id, 1024),
296 GNUNET_BIO_read_spec_meta_data("meta", &n->md), 296 GNUNET_BIO_read_spec_meta_data ("meta", &n->md),
297 GNUNET_BIO_read_spec_string("update-id", &n->update, 1024), 297 GNUNET_BIO_read_spec_string ("update-id", &n->update, 1024),
298 GNUNET_BIO_read_spec_string("uri", &uris, 1024 * 2), 298 GNUNET_BIO_read_spec_string ("uri", &uris, 1024 * 2),
299 GNUNET_BIO_read_spec_end(), 299 GNUNET_BIO_read_spec_end (),
300 }; 300 };
301 if (GNUNET_OK != GNUNET_BIO_read_spec_commit (rh, rs)) 301 if (GNUNET_OK != GNUNET_BIO_read_spec_commit (rh, rs))
302 { 302 {
diff --git a/src/fs/gnunet-auto-share.c b/src/fs/gnunet-auto-share.c
index 41dfe781a..f91e9d00d 100644
--- a/src/fs/gnunet-auto-share.c
+++ b/src/fs/gnunet-auto-share.c
@@ -201,9 +201,9 @@ load_state ()
201 while (n-- > 0) 201 while (n-- > 0)
202 { 202 {
203 struct GNUNET_BIO_ReadSpec rs[] = { 203 struct GNUNET_BIO_ReadSpec rs[] = {
204 GNUNET_BIO_read_spec_string("filename", &fn, 1024), 204 GNUNET_BIO_read_spec_string ("filename", &fn, 1024),
205 GNUNET_BIO_read_spec_object("id", &id, sizeof(struct GNUNET_HashCode)), 205 GNUNET_BIO_read_spec_object ("id", &id, sizeof(struct GNUNET_HashCode)),
206 GNUNET_BIO_read_spec_end(), 206 GNUNET_BIO_read_spec_end (),
207 }; 207 };
208 if (GNUNET_OK != GNUNET_BIO_read_spec_commit (rh, rs)) 208 if (GNUNET_OK != GNUNET_BIO_read_spec_commit (rh, rs))
209 goto error; 209 goto error;
@@ -258,7 +258,8 @@ write_item (void *cls, const struct GNUNET_HashCode *key, void *value)
258 struct GNUNET_BIO_WriteSpec ws[] = { 258 struct GNUNET_BIO_WriteSpec ws[] = {
259 GNUNET_BIO_write_spec_string ("auto-share-write-item-filename", 259 GNUNET_BIO_write_spec_string ("auto-share-write-item-filename",
260 wi->filename), 260 wi->filename),
261 GNUNET_BIO_write_spec_object ("id", &wi->id, sizeof(struct GNUNET_HashCode)), 261 GNUNET_BIO_write_spec_object ("id", &wi->id, sizeof(struct
262 GNUNET_HashCode)),
262 GNUNET_BIO_write_spec_end (), 263 GNUNET_BIO_write_spec_end (),
263 }; 264 };
264 if (GNUNET_OK != GNUNET_BIO_write_spec_commit (wh, ws)) 265 if (GNUNET_OK != GNUNET_BIO_write_spec_commit (wh, ws))
@@ -747,7 +748,7 @@ main (int argc, char *const *argv)
747 748
748 if (GNUNET_OK != GNUNET_STRINGS_get_utf8_args (argc, argv, &argc, &argv)) 749 if (GNUNET_OK != GNUNET_STRINGS_get_utf8_args (argc, argv, &argc, &argv))
749 return 2; 750 return 2;
750 sigpipe = GNUNET_DISK_pipe (GNUNET_NO, GNUNET_NO, GNUNET_NO, GNUNET_NO); 751 sigpipe = GNUNET_DISK_pipe (GNUNET_DISK_PF_NONE);
751 GNUNET_assert (NULL != sigpipe); 752 GNUNET_assert (NULL != sigpipe);
752 shc_chld = 753 shc_chld =
753 GNUNET_SIGNAL_handler_install (GNUNET_SIGCHLD, &sighandler_child_death); 754 GNUNET_SIGNAL_handler_install (GNUNET_SIGCHLD, &sighandler_child_death);
diff --git a/src/gns/gns_api.c b/src/gns/gns_api.c
index 0d99d822e..bf95bf340 100644
--- a/src/gns/gns_api.c
+++ b/src/gns/gns_api.c
@@ -427,4 +427,5 @@ GNUNET_GNS_lookup (struct GNUNET_GNS_Handle *handle,
427 proc_cls); 427 proc_cls);
428} 428}
429 429
430
430/* end of gns_api.c */ 431/* end of gns_api.c */
diff --git a/src/gns/gnunet-dns2gns.c b/src/gns/gnunet-dns2gns.c
index 74309f554..0a9b7c861 100644
--- a/src/gns/gnunet-dns2gns.c
+++ b/src/gns/gnunet-dns2gns.c
@@ -190,6 +190,7 @@ do_shutdown (void *cls)
190 } 190 }
191} 191}
192 192
193
193/** 194/**
194 * Shuffle answers 195 * Shuffle answers
195 * Fisher-Yates (aka Knuth) Shuffle 196 * Fisher-Yates (aka Knuth) Shuffle
@@ -216,6 +217,7 @@ shuffle_answers (struct Request *request)
216 } 217 }
217} 218}
218 219
220
219/** 221/**
220 * Send the response for the given request and clean up. 222 * Send the response for the given request and clean up.
221 * 223 *
diff --git a/src/gns/nss/nss_gns.c b/src/gns/nss/nss_gns.c
index 36799ba3a..77b4340ee 100644
--- a/src/gns/nss/nss_gns.c
+++ b/src/gns/nss/nss_gns.c
@@ -38,7 +38,7 @@
38/** macro to align idx to 32bit boundary */ 38/** macro to align idx to 32bit boundary */
39#define ALIGN(idx) do { \ 39#define ALIGN(idx) do { \
40 if (idx % sizeof(void*)) \ 40 if (idx % sizeof(void*)) \
41 idx += (sizeof(void*) - idx % sizeof(void*)); /* Align on 32 bit boundary */ \ 41 idx += (sizeof(void*) - idx % sizeof(void*)); /* Align on 32 bit boundary */ \
42} while (0) 42} while (0)
43 43
44 44
diff --git a/src/gns/nss/nss_gns_query.c b/src/gns/nss/nss_gns_query.c
index 11e46ad7f..96e8e10da 100644
--- a/src/gns/nss/nss_gns_query.c
+++ b/src/gns/nss/nss_gns_query.c
@@ -150,7 +150,7 @@ query_gns:
150 if (1 == retry) 150 if (1 == retry)
151 return -2; /* no go -> service unavailable */ 151 return -2; /* no go -> service unavailable */
152 retry = 1; 152 retry = 1;
153 system("gnunet-arm -s"); 153 system ("gnunet-arm -s");
154 goto query_gns; /* Try again */ 154 goto query_gns; /* Try again */
155 } 155 }
156 if (3 == WEXITSTATUS (ret)) 156 if (3 == WEXITSTATUS (ret))
diff --git a/src/gnsrecord/gnsrecord.c b/src/gnsrecord/gnsrecord.c
index 3cbf5fc8d..8d5a6d95b 100644
--- a/src/gnsrecord/gnsrecord.c
+++ b/src/gnsrecord/gnsrecord.c
@@ -106,11 +106,11 @@ init ()
106 const struct GNUNET_OS_ProjectData *dpd = GNUNET_OS_project_data_default (); 106 const struct GNUNET_OS_ProjectData *dpd = GNUNET_OS_project_data_default ();
107 107
108 if (pd != dpd) 108 if (pd != dpd)
109 GNUNET_OS_init(dpd); 109 GNUNET_OS_init (dpd);
110 GNUNET_PLUGIN_load_all ("libgnunet_plugin_gnsrecord_", NULL, 110 GNUNET_PLUGIN_load_all ("libgnunet_plugin_gnsrecord_", NULL,
111 &add_plugin, NULL); 111 &add_plugin, NULL);
112 if (pd != dpd) 112 if (pd != dpd)
113 GNUNET_OS_init(pd); 113 GNUNET_OS_init (pd);
114} 114}
115 115
116 116
@@ -125,7 +125,7 @@ GNSRECORD_fini ()
125 const struct GNUNET_OS_ProjectData *dpd = GNUNET_OS_project_data_default (); 125 const struct GNUNET_OS_ProjectData *dpd = GNUNET_OS_project_data_default ();
126 126
127 if (pd != dpd) 127 if (pd != dpd)
128 GNUNET_OS_init(dpd); 128 GNUNET_OS_init (dpd);
129 129
130 for (unsigned int i = 0; i < num_plugins; i++) 130 for (unsigned int i = 0; i < num_plugins; i++)
131 { 131 {
@@ -139,7 +139,7 @@ GNSRECORD_fini ()
139 GNUNET_free (gns_plugins); 139 GNUNET_free (gns_plugins);
140 140
141 if (pd != dpd) 141 if (pd != dpd)
142 GNUNET_OS_init(pd); 142 GNUNET_OS_init (pd);
143 143
144 gns_plugins = NULL; 144 gns_plugins = NULL;
145 once = 0; 145 once = 0;
diff --git a/src/hostlist/gnunet-daemon-hostlist_client.c b/src/hostlist/gnunet-daemon-hostlist_client.c
index 5dc2e7f2a..b377f2041 100644
--- a/src/hostlist/gnunet-daemon-hostlist_client.c
+++ b/src/hostlist/gnunet-daemon-hostlist_client.c
@@ -540,12 +540,12 @@ download_get_url ()
540 { \ 540 { \
541 ret = curl_easy_setopt (c, a, b); \ 541 ret = curl_easy_setopt (c, a, b); \
542 if (CURLE_OK != ret) \ 542 if (CURLE_OK != ret) \
543 GNUNET_log (GNUNET_ERROR_TYPE_WARNING, \ 543 GNUNET_log (GNUNET_ERROR_TYPE_WARNING, \
544 _ ("%s failed at %s:%d: `%s'\n"), \ 544 _ ("%s failed at %s:%d: `%s'\n"), \
545 "curl_easy_setopt", \ 545 "curl_easy_setopt", \
546 __FILE__, \ 546 __FILE__, \
547 __LINE__, \ 547 __LINE__, \
548 curl_easy_strerror (ret)); \ 548 curl_easy_strerror (ret)); \
549 } while (0) 549 } while (0)
550 550
551 551
@@ -1418,11 +1418,12 @@ load_hostlist_file ()
1418 1418
1419 counter = 0; 1419 counter = 0;
1420 struct GNUNET_BIO_ReadSpec rs[] = { 1420 struct GNUNET_BIO_ReadSpec rs[] = {
1421 GNUNET_BIO_read_spec_int32 ("times used", (int32_t *)&times_used), 1421 GNUNET_BIO_read_spec_int32 ("times used", (int32_t *) &times_used),
1422 GNUNET_BIO_read_spec_int64 ("quality", (int64_t *) &quality), 1422 GNUNET_BIO_read_spec_int64 ("quality", (int64_t *) &quality),
1423 GNUNET_BIO_read_spec_int64 ("last used", (int64_t *) &last_used), 1423 GNUNET_BIO_read_spec_int64 ("last used", (int64_t *) &last_used),
1424 GNUNET_BIO_read_spec_int64 ("created", (int64_t *) &created), 1424 GNUNET_BIO_read_spec_int64 ("created", (int64_t *) &created),
1425 GNUNET_BIO_read_spec_int32 ("hellos returned", (int32_t *) &hellos_returned), 1425 GNUNET_BIO_read_spec_int32 ("hellos returned",
1426 (int32_t *) &hellos_returned),
1426 GNUNET_BIO_read_spec_end (), 1427 GNUNET_BIO_read_spec_end (),
1427 }; 1428 };
1428 while ((GNUNET_OK == GNUNET_BIO_read_string (rh, "url", &uri, MAX_URL_LEN)) && 1429 while ((GNUNET_OK == GNUNET_BIO_read_string (rh, "url", &uri, MAX_URL_LEN)) &&
@@ -1527,7 +1528,8 @@ save_hostlist_file (int shutdown)
1527 { 1528 {
1528 struct GNUNET_BIO_WriteSpec ws[] = { 1529 struct GNUNET_BIO_WriteSpec ws[] = {
1529 GNUNET_BIO_write_spec_string ("hostlist uri", pos->hostlist_uri), 1530 GNUNET_BIO_write_spec_string ("hostlist uri", pos->hostlist_uri),
1530 GNUNET_BIO_write_spec_int32 ("times used", (int32_t *) &pos->times_used), 1531 GNUNET_BIO_write_spec_int32 ("times used",
1532 (int32_t *) &pos->times_used),
1531 GNUNET_BIO_write_spec_int64 ("quality", (int64_t *) &pos->quality), 1533 GNUNET_BIO_write_spec_int64 ("quality", (int64_t *) &pos->quality),
1532 GNUNET_BIO_write_spec_int64 ( 1534 GNUNET_BIO_write_spec_int64 (
1533 "last usage", 1535 "last usage",
diff --git a/src/identity/gnunet-identity.c b/src/identity/gnunet-identity.c
index cf44afd1f..d0f5546f3 100644
--- a/src/identity/gnunet-identity.c
+++ b/src/identity/gnunet-identity.c
@@ -406,7 +406,8 @@ run (void *cls,
406 GNUNET_STRINGS_string_to_data (privkey_ego, 406 GNUNET_STRINGS_string_to_data (privkey_ego,
407 strlen (privkey_ego), 407 strlen (privkey_ego),
408 &pk, 408 &pk,
409 sizeof(struct GNUNET_CRYPTO_EcdsaPrivateKey)); 409 sizeof(struct
410 GNUNET_CRYPTO_EcdsaPrivateKey));
410 create_op = 411 create_op =
411 GNUNET_IDENTITY_create (sh, 412 GNUNET_IDENTITY_create (sh,
412 create_ego, 413 create_ego,
@@ -452,7 +453,8 @@ main (int argc, char *const *argv)
452 GNUNET_GETOPT_option_string ('P', 453 GNUNET_GETOPT_option_string ('P',
453 "privkey", 454 "privkey",
454 "PRIVATE_KEY", 455 "PRIVATE_KEY",
455 gettext_noop ("set the private key for the identity to PRIVATE_KEY (use together with -C)"), 456 gettext_noop (
457 "set the private key for the identity to PRIVATE_KEY (use together with -C)"),
456 &privkey_ego), 458 &privkey_ego),
457 GNUNET_GETOPT_option_flag ('d', 459 GNUNET_GETOPT_option_flag ('d',
458 "display", 460 "display",
diff --git a/src/identity/plugin_rest_identity.c b/src/identity/plugin_rest_identity.c
index 5aca07ddf..02e42d03f 100644
--- a/src/identity/plugin_rest_identity.c
+++ b/src/identity/plugin_rest_identity.c
@@ -1065,7 +1065,8 @@ ego_create (struct GNUNET_REST_RequestHandle *con_handle,
1065 GNUNET_STRINGS_string_to_data (privkey, 1065 GNUNET_STRINGS_string_to_data (privkey,
1066 strlen (privkey), 1066 strlen (privkey),
1067 &pk, 1067 &pk,
1068 sizeof(struct GNUNET_CRYPTO_EcdsaPrivateKey)); 1068 sizeof(struct
1069 GNUNET_CRYPTO_EcdsaPrivateKey));
1069 pk_ptr = &pk; 1070 pk_ptr = &pk;
1070 } 1071 }
1071 else 1072 else
diff --git a/src/include/gnunet_bio_lib.h b/src/include/gnunet_bio_lib.h
index 687334c1c..e49ce1354 100644
--- a/src/include/gnunet_bio_lib.h
+++ b/src/include/gnunet_bio_lib.h
@@ -138,9 +138,9 @@ GNUNET_BIO_read_meta_data (struct GNUNET_BIO_ReadHandle *h,
138 * @param f address of float to read 138 * @param f address of float to read
139 */ 139 */
140int 140int
141GNUNET_BIO_read_float(struct GNUNET_BIO_ReadHandle *h, 141GNUNET_BIO_read_float (struct GNUNET_BIO_ReadHandle *h,
142 const char *what, 142 const char *what,
143 float *f); 143 float *f);
144 144
145 145
146/** 146/**
@@ -151,10 +151,9 @@ GNUNET_BIO_read_float(struct GNUNET_BIO_ReadHandle *h,
151 * @param f address of double to read 151 * @param f address of double to read
152 */ 152 */
153int 153int
154GNUNET_BIO_read_double(struct GNUNET_BIO_ReadHandle *h, 154GNUNET_BIO_read_double (struct GNUNET_BIO_ReadHandle *h,
155 const char *what, 155 const char *what,
156 double *f); 156 double *f);
157
158 157
159 158
160/** 159/**
@@ -171,7 +170,6 @@ GNUNET_BIO_read_int32 (struct GNUNET_BIO_ReadHandle *h,
171 int32_t *i); 170 int32_t *i);
172 171
173 172
174
175/** 173/**
176 * Read an (u)int64_t. 174 * Read an (u)int64_t.
177 * 175 *
@@ -186,7 +184,6 @@ GNUNET_BIO_read_int64 (struct GNUNET_BIO_ReadHandle *h,
186 int64_t *i); 184 int64_t *i);
187 185
188 186
189
190/****************************** WRITING API *******************************/ 187/****************************** WRITING API *******************************/
191 188
192/** 189/**
@@ -310,9 +307,9 @@ GNUNET_BIO_write_meta_data (struct GNUNET_BIO_WriteHandle *h,
310 * @param f float to write (must be a variable) 307 * @param f float to write (must be a variable)
311 */ 308 */
312int 309int
313GNUNET_BIO_write_float(struct GNUNET_BIO_WriteHandle *h, 310GNUNET_BIO_write_float (struct GNUNET_BIO_WriteHandle *h,
314 const char *what, 311 const char *what,
315 float f); 312 float f);
316 313
317/** 314/**
318 * Write a double. 315 * Write a double.
@@ -322,9 +319,9 @@ GNUNET_BIO_write_float(struct GNUNET_BIO_WriteHandle *h,
322 * @param f double to write (must be a variable) 319 * @param f double to write (must be a variable)
323 */ 320 */
324int 321int
325GNUNET_BIO_write_double(struct GNUNET_BIO_WriteHandle *h, 322GNUNET_BIO_write_double (struct GNUNET_BIO_WriteHandle *h,
326 const char *what, 323 const char *what,
327 double f); 324 double f);
328 325
329 326
330/** 327/**
@@ -490,7 +487,7 @@ GNUNET_BIO_read_spec_int64 (const char *what,
490 * @param f address of float to read 487 * @param f address of float to read
491 */ 488 */
492struct GNUNET_BIO_ReadSpec 489struct GNUNET_BIO_ReadSpec
493GNUNET_BIO_read_spec_float(const char *what, float *f); 490GNUNET_BIO_read_spec_float (const char *what, float *f);
494 491
495 492
496/** 493/**
@@ -500,7 +497,7 @@ GNUNET_BIO_read_spec_float(const char *what, float *f);
500 * @param f address of double to read 497 * @param f address of double to read
501 */ 498 */
502struct GNUNET_BIO_ReadSpec 499struct GNUNET_BIO_ReadSpec
503GNUNET_BIO_read_spec_double(const char *what, double *f); 500GNUNET_BIO_read_spec_double (const char *what, double *f);
504 501
505 502
506/** 503/**
@@ -647,7 +644,7 @@ GNUNET_BIO_write_spec_int64 (const char *what,
647 * @return the write spec 644 * @return the write spec
648 */ 645 */
649struct GNUNET_BIO_WriteSpec 646struct GNUNET_BIO_WriteSpec
650GNUNET_BIO_write_spec_float(const char *what, float *f); 647GNUNET_BIO_write_spec_float (const char *what, float *f);
651 648
652 649
653/** 650/**
@@ -658,7 +655,7 @@ GNUNET_BIO_write_spec_float(const char *what, float *f);
658 * @return the write spec 655 * @return the write spec
659 */ 656 */
660struct GNUNET_BIO_WriteSpec 657struct GNUNET_BIO_WriteSpec
661GNUNET_BIO_write_spec_double(const char *what, double *f); 658GNUNET_BIO_write_spec_double (const char *what, double *f);
662 659
663 660
664/** 661/**
diff --git a/src/include/gnunet_buffer_lib.h b/src/include/gnunet_buffer_lib.h
index e23536ab2..e09ec130a 100644
--- a/src/include/gnunet_buffer_lib.h
+++ b/src/include/gnunet_buffer_lib.h
@@ -147,7 +147,7 @@ GNUNET_buffer_write_fstr (struct GNUNET_Buffer *buf, const char *fmt, ...);
147 */ 147 */
148void 148void
149GNUNET_buffer_write_vfstr (struct GNUNET_Buffer *buf, const char *fmt, va_list 149GNUNET_buffer_write_vfstr (struct GNUNET_Buffer *buf, const char *fmt, va_list
150 args); 150 args);
151 151
152 152
153/** 153/**
diff --git a/src/include/gnunet_common.h b/src/include/gnunet_common.h
index b2f99cd55..91d4a5bd4 100644
--- a/src/include/gnunet_common.h
+++ b/src/include/gnunet_common.h
@@ -457,11 +457,11 @@ __attribute__ ((format (printf, 2, 3)));
457 __extension__ ({ \ 457 __extension__ ({ \
458 int _gnunet_boolean_var_; \ 458 int _gnunet_boolean_var_; \
459 if (expr) \ 459 if (expr) \
460 _gnunet_boolean_var_ = 1; \ 460 _gnunet_boolean_var_ = 1; \
461 else \ 461 else \
462 _gnunet_boolean_var_ = 0; \ 462 _gnunet_boolean_var_ = 0; \
463 _gnunet_boolean_var_; \ 463 _gnunet_boolean_var_; \
464 }) 464 })
465#define GN_LIKELY(expr) (__builtin_expect (_GNUNET_BOOLEAN_EXPR (expr), 1)) 465#define GN_LIKELY(expr) (__builtin_expect (_GNUNET_BOOLEAN_EXPR (expr), 1))
466#define GN_UNLIKELY(expr) (__builtin_expect (_GNUNET_BOOLEAN_EXPR (expr), 0)) 466#define GN_UNLIKELY(expr) (__builtin_expect (_GNUNET_BOOLEAN_EXPR (expr), 0))
467#else 467#else
@@ -499,12 +499,12 @@ GNUNET_log_from_nocheck (enum GNUNET_ErrorType kind,
499 ((GNUNET_ERROR_TYPE_DEBUG & (kind)) == 0)) \ 499 ((GNUNET_ERROR_TYPE_DEBUG & (kind)) == 0)) \
500 { \ 500 { \
501 if (GN_UNLIKELY (log_call_enabled == -1)) \ 501 if (GN_UNLIKELY (log_call_enabled == -1)) \
502 log_call_enabled = \ 502 log_call_enabled = \
503 GNUNET_get_log_call_status ((kind) & (~GNUNET_ERROR_TYPE_BULK), \ 503 GNUNET_get_log_call_status ((kind) & (~GNUNET_ERROR_TYPE_BULK), \
504 (comp), \ 504 (comp), \
505 __FILE__, \ 505 __FILE__, \
506 __FUNCTION__, \ 506 __FUNCTION__, \
507 __LINE__); \ 507 __LINE__); \
508 if (GN_UNLIKELY (GNUNET_get_log_skip () > 0)) \ 508 if (GN_UNLIKELY (GNUNET_get_log_skip () > 0)) \
509 { \ 509 { \
510 GNUNET_log_skip (-1, GNUNET_NO); \ 510 GNUNET_log_skip (-1, GNUNET_NO); \
@@ -512,7 +512,7 @@ GNUNET_log_from_nocheck (enum GNUNET_ErrorType kind,
512 else \ 512 else \
513 { \ 513 { \
514 if (GN_UNLIKELY (log_call_enabled)) \ 514 if (GN_UNLIKELY (log_call_enabled)) \
515 GNUNET_log_from_nocheck ((kind), comp, __VA_ARGS__); \ 515 GNUNET_log_from_nocheck ((kind), comp, __VA_ARGS__); \
516 } \ 516 } \
517 } \ 517 } \
518 } while (0) 518 } while (0)
@@ -525,12 +525,12 @@ GNUNET_log_from_nocheck (enum GNUNET_ErrorType kind,
525 ((GNUNET_ERROR_TYPE_DEBUG & (kind)) == 0)) \ 525 ((GNUNET_ERROR_TYPE_DEBUG & (kind)) == 0)) \
526 { \ 526 { \
527 if (GN_UNLIKELY (log_call_enabled == -1)) \ 527 if (GN_UNLIKELY (log_call_enabled == -1)) \
528 log_call_enabled = \ 528 log_call_enabled = \
529 GNUNET_get_log_call_status ((kind) & (~GNUNET_ERROR_TYPE_BULK), \ 529 GNUNET_get_log_call_status ((kind) & (~GNUNET_ERROR_TYPE_BULK), \
530 NULL, \ 530 NULL, \
531 __FILE__, \ 531 __FILE__, \
532 __FUNCTION__, \ 532 __FUNCTION__, \
533 __LINE__); \ 533 __LINE__); \
534 if (GN_UNLIKELY (GNUNET_get_log_skip () > 0)) \ 534 if (GN_UNLIKELY (GNUNET_get_log_skip () > 0)) \
535 { \ 535 { \
536 GNUNET_log_skip (-1, GNUNET_NO); \ 536 GNUNET_log_skip (-1, GNUNET_NO); \
@@ -538,7 +538,7 @@ GNUNET_log_from_nocheck (enum GNUNET_ErrorType kind,
538 else \ 538 else \
539 { \ 539 { \
540 if (GN_UNLIKELY (log_call_enabled)) \ 540 if (GN_UNLIKELY (log_call_enabled)) \
541 GNUNET_log_nocheck ((kind), __VA_ARGS__); \ 541 GNUNET_log_nocheck ((kind), __VA_ARGS__); \
542 } \ 542 } \
543 } \ 543 } \
544 } while (0) 544 } while (0)
@@ -1319,8 +1319,8 @@ GNUNET_is_zero_ (const void *a,
1319 * been returned by #GNUNET_strdup, #GNUNET_strndup, #GNUNET_malloc or #GNUNET_array_grow earlier. NULL is allowed. 1319 * been returned by #GNUNET_strdup, #GNUNET_strndup, #GNUNET_malloc or #GNUNET_array_grow earlier. NULL is allowed.
1320 */ 1320 */
1321#define GNUNET_free(ptr) do { \ 1321#define GNUNET_free(ptr) do { \
1322 GNUNET_xfree_ (ptr, __FILE__, __LINE__); \ 1322 GNUNET_xfree_ (ptr, __FILE__, __LINE__); \
1323 ptr = NULL; \ 1323 ptr = NULL; \
1324} while (0) 1324} while (0)
1325 1325
1326 1326
diff --git a/src/include/gnunet_configuration_lib.h b/src/include/gnunet_configuration_lib.h
index b5ceb5b94..f782509eb 100644
--- a/src/include/gnunet_configuration_lib.h
+++ b/src/include/gnunet_configuration_lib.h
@@ -109,7 +109,7 @@ GNUNET_CONFIGURATION_load_from (struct GNUNET_CONFIGURATION_Handle *cfg,
109 * @return a freshly allocated configuration 109 * @return a freshly allocated configuration
110 */ 110 */
111struct GNUNET_CONFIGURATION_Handle * 111struct GNUNET_CONFIGURATION_Handle *
112GNUNET_CONFIGURATION_default(void); 112GNUNET_CONFIGURATION_default (void);
113 113
114 114
115/** 115/**
diff --git a/src/include/gnunet_constants.h b/src/include/gnunet_constants.h
index c83bec683..8b3cbc7e6 100644
--- a/src/include/gnunet_constants.h
+++ b/src/include/gnunet_constants.h
@@ -47,7 +47,8 @@ extern "C"
47 * so that at least one maximum-size message can be send roughly once 47 * so that at least one maximum-size message can be send roughly once
48 * per minute. 48 * per minute.
49 */ 49 */
50#define GNUNET_CONSTANTS_DEFAULT_BW_IN_OUT GNUNET_BANDWIDTH_value_init (1024*1024) 50#define GNUNET_CONSTANTS_DEFAULT_BW_IN_OUT GNUNET_BANDWIDTH_value_init (1024 \
51 * 1024)
51 52
52/** 53/**
53 * After how long do we consider a connection to a peer dead 54 * After how long do we consider a connection to a peer dead
diff --git a/src/include/gnunet_container_lib.h b/src/include/gnunet_container_lib.h
index f3325a064..8d8cbf4c1 100644
--- a/src/include/gnunet_container_lib.h
+++ b/src/include/gnunet_container_lib.h
@@ -2158,9 +2158,9 @@ GNUNET_CONTAINER_multihashmap32_iterator_destroy (
2158 (element)->next = (head); \ 2158 (element)->next = (head); \
2159 (element)->prev = NULL; \ 2159 (element)->prev = NULL; \
2160 if ((tail) == NULL) \ 2160 if ((tail) == NULL) \
2161 (tail) = element; \ 2161 (tail) = element; \
2162 else \ 2162 else \
2163 (head)->prev = element; \ 2163 (head)->prev = element; \
2164 (head) = (element); \ 2164 (head) = (element); \
2165 } while (0) 2165 } while (0)
2166 2166
@@ -2182,9 +2182,9 @@ GNUNET_CONTAINER_multihashmap32_iterator_destroy (
2182 (element)->prev = (tail); \ 2182 (element)->prev = (tail); \
2183 (element)->next = NULL; \ 2183 (element)->next = NULL; \
2184 if ((head) == NULL) \ 2184 if ((head) == NULL) \
2185 (head) = element; \ 2185 (head) = element; \
2186 else \ 2186 else \
2187 (tail)->next = element; \ 2187 (tail)->next = element; \
2188 (tail) = (element); \ 2188 (tail) = (element); \
2189 } while (0) 2189 } while (0)
2190 2190
@@ -2216,9 +2216,9 @@ GNUNET_CONTAINER_multihashmap32_iterator_destroy (
2216 (other)->next = (element); \ 2216 (other)->next = (element); \
2217 } \ 2217 } \
2218 if (NULL == (element)->next) \ 2218 if (NULL == (element)->next) \
2219 (tail) = (element); \ 2219 (tail) = (element); \
2220 else \ 2220 else \
2221 (element)->next->prev = (element); \ 2221 (element)->next->prev = (element); \
2222 } while (0) 2222 } while (0)
2223 2223
2224 2224
@@ -2249,9 +2249,9 @@ GNUNET_CONTAINER_multihashmap32_iterator_destroy (
2249 (other)->prev = (element); \ 2249 (other)->prev = (element); \
2250 } \ 2250 } \
2251 if (NULL == (element)->prev) \ 2251 if (NULL == (element)->prev) \
2252 (head) = (element); \ 2252 (head) = (element); \
2253 else \ 2253 else \
2254 (element)->prev->next = (element); \ 2254 (element)->prev->next = (element); \
2255 } while (0) 2255 } while (0)
2256 2256
2257 2257
@@ -2275,13 +2275,13 @@ GNUNET_CONTAINER_multihashmap32_iterator_destroy (
2275 GNUNET_assert (((element)->prev != NULL) || ((head) == (element))); \ 2275 GNUNET_assert (((element)->prev != NULL) || ((head) == (element))); \
2276 GNUNET_assert (((element)->next != NULL) || ((tail) == (element))); \ 2276 GNUNET_assert (((element)->next != NULL) || ((tail) == (element))); \
2277 if ((element)->prev == NULL) \ 2277 if ((element)->prev == NULL) \
2278 (head) = (element)->next; \ 2278 (head) = (element)->next; \
2279 else \ 2279 else \
2280 (element)->prev->next = (element)->next; \ 2280 (element)->prev->next = (element)->next; \
2281 if ((element)->next == NULL) \ 2281 if ((element)->next == NULL) \
2282 (tail) = (element)->prev; \ 2282 (tail) = (element)->prev; \
2283 else \ 2283 else \
2284 (element)->next->prev = (element)->prev; \ 2284 (element)->next->prev = (element)->prev; \
2285 (element)->next = NULL; \ 2285 (element)->next = NULL; \
2286 (element)->prev = NULL; \ 2286 (element)->prev = NULL; \
2287 } while (0) 2287 } while (0)
@@ -2308,9 +2308,9 @@ GNUNET_CONTAINER_multihashmap32_iterator_destroy (
2308 (element)->next_ ## mdll = (head); \ 2308 (element)->next_ ## mdll = (head); \
2309 (element)->prev_ ## mdll = NULL; \ 2309 (element)->prev_ ## mdll = NULL; \
2310 if ((tail) == NULL) \ 2310 if ((tail) == NULL) \
2311 (tail) = element; \ 2311 (tail) = element; \
2312 else \ 2312 else \
2313 (head)->prev_ ## mdll = element; \ 2313 (head)->prev_ ## mdll = element; \
2314 (head) = (element); \ 2314 (head) = (element); \
2315 } while (0) 2315 } while (0)
2316 2316
@@ -2333,9 +2333,9 @@ GNUNET_CONTAINER_multihashmap32_iterator_destroy (
2333 (element)->prev_ ## mdll = (tail); \ 2333 (element)->prev_ ## mdll = (tail); \
2334 (element)->next_ ## mdll = NULL; \ 2334 (element)->next_ ## mdll = NULL; \
2335 if ((head) == NULL) \ 2335 if ((head) == NULL) \
2336 (head) = element; \ 2336 (head) = element; \
2337 else \ 2337 else \
2338 (tail)->next_ ## mdll = element; \ 2338 (tail)->next_ ## mdll = element; \
2339 (tail) = (element); \ 2339 (tail) = (element); \
2340 } while (0) 2340 } while (0)
2341 2341
@@ -2368,9 +2368,9 @@ GNUNET_CONTAINER_multihashmap32_iterator_destroy (
2368 (other)->next_ ## mdll = (element); \ 2368 (other)->next_ ## mdll = (element); \
2369 } \ 2369 } \
2370 if (NULL == (element)->next_ ## mdll) \ 2370 if (NULL == (element)->next_ ## mdll) \
2371 (tail) = (element); \ 2371 (tail) = (element); \
2372 else \ 2372 else \
2373 (element)->next_ ## mdll->prev_ ## mdll = (element); \ 2373 (element)->next_ ## mdll->prev_ ## mdll = (element); \
2374 } while (0) 2374 } while (0)
2375 2375
2376 2376
@@ -2402,9 +2402,9 @@ GNUNET_CONTAINER_multihashmap32_iterator_destroy (
2402 (other)->prev_ ## mdll = (element); \ 2402 (other)->prev_ ## mdll = (element); \
2403 } \ 2403 } \
2404 if (NULL == (element)->prev_ ## mdll) \ 2404 if (NULL == (element)->prev_ ## mdll) \
2405 (head) = (element); \ 2405 (head) = (element); \
2406 else \ 2406 else \
2407 (element)->prev_ ## mdll->next_ ## mdll = (element); \ 2407 (element)->prev_ ## mdll->next_ ## mdll = (element); \
2408 } while (0) 2408 } while (0)
2409 2409
2410 2410
@@ -2425,13 +2425,13 @@ GNUNET_CONTAINER_multihashmap32_iterator_destroy (
2425 GNUNET_assert (((element)->prev_ ## mdll != NULL) || ((head) == (element))); \ 2425 GNUNET_assert (((element)->prev_ ## mdll != NULL) || ((head) == (element))); \
2426 GNUNET_assert (((element)->next_ ## mdll != NULL) || ((tail) == (element))); \ 2426 GNUNET_assert (((element)->next_ ## mdll != NULL) || ((tail) == (element))); \
2427 if ((element)->prev_ ## mdll == NULL) \ 2427 if ((element)->prev_ ## mdll == NULL) \
2428 (head) = (element)->next_ ## mdll; \ 2428 (head) = (element)->next_ ## mdll; \
2429 else \ 2429 else \
2430 (element)->prev_ ## mdll->next_ ## mdll = (element)->next_ ## mdll; \ 2430 (element)->prev_ ## mdll->next_ ## mdll = (element)->next_ ## mdll; \
2431 if ((element)->next_ ## mdll == NULL) \ 2431 if ((element)->next_ ## mdll == NULL) \
2432 (tail) = (element)->prev_ ## mdll; \ 2432 (tail) = (element)->prev_ ## mdll; \
2433 else \ 2433 else \
2434 (element)->next_ ## mdll->prev_ ## mdll = (element)->prev_ ## mdll; \ 2434 (element)->next_ ## mdll->prev_ ## mdll = (element)->prev_ ## mdll; \
2435 (element)->next_ ## mdll = NULL; \ 2435 (element)->next_ ## mdll = NULL; \
2436 (element)->prev_ ## mdll = NULL; \ 2436 (element)->prev_ ## mdll = NULL; \
2437 } while (0) 2437 } while (0)
@@ -2468,8 +2468,8 @@ GNUNET_CONTAINER_multihashmap32_iterator_destroy (
2468 TYPE *pos; \ 2468 TYPE *pos; \
2469 \ 2469 \
2470 for (pos = head; NULL != pos; pos = pos->next) \ 2470 for (pos = head; NULL != pos; pos = pos->next) \
2471 if (0 < comparator (comparator_cls, element, pos)) \ 2471 if (0 < comparator (comparator_cls, element, pos)) \
2472 break; /* element < pos */ \ 2472 break; /* element < pos */ \
2473 if (NULL == pos) /* => element > tail */ \ 2473 if (NULL == pos) /* => element > tail */ \
2474 { \ 2474 { \
2475 GNUNET_CONTAINER_DLL_insert_tail (head, tail, element); \ 2475 GNUNET_CONTAINER_DLL_insert_tail (head, tail, element); \
diff --git a/src/include/gnunet_curl_lib.h b/src/include/gnunet_curl_lib.h
index 8f744512d..9de58d608 100644
--- a/src/include/gnunet_curl_lib.h
+++ b/src/include/gnunet_curl_lib.h
@@ -262,7 +262,7 @@ GNUNET_CURL_job_add_with_ct_json (struct GNUNET_CURL_Context *ctx,
262 262
263 263
264/** 264/**
265 * Force use of the provided username and password 265 * Force use of the provided username and password
266 * for client authentication for all operations performed 266 * for client authentication for all operations performed
267 * with @a ctx. 267 * with @a ctx.
268 * 268 *
diff --git a/src/include/gnunet_disk_lib.h b/src/include/gnunet_disk_lib.h
index f43cf8943..51ae7d8d5 100644
--- a/src/include/gnunet_disk_lib.h
+++ b/src/include/gnunet_disk_lib.h
@@ -391,33 +391,54 @@ GNUNET_DISK_file_handle_size (struct GNUNET_DISK_FileHandle *fh,
391 391
392 392
393/** 393/**
394 * Flags for #GNUNET_DISK_pipe().
395 */
396enum GNUNET_DISK_PipeFlags
397{
398
399 /**
400 * No special options, use non-blocking read/write operations.
401 */
402 GNUNET_DISK_PF_NONE,
403
404 /**
405 * Configure read end to block when reading if set.
406 */
407 GNUNET_DISK_PF_BLOCKING_READ = 1,
408 /**
409 * Configure write end to block when writing if set.
410 */
411 GNUNET_DISK_PF_BLOCKING_WRITE = 2,
412
413 /**
414 * Configure both pipe ends for blocking operations if set.
415 */
416 GNUNET_DISK_PF_BLOCKING_RW = GNUNET_DISK_PF_BLOCKING_READ
417 | GNUNET_DISK_PF_BLOCKING_WRITE
418
419};
420
421
422/**
394 * Creates an interprocess channel 423 * Creates an interprocess channel
395 * 424 *
396 * @param blocking_read creates an asynchronous pipe for reading if set to #GNUNET_NO 425 * @param pf how to configure the pipe
397 * @param blocking_write creates an asynchronous pipe for writing if set to #GNUNET_NO
398 * @param inherit_read 1 to make read handle inheritable, 0 otherwise (NT only)
399 * @param inherit_write 1 to make write handle inheritable, 0 otherwise (NT only)
400 * @return handle to the new pipe, NULL on error 426 * @return handle to the new pipe, NULL on error
401 */ 427 */
402struct GNUNET_DISK_PipeHandle * 428struct GNUNET_DISK_PipeHandle *
403GNUNET_DISK_pipe (int blocking_read, 429GNUNET_DISK_pipe (enum GNUNET_DISK_PipeFlags pf);
404 int blocking_write,
405 int inherit_read,
406 int inherit_write);
407 430
408 431
409/** 432/**
410 * Creates a pipe object from a couple of file descriptors. 433 * Creates a pipe object from a couple of file descriptors.
411 * Useful for wrapping existing pipe FDs. 434 * Useful for wrapping existing pipe FDs.
412 * 435 *
413 * @param blocking_read creates an asynchronous pipe for reading if set to #GNUNET_NO 436 * @param pf how to configure the pipe
414 * @param blocking_write creates an asynchronous pipe for writing if set to #GNUNET_NO
415 * @param fd an array of two fd values. One of them may be -1 for read-only or write-only pipes 437 * @param fd an array of two fd values. One of them may be -1 for read-only or write-only pipes
416 * @return handle to the new pipe, NULL on error 438 * @return handle to the new pipe, NULL on error
417 */ 439 */
418struct GNUNET_DISK_PipeHandle * 440struct GNUNET_DISK_PipeHandle *
419GNUNET_DISK_pipe_from_fd (int blocking_read, 441GNUNET_DISK_pipe_from_fd (enum GNUNET_DISK_PipeFlags pf,
420 int blocking_write,
421 int fd[2]); 442 int fd[2]);
422 443
423 444
@@ -479,6 +500,7 @@ const struct GNUNET_DISK_FileHandle *
479GNUNET_DISK_pipe_handle (const struct GNUNET_DISK_PipeHandle *p, 500GNUNET_DISK_pipe_handle (const struct GNUNET_DISK_PipeHandle *p,
480 enum GNUNET_DISK_PipeEnd n); 501 enum GNUNET_DISK_PipeEnd n);
481 502
503
482/** 504/**
483 * Update POSIX permissions mask of a file on disk. If both argumets 505 * Update POSIX permissions mask of a file on disk. If both argumets
484 * are #GNUNET_NO, the file is made world-read-write-executable (777). 506 * are #GNUNET_NO, the file is made world-read-write-executable (777).
diff --git a/src/include/gnunet_mq_lib.h b/src/include/gnunet_mq_lib.h
index 520027dbb..37f21e5b1 100644
--- a/src/include/gnunet_mq_lib.h
+++ b/src/include/gnunet_mq_lib.h
@@ -547,7 +547,7 @@ struct GNUNET_MQ_MessageHandler
547 */ 547 */
548#define GNUNET_MQ_hd_fixed_size(name, code, str, ctx) \ 548#define GNUNET_MQ_hd_fixed_size(name, code, str, ctx) \
549 ({ \ 549 ({ \
550 void (*_cb)(void *cls, const str * msg) = &handle_ ## name; \ 550 void (*_cb)(void *cls, const str *msg) = &handle_ ## name; \
551 ((struct GNUNET_MQ_MessageHandler){ NULL, \ 551 ((struct GNUNET_MQ_MessageHandler){ NULL, \
552 (GNUNET_MQ_MessageCallback) _cb, \ 552 (GNUNET_MQ_MessageCallback) _cb, \
553 (ctx), \ 553 (ctx), \
@@ -598,8 +598,8 @@ struct GNUNET_MQ_MessageHandler
598 */ 598 */
599#define GNUNET_MQ_hd_var_size(name, code, str, ctx) \ 599#define GNUNET_MQ_hd_var_size(name, code, str, ctx) \
600 __extension__ ({ \ 600 __extension__ ({ \
601 int (*_mv)(void *cls, const str * msg) = &check_ ## name; \ 601 int (*_mv)(void *cls, const str *msg) = &check_ ## name; \
602 void (*_cb)(void *cls, const str * msg) = &handle_ ## name; \ 602 void (*_cb)(void *cls, const str *msg) = &handle_ ## name; \
603 ((struct GNUNET_MQ_MessageHandler){ (GNUNET_MQ_MessageValidationCallback) \ 603 ((struct GNUNET_MQ_MessageHandler){ (GNUNET_MQ_MessageValidationCallback) \
604 _mv, \ 604 _mv, \
605 (GNUNET_MQ_MessageCallback) _cb, \ 605 (GNUNET_MQ_MessageCallback) _cb, \
diff --git a/src/include/gnunet_reclaim_lib.h b/src/include/gnunet_reclaim_lib.h
index 54d284f3c..4f2d6dba5 100644
--- a/src/include/gnunet_reclaim_lib.h
+++ b/src/include/gnunet_reclaim_lib.h
@@ -80,7 +80,7 @@ static const struct GNUNET_RECLAIM_Identifier GNUNET_RECLAIM_ID_ZERO;
80 memcmp (a, \ 80 memcmp (a, \
81 b, \ 81 b, \
82 sizeof (GNUNET_RECLAIM_ID_ZERO))) \ 82 sizeof (GNUNET_RECLAIM_ID_ZERO))) \
83 ? \ 83 ? \
84 GNUNET_YES : GNUNET_NO) 84 GNUNET_YES : GNUNET_NO)
85 85
86 86
diff --git a/src/include/gnunet_reclaim_plugin.h b/src/include/gnunet_reclaim_plugin.h
index 992ad0cc3..7ee9e730f 100644
--- a/src/include/gnunet_reclaim_plugin.h
+++ b/src/include/gnunet_reclaim_plugin.h
@@ -172,7 +172,9 @@ typedef const char *(*GNUNET_RECLAIM_AttestationNumberToTypenameFunction) (
172 * @param attest the attestation object 172 * @param attest the attestation object
173 * @return an attribute list 173 * @return an attribute list
174 */ 174 */
175typedef struct GNUNET_RECLAIM_AttributeList *(*GNUNET_RECLAIM_AttestationGetAttributesFunction) ( 175typedef struct
176 GNUNET_RECLAIM_AttributeList *(*
177GNUNET_RECLAIM_AttestationGetAttributesFunction) (
176 void *cls, 178 void *cls,
177 const struct GNUNET_RECLAIM_Attestation *attest); 179 const struct GNUNET_RECLAIM_Attestation *attest);
178 180
@@ -201,7 +203,6 @@ typedef int (*GNUNET_RECLAIM_AttestationGetExpirationFunction) (
201 struct GNUNET_TIME_Absolute *expiration); 203 struct GNUNET_TIME_Absolute *expiration);
202 204
203 205
204
205/** 206/**
206 * Each plugin is required to return a pointer to a struct of this 207 * Each plugin is required to return a pointer to a struct of this
207 * type as the return value from its entry point. 208 * type as the return value from its entry point.
@@ -283,7 +284,6 @@ struct GNUNET_RECLAIM_AttestationPluginFunctions
283}; 284};
284 285
285 286
286
287#if 0 /* keep Emacsens' auto-indent happy */ 287#if 0 /* keep Emacsens' auto-indent happy */
288{ 288{
289#endif 289#endif
diff --git a/src/include/gnunet_reclaim_service.h b/src/include/gnunet_reclaim_service.h
index 813bc1a59..139c44ae7 100644
--- a/src/include/gnunet_reclaim_service.h
+++ b/src/include/gnunet_reclaim_service.h
@@ -335,7 +335,8 @@ GNUNET_RECLAIM_get_attestations_start (
335 * @param it the iterator 335 * @param it the iterator
336 */ 336 */
337void 337void
338GNUNET_RECLAIM_get_attestations_next (struct GNUNET_RECLAIM_AttestationIterator *ait); 338GNUNET_RECLAIM_get_attestations_next (struct
339 GNUNET_RECLAIM_AttestationIterator *ait);
339 340
340 341
341/** 342/**
@@ -346,7 +347,8 @@ GNUNET_RECLAIM_get_attestations_next (struct GNUNET_RECLAIM_AttestationIterator
346 * @param it the iterator 347 * @param it the iterator
347 */ 348 */
348void 349void
349GNUNET_RECLAIM_get_attestations_stop (struct GNUNET_RECLAIM_AttestationIterator *ait); 350GNUNET_RECLAIM_get_attestations_stop (struct
351 GNUNET_RECLAIM_AttestationIterator *ait);
350 352
351 353
352/** 354/**
diff --git a/src/include/platform.h b/src/include/platform.h
index baaf26ad6..10248e5bb 100644
--- a/src/include/platform.h
+++ b/src/include/platform.h
@@ -233,8 +233,8 @@ atoll (const char *nptr);
233 233
234 234
235#if defined(__sparc__) 235#if defined(__sparc__)
236#define MAKE_UNALIGNED(val) ({ __typeof__((val))__tmp; memmove (&__tmp, &(val), \ 236#define MAKE_UNALIGNED(val) ({ __typeof__((val)) __tmp; memmove (&__tmp, &(val), \
237 sizeof((val))); \ 237 sizeof((val))); \
238 __tmp; }) 238 __tmp; })
239#else 239#else
240#define MAKE_UNALIGNED(val) val 240#define MAKE_UNALIGNED(val) val
diff --git a/src/json/json_generator.c b/src/json/json_generator.c
index 594fcaf27..3f82a5f17 100644
--- a/src/json/json_generator.c
+++ b/src/json/json_generator.c
@@ -254,7 +254,9 @@ GNUNET_JSON_from_gnsrecord (const char*rname,
254 rel_exp.rel_value_us = rd[i].expiration_time; 254 rel_exp.rel_value_us = rd[i].expiration_time;
255 expiration_time_str = GNUNET_STRINGS_relative_time_to_string (rel_exp, 255 expiration_time_str = GNUNET_STRINGS_relative_time_to_string (rel_exp,
256 GNUNET_NO); 256 GNUNET_NO);
257 } else { 257 }
258 else
259 {
258 abs_exp.abs_value_us = rd[i].expiration_time; 260 abs_exp.abs_value_us = rd[i].expiration_time;
259 expiration_time_str = GNUNET_STRINGS_absolute_time_to_string (abs_exp); 261 expiration_time_str = GNUNET_STRINGS_absolute_time_to_string (abs_exp);
260 } 262 }
diff --git a/src/json/json_gnsrecord.c b/src/json/json_gnsrecord.c
index fe5858f06..7e11aba94 100644
--- a/src/json/json_gnsrecord.c
+++ b/src/json/json_gnsrecord.c
@@ -136,8 +136,8 @@ parse_record (json_t *data, struct GNUNET_GNSRECORD_Data *rd)
136 } 136 }
137 else if ((1 != rel_exp) && 137 else if ((1 != rel_exp) &&
138 (GNUNET_OK == 138 (GNUNET_OK ==
139 GNUNET_STRINGS_fancy_time_to_absolute (expiration_time, 139 GNUNET_STRINGS_fancy_time_to_absolute (expiration_time,
140 &abs_expiration_time))) 140 &abs_expiration_time)))
141 { 141 {
142 rd->expiration_time = abs_expiration_time.abs_value_us; 142 rd->expiration_time = abs_expiration_time.abs_value_us;
143 } 143 }
diff --git a/src/namestore/gnunet-namestore.c b/src/namestore/gnunet-namestore.c
index 704a4abf7..07d045b90 100644
--- a/src/namestore/gnunet-namestore.c
+++ b/src/namestore/gnunet-namestore.c
@@ -1048,7 +1048,8 @@ run_with_zone_pkey (const struct GNUNET_CONFIGURATION_Handle *cfg)
1048 return; 1048 return;
1049 } 1049 }
1050 add = 1; 1050 add = 1;
1051 typestring = GNUNET_strdup (GNUNET_GNSRECORD_number_to_typename (GNUNET_GNSRECORD_TYPE_NICK)); 1051 typestring = GNUNET_strdup (GNUNET_GNSRECORD_number_to_typename (
1052 GNUNET_GNSRECORD_TYPE_NICK));
1052 name = GNUNET_strdup (GNUNET_GNS_EMPTY_LABEL_AT); 1053 name = GNUNET_strdup (GNUNET_GNS_EMPTY_LABEL_AT);
1053 value = GNUNET_strdup (nickstring); 1054 value = GNUNET_strdup (nickstring);
1054 is_public = 0; 1055 is_public = 0;
diff --git a/src/namestore/gnunet-service-namestore.c b/src/namestore/gnunet-service-namestore.c
index ede566d40..bb8138e23 100644
--- a/src/namestore/gnunet-service-namestore.c
+++ b/src/namestore/gnunet-service-namestore.c
@@ -915,7 +915,7 @@ refresh_block (struct NamestoreClient *nc,
915 nick = get_nick_record (zone_key); 915 nick = get_nick_record (zone_key);
916 res_count = rd_count; 916 res_count = rd_count;
917 res = (struct GNUNET_GNSRECORD_Data *) rd; /* fixme: a bit unclean... */ 917 res = (struct GNUNET_GNSRECORD_Data *) rd; /* fixme: a bit unclean... */
918 if (NULL != nick && (0 != strcmp (name, GNUNET_GNS_EMPTY_LABEL_AT))) 918 if ((NULL != nick) && (0 != strcmp (name, GNUNET_GNS_EMPTY_LABEL_AT)))
919 { 919 {
920 nick->flags = 920 nick->flags =
921 (nick->flags | GNUNET_GNSRECORD_RF_PRIVATE) ^ GNUNET_GNSRECORD_RF_PRIVATE; 921 (nick->flags | GNUNET_GNSRECORD_RF_PRIVATE) ^ GNUNET_GNSRECORD_RF_PRIVATE;
diff --git a/src/namestore/plugin_rest_namestore.c b/src/namestore/plugin_rest_namestore.c
index 4a05b2833..f1cbfb38b 100644
--- a/src/namestore/plugin_rest_namestore.c
+++ b/src/namestore/plugin_rest_namestore.c
@@ -536,6 +536,7 @@ namestore_list_iteration (void *cls,
536 GNUNET_NAMESTORE_zone_iterator_next (handle->list_it, 1); 536 GNUNET_NAMESTORE_zone_iterator_next (handle->list_it, 1);
537} 537}
538 538
539
539/** 540/**
540 * Handle lookup error 541 * Handle lookup error
541 * 542 *
@@ -553,10 +554,10 @@ ns_lookup_error_cb (void *cls)
553 554
554static void 555static void
555ns_get_lookup_cb (void *cls, 556ns_get_lookup_cb (void *cls,
556 const struct GNUNET_CRYPTO_EcdsaPrivateKey *zone, 557 const struct GNUNET_CRYPTO_EcdsaPrivateKey *zone,
557 const char *label, 558 const char *label,
558 unsigned int rd_len, 559 unsigned int rd_len,
559 const struct GNUNET_GNSRECORD_Data *rd) 560 const struct GNUNET_GNSRECORD_Data *rd)
560{ 561{
561 struct RequestHandle *handle = cls; 562 struct RequestHandle *handle = cls;
562 struct GNUNET_GNSRECORD_Data rd_filtered[rd_len]; 563 struct GNUNET_GNSRECORD_Data rd_filtered[rd_len];
@@ -588,8 +589,6 @@ ns_get_lookup_cb (void *cls,
588} 589}
589 590
590 591
591
592
593/** 592/**
594 * Handle namestore GET request 593 * Handle namestore GET request
595 * 594 *
@@ -666,12 +665,12 @@ namestore_get (struct GNUNET_REST_RequestHandle *con_handle,
666 } 665 }
667 handle->record_name = GNUNET_strdup (labelname + 1); 666 handle->record_name = GNUNET_strdup (labelname + 1);
668 handle->ns_qe = GNUNET_NAMESTORE_records_lookup (handle->ns_handle, 667 handle->ns_qe = GNUNET_NAMESTORE_records_lookup (handle->ns_handle,
669 handle->zone_pkey, 668 handle->zone_pkey,
670 handle->record_name, 669 handle->record_name,
671 &ns_lookup_error_cb, 670 &ns_lookup_error_cb,
672 handle, 671 handle,
673 &ns_get_lookup_cb, 672 &ns_get_lookup_cb,
674 handle); 673 handle);
675 if (NULL == handle->ns_qe) 674 if (NULL == handle->ns_qe)
676 { 675 {
677 handle->emsg = GNUNET_strdup (GNUNET_REST_NAMESTORE_FAILED); 676 handle->emsg = GNUNET_strdup (GNUNET_REST_NAMESTORE_FAILED);
@@ -681,7 +680,6 @@ namestore_get (struct GNUNET_REST_RequestHandle *con_handle,
681} 680}
682 681
683 682
684
685static void 683static void
686ns_lookup_cb (void *cls, 684ns_lookup_cb (void *cls,
687 const struct GNUNET_CRYPTO_EcdsaPrivateKey *zone, 685 const struct GNUNET_CRYPTO_EcdsaPrivateKey *zone,
@@ -702,12 +700,12 @@ ns_lookup_cb (void *cls,
702 for (j = 0; j < handle->rd_count; j++) 700 for (j = 0; j < handle->rd_count; j++)
703 rd_new[i + j] = handle->rd[j]; 701 rd_new[i + j] = handle->rd[j];
704 handle->ns_qe = GNUNET_NAMESTORE_records_store (handle->ns_handle, 702 handle->ns_qe = GNUNET_NAMESTORE_records_store (handle->ns_handle,
705 handle->zone_pkey, 703 handle->zone_pkey,
706 handle->record_name, 704 handle->record_name,
707 i + j, 705 i + j,
708 rd_new, 706 rd_new,
709 &create_finished, 707 &create_finished,
710 handle); 708 handle);
711 if (NULL == handle->ns_qe) 709 if (NULL == handle->ns_qe)
712 { 710 {
713 handle->emsg = GNUNET_strdup (GNUNET_REST_NAMESTORE_FAILED); 711 handle->emsg = GNUNET_strdup (GNUNET_REST_NAMESTORE_FAILED);
@@ -794,12 +792,12 @@ namestore_add_or_update (struct GNUNET_REST_RequestHandle *con_handle,
794 } 792 }
795 handle->zone_pkey = GNUNET_IDENTITY_ego_get_private_key (ego_entry->ego); 793 handle->zone_pkey = GNUNET_IDENTITY_ego_get_private_key (ego_entry->ego);
796 handle->ns_qe = GNUNET_NAMESTORE_records_lookup (handle->ns_handle, 794 handle->ns_qe = GNUNET_NAMESTORE_records_lookup (handle->ns_handle,
797 handle->zone_pkey, 795 handle->zone_pkey,
798 handle->record_name, 796 handle->record_name,
799 &ns_lookup_error_cb, 797 &ns_lookup_error_cb,
800 handle, 798 handle,
801 &ns_lookup_cb, 799 &ns_lookup_cb,
802 handle); 800 handle);
803 if (NULL == handle->ns_qe) 801 if (NULL == handle->ns_qe)
804 { 802 {
805 handle->emsg = GNUNET_strdup (GNUNET_REST_NAMESTORE_FAILED); 803 handle->emsg = GNUNET_strdup (GNUNET_REST_NAMESTORE_FAILED);
@@ -898,9 +896,9 @@ namestore_delete (struct GNUNET_REST_RequestHandle *con_handle,
898 handle->zone_pkey, 896 handle->zone_pkey,
899 handle->record_name, 897 handle->record_name,
900 0, 898 0,
901 NULL, 899 NULL,
902 &del_finished, 900 &del_finished,
903 handle); 901 handle);
904 if (NULL == handle->ns_qe) 902 if (NULL == handle->ns_qe)
905 { 903 {
906 handle->emsg = GNUNET_strdup (GNUNET_REST_NAMESTORE_FAILED); 904 handle->emsg = GNUNET_strdup (GNUNET_REST_NAMESTORE_FAILED);
diff --git a/src/nat/gnunet-service-nat_helper.c b/src/nat/gnunet-service-nat_helper.c
index 80d3559f3..bd1645d25 100644
--- a/src/nat/gnunet-service-nat_helper.c
+++ b/src/nat/gnunet-service-nat_helper.c
@@ -222,7 +222,7 @@ restart_nat_server (void *cls)
222 return; 222 return;
223 } 223 }
224 h->server_stdout = 224 h->server_stdout =
225 GNUNET_DISK_pipe (GNUNET_YES, GNUNET_YES, GNUNET_NO, GNUNET_YES); 225 GNUNET_DISK_pipe (GNUNET_DISK_PF_BLOCKING_RW);
226 if (NULL == h->server_stdout) 226 if (NULL == h->server_stdout)
227 { 227 {
228 GNUNET_log_strerror (GNUNET_ERROR_TYPE_ERROR, "pipe"); 228 GNUNET_log_strerror (GNUNET_ERROR_TYPE_ERROR, "pipe");
diff --git a/src/nat/gnunet-service-nat_mini.c b/src/nat/gnunet-service-nat_mini.c
index b98255ad2..24f77d9cc 100644
--- a/src/nat/gnunet-service-nat_mini.c
+++ b/src/nat/gnunet-service-nat_mini.c
@@ -192,7 +192,7 @@ GNUNET_NAT_mini_get_external_ipv4_ (GNUNET_NAT_IPCallback cb, void *cb_cls)
192 } 192 }
193 LOG (GNUNET_ERROR_TYPE_DEBUG, 193 LOG (GNUNET_ERROR_TYPE_DEBUG,
194 "Running `external-ip' to determine our external IP\n"); 194 "Running `external-ip' to determine our external IP\n");
195 eh->opipe = GNUNET_DISK_pipe (GNUNET_YES, GNUNET_YES, GNUNET_NO, GNUNET_YES); 195 eh->opipe = GNUNET_DISK_pipe (GNUNET_DISK_PF_BLOCKING_RW);
196 if (NULL == eh->opipe) 196 if (NULL == eh->opipe)
197 { 197 {
198 eh->ret = GNUNET_NAT_ERROR_IPC_FAILURE; 198 eh->ret = GNUNET_NAT_ERROR_IPC_FAILURE;
diff --git a/src/reclaim/gnunet-service-reclaim_tickets.c b/src/reclaim/gnunet-service-reclaim_tickets.c
index f170b6d84..7e6b07514 100644
--- a/src/reclaim/gnunet-service-reclaim_tickets.c
+++ b/src/reclaim/gnunet-service-reclaim_tickets.c
@@ -1292,7 +1292,7 @@ issue_ticket (struct TicketIssueHandle *ih)
1292 for (le = ih->attrs->list_head; NULL != le; le = le->next) 1292 for (le = ih->attrs->list_head; NULL != le; le = le->next)
1293 attrs_count++; 1293 attrs_count++;
1294 1294
1295 //Worst case we have one attestation per attribute 1295 // Worst case we have one attestation per attribute
1296 attrs_record = 1296 attrs_record =
1297 GNUNET_malloc (2 * attrs_count * sizeof(struct GNUNET_GNSRECORD_Data)); 1297 GNUNET_malloc (2 * attrs_count * sizeof(struct GNUNET_GNSRECORD_Data));
1298 i = 0; 1298 i = 0;
diff --git a/src/reclaim/json_reclaim.h b/src/reclaim/json_reclaim.h
index 61ddb4378..c57971dcb 100644
--- a/src/reclaim/json_reclaim.h
+++ b/src/reclaim/json_reclaim.h
@@ -56,4 +56,3 @@ GNUNET_RECLAIM_JSON_spec_ticket (struct GNUNET_RECLAIM_Ticket **ticket);
56struct GNUNET_JSON_Specification 56struct GNUNET_JSON_Specification
57GNUNET_RECLAIM_JSON_spec_claim_attest (struct 57GNUNET_RECLAIM_JSON_spec_claim_attest (struct
58 GNUNET_RECLAIM_Attestation **attr); 58 GNUNET_RECLAIM_Attestation **attr);
59
diff --git a/src/reclaim/plugin_reclaim_attribute_basic.c b/src/reclaim/plugin_reclaim_attribute_basic.c
index 47fdd5f11..286186a93 100644
--- a/src/reclaim/plugin_reclaim_attribute_basic.c
+++ b/src/reclaim/plugin_reclaim_attribute_basic.c
@@ -90,6 +90,7 @@ basic_string_to_value (void *cls,
90 } 90 }
91} 91}
92 92
93
93/** 94/**
94 * Mapping of attribute type numbers to human-readable 95 * Mapping of attribute type numbers to human-readable
95 * attribute type names. 96 * attribute type names.
diff --git a/src/reclaim/plugin_rest_reclaim.c b/src/reclaim/plugin_rest_reclaim.c
index 654df175e..10ee2f801 100644
--- a/src/reclaim/plugin_rest_reclaim.c
+++ b/src/reclaim/plugin_rest_reclaim.c
@@ -576,7 +576,8 @@ attest_collect (void *cls,
576 if (GNUNET_OK == GNUNET_RECLAIM_attestation_get_expiration (attest, 576 if (GNUNET_OK == GNUNET_RECLAIM_attestation_get_expiration (attest,
577 &exp)) 577 &exp))
578 { 578 {
579 json_object_set_new (attest_obj, "expiration", json_integer (exp.abs_value_us)); 579 json_object_set_new (attest_obj, "expiration", json_integer (
580 exp.abs_value_us));
580 } 581 }
581 id_str = GNUNET_STRINGS_data_to_string_alloc (&attest->id, 582 id_str = GNUNET_STRINGS_data_to_string_alloc (&attest->id,
582 sizeof(attest->id)); 583 sizeof(attest->id));
@@ -597,7 +598,7 @@ attest_collect (void *cls,
597 json_object_set_new (attr_obj, "name", json_string ( 598 json_object_set_new (attr_obj, "name", json_string (
598 ale->attribute->name)); 599 ale->attribute->name));
599 600
600 json_object_set_new (attr_obj, "flag", json_string ("1")); //FIXME 601 json_object_set_new (attr_obj, "flag", json_string ("1")); // FIXME
601 type = GNUNET_RECLAIM_attribute_number_to_typename (ale->attribute->type); 602 type = GNUNET_RECLAIM_attribute_number_to_typename (ale->attribute->type);
602 json_object_set_new (attr_obj, "type", json_string (type)); 603 json_object_set_new (attr_obj, "type", json_string (type));
603 json_object_set_new (attr_obj, "id", json_string ("")); 604 json_object_set_new (attr_obj, "id", json_string (""));
diff --git a/src/reclaim/reclaim_attestation.c b/src/reclaim/reclaim_attestation.c
index bdf80a709..1f2b1890b 100644
--- a/src/reclaim/reclaim_attestation.c
+++ b/src/reclaim/reclaim_attestation.c
@@ -552,7 +552,7 @@ GNUNET_RECLAIM_attestation_get_issuer (const struct
552int 552int
553GNUNET_RECLAIM_attestation_get_expiration (const struct 553GNUNET_RECLAIM_attestation_get_expiration (const struct
554 GNUNET_RECLAIM_Attestation *attest, 554 GNUNET_RECLAIM_Attestation *attest,
555 struct GNUNET_TIME_Absolute* exp) 555 struct GNUNET_TIME_Absolute*exp)
556{ 556{
557 unsigned int i; 557 unsigned int i;
558 struct Plugin *plugin; 558 struct Plugin *plugin;
diff --git a/src/reclaim/reclaim_attribute.c b/src/reclaim/reclaim_attribute.c
index 69c5351d3..05bdc1ac6 100644
--- a/src/reclaim/reclaim_attribute.c
+++ b/src/reclaim/reclaim_attribute.c
@@ -230,7 +230,8 @@ GNUNET_RECLAIM_attribute_value_to_string (uint32_t type,
230 */ 230 */
231struct GNUNET_RECLAIM_Attribute * 231struct GNUNET_RECLAIM_Attribute *
232GNUNET_RECLAIM_attribute_new (const char *attr_name, 232GNUNET_RECLAIM_attribute_new (const char *attr_name,
233 const struct GNUNET_RECLAIM_Identifier *attestation, 233 const struct
234 GNUNET_RECLAIM_Identifier *attestation,
234 uint32_t type, 235 uint32_t type,
235 const void *data, 236 const void *data,
236 size_t data_size) 237 size_t data_size)
diff --git a/src/revocation/gnunet-revocation-tvg.c b/src/revocation/gnunet-revocation-tvg.c
index b8f462b28..29df1bb4d 100644
--- a/src/revocation/gnunet-revocation-tvg.c
+++ b/src/revocation/gnunet-revocation-tvg.c
@@ -43,13 +43,14 @@ print_bytes (void *buf,
43 43
44 for (i = 0; i < buf_len; i++) 44 for (i = 0; i < buf_len; i++)
45 { 45 {
46 if ((0 != i) && (0 != fold) && (i%fold == 0)) 46 if ((0 != i) && (0 != fold) && (i % fold == 0))
47 printf("\n"); 47 printf ("\n");
48 printf("%02x", ((unsigned char*)buf)[i]); 48 printf ("%02x", ((unsigned char*) buf)[i]);
49 } 49 }
50 printf("\n"); 50 printf ("\n");
51} 51}
52 52
53
53/** 54/**
54 * Main function that will be run. 55 * Main function that will be run.
55 * 56 *
@@ -73,12 +74,12 @@ run (void *cls,
73 GNUNET_CRYPTO_ecdsa_key_create (&id_priv); 74 GNUNET_CRYPTO_ecdsa_key_create (&id_priv);
74 GNUNET_CRYPTO_ecdsa_key_get_public (&id_priv, 75 GNUNET_CRYPTO_ecdsa_key_get_public (&id_priv,
75 &id_pub); 76 &id_pub);
76 fprintf(stdout, "Zone private key (d, little-endian scalar):\n"); 77 fprintf (stdout, "Zone private key (d, little-endian scalar):\n");
77 print_bytes (&id_priv, sizeof(id_priv), 0); 78 print_bytes (&id_priv, sizeof(id_priv), 0);
78 fprintf(stdout, "\n"); 79 fprintf (stdout, "\n");
79 fprintf(stdout, "Zone public key (zk):\n"); 80 fprintf (stdout, "Zone public key (zk):\n");
80 print_bytes (&id_pub, sizeof(id_pub), 0); 81 print_bytes (&id_pub, sizeof(id_pub), 0);
81 fprintf(stdout, "\n"); 82 fprintf (stdout, "\n");
82 memset (&pow, 0, sizeof (pow)); 83 memset (&pow, 0, sizeof (pow));
83 GNUNET_REVOCATION_pow_init (&id_priv, 84 GNUNET_REVOCATION_pow_init (&id_priv,
84 &pow); 85 &pow);
@@ -99,7 +100,7 @@ run (void *cls,
99 GNUNET_assert (GNUNET_OK == GNUNET_REVOCATION_check_pow (&pow, 100 GNUNET_assert (GNUNET_OK == GNUNET_REVOCATION_check_pow (&pow,
100 TEST_DIFFICULTY, 101 TEST_DIFFICULTY,
101 exp)); 102 exp));
102 fprintf(stdout, "Proof:\n"); 103 fprintf (stdout, "Proof:\n");
103 print_bytes (&pow, 104 print_bytes (&pow,
104 sizeof (pow), 105 sizeof (pow),
105 8); 106 8);
diff --git a/src/revocation/revocation_api.c b/src/revocation/revocation_api.c
index 3815e47b0..e0b195aa9 100644
--- a/src/revocation/revocation_api.c
+++ b/src/revocation/revocation_api.c
@@ -468,9 +468,9 @@ GNUNET_REVOCATION_check_pow (const struct GNUNET_REVOCATION_PowP *pow,
468 /** 468 /**
469 * First, check if PoW set is strictly monotically increasing 469 * First, check if PoW set is strictly monotically increasing
470 */ 470 */
471 for (unsigned int i = 0; i < POW_COUNT-1; i++) 471 for (unsigned int i = 0; i < POW_COUNT - 1; i++)
472 { 472 {
473 if (GNUNET_ntohll (pow->pow[i]) >= GNUNET_ntohll (pow->pow[i+1])) 473 if (GNUNET_ntohll (pow->pow[i]) >= GNUNET_ntohll (pow->pow[i + 1]))
474 return GNUNET_NO; 474 return GNUNET_NO;
475 } 475 }
476 GNUNET_memcpy (&buf[sizeof(uint64_t)], 476 GNUNET_memcpy (&buf[sizeof(uint64_t)],
@@ -592,6 +592,7 @@ GNUNET_REVOCATION_pow_start (struct GNUNET_REVOCATION_PowP *pow,
592 return pc; 592 return pc;
593} 593}
594 594
595
595/** 596/**
596 * Comparison function for quicksort 597 * Comparison function for quicksort
597 * 598 *
@@ -602,9 +603,10 @@ GNUNET_REVOCATION_pow_start (struct GNUNET_REVOCATION_PowP *pow,
602static int 603static int
603cmp_pow_value (const void *a, const void *b) 604cmp_pow_value (const void *a, const void *b)
604{ 605{
605 return ( GNUNET_ntohll(*(uint64_t*)a) - GNUNET_ntohll(*(uint64_t*)b)); 606 return (GNUNET_ntohll (*(uint64_t*) a) - GNUNET_ntohll (*(uint64_t*) b));
606} 607}
607 608
609
608/** 610/**
609 * Calculate a key revocation valid for broadcasting for a number 611 * Calculate a key revocation valid for broadcasting for a number
610 * of epochs. 612 * of epochs.
diff --git a/src/rps/gnunet-rps-profiler.c b/src/rps/gnunet-rps-profiler.c
index af43a0fa1..08d1d2d34 100644
--- a/src/rps/gnunet-rps-profiler.c
+++ b/src/rps/gnunet-rps-profiler.c
@@ -924,10 +924,10 @@ tofile_ (const char *file_name, const char *line)
924 int size; \ 924 int size; \
925 size = GNUNET_snprintf (tmp_buf, sizeof(tmp_buf), __VA_ARGS__); \ 925 size = GNUNET_snprintf (tmp_buf, sizeof(tmp_buf), __VA_ARGS__); \
926 if (0 > size) \ 926 if (0 > size) \
927 GNUNET_log (GNUNET_ERROR_TYPE_WARNING, \ 927 GNUNET_log (GNUNET_ERROR_TYPE_WARNING, \
928 "Failed to create tmp_buf\n"); \ 928 "Failed to create tmp_buf\n"); \
929 else \ 929 else \
930 tofile_ (file_name, tmp_buf); \ 930 tofile_ (file_name, tmp_buf); \
931} while (0); 931} while (0);
932 932
933 933
diff --git a/src/rps/test_rps.c b/src/rps/test_rps.c
index 81cf63c72..a7dc3aa00 100644
--- a/src/rps/test_rps.c
+++ b/src/rps/test_rps.c
@@ -656,10 +656,10 @@ tofile_ (const char *file_name, const char *line)
656 int size; \ 656 int size; \
657 size = GNUNET_snprintf (tmp_buf, sizeof(tmp_buf), __VA_ARGS__); \ 657 size = GNUNET_snprintf (tmp_buf, sizeof(tmp_buf), __VA_ARGS__); \
658 if (0 > size) \ 658 if (0 > size) \
659 GNUNET_log (GNUNET_ERROR_TYPE_WARNING, \ 659 GNUNET_log (GNUNET_ERROR_TYPE_WARNING, \
660 "Failed to create tmp_buf\n"); \ 660 "Failed to create tmp_buf\n"); \
661 else \ 661 else \
662 tofile_ (file_name, tmp_buf); \ 662 tofile_ (file_name, tmp_buf); \
663} while (0); 663} while (0);
664 664
665 665
diff --git a/src/set/gnunet-service-set_intersection.c b/src/set/gnunet-service-set_intersection.c
index 993cead11..9313483bb 100644
--- a/src/set/gnunet-service-set_intersection.c
+++ b/src/set/gnunet-service-set_intersection.c
@@ -868,7 +868,7 @@ process_bf (struct Operation *op)
868 GNUNET_CONTAINER_multihashmap_size (op->state->my_elements)); 868 GNUNET_CONTAINER_multihashmap_size (op->state->my_elements));
869 op->state->full_result_iter 869 op->state->full_result_iter
870 = GNUNET_CONTAINER_multihashmap_iterator_create ( 870 = GNUNET_CONTAINER_multihashmap_iterator_create (
871 op->state->my_elements); 871 op->state->my_elements);
872 send_remaining_elements (op); 872 send_remaining_elements (op);
873 return; 873 return;
874 } 874 }
diff --git a/src/set/gnunet-service-set_union_strata_estimator.c b/src/set/gnunet-service-set_union_strata_estimator.c
index 1101a56a6..97b4a1f98 100644
--- a/src/set/gnunet-service-set_union_strata_estimator.c
+++ b/src/set/gnunet-service-set_union_strata_estimator.c
@@ -149,7 +149,7 @@ strata_estimator_insert (struct StrataEstimator *se,
149 149
150 v = key.key_val; 150 v = key.key_val;
151 /* count trailing '1'-bits of v */ 151 /* count trailing '1'-bits of v */
152 for (i = 0; v &1; v >>= 1, i++) 152 for (i = 0; v & 1; v >>= 1, i++)
153 /* empty */; 153 /* empty */;
154 ibf_insert (se->strata[i], key); 154 ibf_insert (se->strata[i], key);
155} 155}
@@ -170,7 +170,7 @@ strata_estimator_remove (struct StrataEstimator *se,
170 170
171 v = key.key_val; 171 v = key.key_val;
172 /* count trailing '1'-bits of v */ 172 /* count trailing '1'-bits of v */
173 for (i = 0; v &1; v >>= 1, i++) 173 for (i = 0; v & 1; v >>= 1, i++)
174 /* empty */; 174 /* empty */;
175 ibf_remove (se->strata[i], key); 175 ibf_remove (se->strata[i], key);
176} 176}
diff --git a/src/statistics/gnunet-service-statistics.c b/src/statistics/gnunet-service-statistics.c
index be2a49201..31c367e91 100644
--- a/src/statistics/gnunet-service-statistics.c
+++ b/src/statistics/gnunet-service-statistics.c
@@ -290,7 +290,8 @@ save ()
290 msg->flags = 290 msg->flags =
291 htonl (pos->persistent ? GNUNET_STATISTICS_SETFLAG_PERSISTENT : 0); 291 htonl (pos->persistent ? GNUNET_STATISTICS_SETFLAG_PERSISTENT : 0);
292 msg->value = GNUNET_htonll (pos->value); 292 msg->value = GNUNET_htonll (pos->value);
293 if (GNUNET_OK != GNUNET_BIO_write (wh, "statistics-save-msg", msg, size)) 293 if (GNUNET_OK != GNUNET_BIO_write (wh, "statistics-save-msg", msg,
294 size))
294 { 295 {
295 GNUNET_log_strerror_file (GNUNET_ERROR_TYPE_WARNING, "write", fn); 296 GNUNET_log_strerror_file (GNUNET_ERROR_TYPE_WARNING, "write", fn);
296 if (GNUNET_OK != GNUNET_BIO_write_close (wh, NULL)) 297 if (GNUNET_OK != GNUNET_BIO_write_close (wh, NULL))
diff --git a/src/testbed/generate-underlay-topology.c b/src/testbed/generate-underlay-topology.c
index 726bed179..97c3c1e67 100644
--- a/src/testbed/generate-underlay-topology.c
+++ b/src/testbed/generate-underlay-topology.c
@@ -51,12 +51,12 @@
51 __LINE__, \ 51 __LINE__, \
52 sqlite3_errmsg (db)); \ 52 sqlite3_errmsg (db)); \
53 if (msg != NULL) \ 53 if (msg != NULL) \
54 GNUNET_asprintf (msg, \ 54 GNUNET_asprintf (msg, \
55 _ ("`%s' failed at %s:%u with error: %s"), \ 55 _ ("`%s' failed at %s:%u with error: %s"), \
56 cmd, \ 56 cmd, \
57 __FILE__, \ 57 __FILE__, \
58 __LINE__, \ 58 __LINE__, \
59 sqlite3_errmsg (db)); \ 59 sqlite3_errmsg (db)); \
60 } while (0) 60 } while (0)
61 61
62 62
diff --git a/src/testbed/gnunet-daemon-latency-logger.c b/src/testbed/gnunet-daemon-latency-logger.c
index c13750db7..cbc9cfdbf 100644
--- a/src/testbed/gnunet-daemon-latency-logger.c
+++ b/src/testbed/gnunet-daemon-latency-logger.c
@@ -53,8 +53,8 @@
53 "`%s' failed at %s:%d with error: %s\n"), \ 53 "`%s' failed at %s:%d with error: %s\n"), \
54 cmd, __FILE__, __LINE__, sqlite3_errmsg (db)); \ 54 cmd, __FILE__, __LINE__, sqlite3_errmsg (db)); \
55 if (msg != NULL) \ 55 if (msg != NULL) \
56 GNUNET_asprintf (msg, _ ("`%s' failed at %s:%u with error: %s"), cmd, \ 56 GNUNET_asprintf (msg, _ ("`%s' failed at %s:%u with error: %s"), cmd, \
57 __FILE__, __LINE__, sqlite3_errmsg (db)); \ 57 __FILE__, __LINE__, sqlite3_errmsg (db)); \
58 } while (0) 58 } while (0)
59 59
60 60
diff --git a/src/testbed/gnunet-daemon-testbed-underlay.c b/src/testbed/gnunet-daemon-testbed-underlay.c
index 2bff7cdd4..c3b424c9b 100644
--- a/src/testbed/gnunet-daemon-testbed-underlay.c
+++ b/src/testbed/gnunet-daemon-testbed-underlay.c
@@ -57,8 +57,8 @@
57 "`%s' failed at %s:%d with error: %s\n"), \ 57 "`%s' failed at %s:%d with error: %s\n"), \
58 cmd, __FILE__, __LINE__, sqlite3_errmsg (db)); \ 58 cmd, __FILE__, __LINE__, sqlite3_errmsg (db)); \
59 if (msg != NULL) \ 59 if (msg != NULL) \
60 GNUNET_asprintf (msg, _ ("`%s' failed at %s:%u with error: %s"), cmd, \ 60 GNUNET_asprintf (msg, _ ("`%s' failed at %s:%u with error: %s"), cmd, \
61 __FILE__, __LINE__, sqlite3_errmsg (db)); \ 61 __FILE__, __LINE__, sqlite3_errmsg (db)); \
62 } while (0) 62 } while (0)
63 63
64 64
diff --git a/src/testbed/gnunet-helper-testbed.c b/src/testbed/gnunet-helper-testbed.c
index 03be376fe..5d0c3b048 100644
--- a/src/testbed/gnunet-helper-testbed.c
+++ b/src/testbed/gnunet-helper-testbed.c
@@ -587,7 +587,7 @@ main (int argc, char **argv)
587 587
588 status = GNUNET_OK; 588 status = GNUNET_OK;
589 if (NULL == 589 if (NULL ==
590 (sigpipe = GNUNET_DISK_pipe (GNUNET_NO, GNUNET_NO, GNUNET_NO, GNUNET_NO))) 590 (sigpipe = GNUNET_DISK_pipe (GNUNET_DISK_PF_NONE)))
591 { 591 {
592 GNUNET_break (0); 592 GNUNET_break (0);
593 return 1; 593 return 1;
diff --git a/src/testbed/gnunet-service-testbed.h b/src/testbed/gnunet-service-testbed.h
index 03955327c..ae477ccb4 100644
--- a/src/testbed/gnunet-service-testbed.h
+++ b/src/testbed/gnunet-service-testbed.h
@@ -498,7 +498,7 @@ extern char *GST_stats_dir;
498 GNUNET_assert (size <= accommodate_size); \ 498 GNUNET_assert (size <= accommodate_size); \
499 growth_size = size; \ 499 growth_size = size; \
500 while (growth_size <= accommodate_size) \ 500 while (growth_size <= accommodate_size) \
501 growth_size += LIST_GROW_STEP; \ 501 growth_size += LIST_GROW_STEP; \
502 GNUNET_array_grow (ptr, size, growth_size); \ 502 GNUNET_array_grow (ptr, size, growth_size); \
503 GNUNET_assert (size > accommodate_size); \ 503 GNUNET_assert (size > accommodate_size); \
504 } while (0) 504 } while (0)
diff --git a/src/testbed/gnunet_testbed_mpi_spawn.c b/src/testbed/gnunet_testbed_mpi_spawn.c
index 353cc2881..577ffbeba 100644
--- a/src/testbed/gnunet_testbed_mpi_spawn.c
+++ b/src/testbed/gnunet_testbed_mpi_spawn.c
@@ -299,8 +299,7 @@ main (int argc, char *argv[])
299 GNUNET_break (0); 299 GNUNET_break (0);
300 return 1; 300 return 1;
301 } 301 }
302 if (NULL == (sigpipe = GNUNET_DISK_pipe (GNUNET_NO, GNUNET_NO, 302 if (NULL == (sigpipe = GNUNET_DISK_pipe (GNUNET_DISK_PF_NONE)))
303 GNUNET_NO, GNUNET_NO)))
304 { 303 {
305 GNUNET_break (0); 304 GNUNET_break (0);
306 ret = GNUNET_SYSERR; 305 ret = GNUNET_SYSERR;
diff --git a/src/testbed/test_testbed_api.c b/src/testbed/test_testbed_api.c
index dd270df17..49f1d9ae9 100644
--- a/src/testbed/test_testbed_api.c
+++ b/src/testbed/test_testbed_api.c
@@ -163,7 +163,7 @@ do_shutdown (void *cls)
163 if (! (cond)) { \ 163 if (! (cond)) { \
164 GNUNET_break (0); \ 164 GNUNET_break (0); \
165 if (NULL != abort_task) \ 165 if (NULL != abort_task) \
166 GNUNET_SCHEDULER_cancel (abort_task); \ 166 GNUNET_SCHEDULER_cancel (abort_task); \
167 abort_task = NULL; \ 167 abort_task = NULL; \
168 GNUNET_SCHEDULER_add_now (do_shutdown, NULL); \ 168 GNUNET_SCHEDULER_add_now (do_shutdown, NULL); \
169 ret; \ 169 ret; \
diff --git a/src/testbed/test_testbed_api_2peers_1controller.c b/src/testbed/test_testbed_api_2peers_1controller.c
index c854d1ccc..4a8b8a584 100644
--- a/src/testbed/test_testbed_api_2peers_1controller.c
+++ b/src/testbed/test_testbed_api_2peers_1controller.c
@@ -173,7 +173,7 @@ static enum Stage result;
173 if (! (cond)) { \ 173 if (! (cond)) { \
174 GNUNET_break (0); \ 174 GNUNET_break (0); \
175 if (NULL != abort_task) \ 175 if (NULL != abort_task) \
176 GNUNET_SCHEDULER_cancel (abort_task); \ 176 GNUNET_SCHEDULER_cancel (abort_task); \
177 abort_task = NULL; \ 177 abort_task = NULL; \
178 GNUNET_SCHEDULER_add_now (do_shutdown, NULL); \ 178 GNUNET_SCHEDULER_add_now (do_shutdown, NULL); \
179 return; \ 179 return; \
diff --git a/src/testbed/test_testbed_api_controllerlink.c b/src/testbed/test_testbed_api_controllerlink.c
index 16a3f7b91..784407520 100644
--- a/src/testbed/test_testbed_api_controllerlink.c
+++ b/src/testbed/test_testbed_api_controllerlink.c
@@ -298,7 +298,7 @@ static enum Stage result;
298 { \ 298 { \
299 GNUNET_break (0); \ 299 GNUNET_break (0); \
300 if (NULL != abort_task) \ 300 if (NULL != abort_task) \
301 GNUNET_SCHEDULER_cancel (abort_task); \ 301 GNUNET_SCHEDULER_cancel (abort_task); \
302 abort_task = NULL; \ 302 abort_task = NULL; \
303 GNUNET_SCHEDULER_shutdown (); \ 303 GNUNET_SCHEDULER_shutdown (); \
304 return; \ 304 return; \
diff --git a/src/testbed/test_testbed_api_peer_reconfiguration.c b/src/testbed/test_testbed_api_peer_reconfiguration.c
index 91955c13d..22dd46b53 100644
--- a/src/testbed/test_testbed_api_peer_reconfiguration.c
+++ b/src/testbed/test_testbed_api_peer_reconfiguration.c
@@ -77,7 +77,7 @@ enum
77 if (! (cond)) { \ 77 if (! (cond)) { \
78 GNUNET_break (0); \ 78 GNUNET_break (0); \
79 if (NULL != abort_task) \ 79 if (NULL != abort_task) \
80 GNUNET_SCHEDULER_cancel (abort_task); \ 80 GNUNET_SCHEDULER_cancel (abort_task); \
81 abort_task = GNUNET_SCHEDULER_add_now (&do_abort, NULL); \ 81 abort_task = GNUNET_SCHEDULER_add_now (&do_abort, NULL); \
82 ret; \ 82 ret; \
83 } \ 83 } \
diff --git a/src/testbed/test_testbed_api_peers_manage_services.c b/src/testbed/test_testbed_api_peers_manage_services.c
index 6d4f8196a..93b0da550 100644
--- a/src/testbed/test_testbed_api_peers_manage_services.c
+++ b/src/testbed/test_testbed_api_peers_manage_services.c
@@ -92,7 +92,7 @@ enum
92 if (! (cond)) { \ 92 if (! (cond)) { \
93 GNUNET_break (0); \ 93 GNUNET_break (0); \
94 if (NULL != abort_task) \ 94 if (NULL != abort_task) \
95 GNUNET_SCHEDULER_cancel (abort_task); \ 95 GNUNET_SCHEDULER_cancel (abort_task); \
96 abort_task = GNUNET_SCHEDULER_add_now (&do_abort, NULL); \ 96 abort_task = GNUNET_SCHEDULER_add_now (&do_abort, NULL); \
97 ret; \ 97 ret; \
98 } \ 98 } \
diff --git a/src/testbed/test_testbed_api_statistics.c b/src/testbed/test_testbed_api_statistics.c
index dc305d008..4d42cda6a 100644
--- a/src/testbed/test_testbed_api_statistics.c
+++ b/src/testbed/test_testbed_api_statistics.c
@@ -76,7 +76,7 @@ static unsigned int num_seen_peers;
76 if (! (cond)) { \ 76 if (! (cond)) { \
77 GNUNET_break (0); \ 77 GNUNET_break (0); \
78 if (NULL != abort_task) \ 78 if (NULL != abort_task) \
79 GNUNET_SCHEDULER_cancel (abort_task); \ 79 GNUNET_SCHEDULER_cancel (abort_task); \
80 abort_task = GNUNET_SCHEDULER_add_now (&do_abort, NULL); \ 80 abort_task = GNUNET_SCHEDULER_add_now (&do_abort, NULL); \
81 ret; \ 81 ret; \
82 } \ 82 } \
diff --git a/src/testbed/test_testbed_api_test.c b/src/testbed/test_testbed_api_test.c
index d3fec78d9..aefbd340e 100644
--- a/src/testbed/test_testbed_api_test.c
+++ b/src/testbed/test_testbed_api_test.c
@@ -90,10 +90,10 @@ do_shutdown (void *cls)
90 if (! (cond)) { \ 90 if (! (cond)) { \
91 GNUNET_break (0); \ 91 GNUNET_break (0); \
92 if (NULL != abort_task) \ 92 if (NULL != abort_task) \
93 GNUNET_SCHEDULER_cancel (abort_task); \ 93 GNUNET_SCHEDULER_cancel (abort_task); \
94 abort_task = NULL; \ 94 abort_task = NULL; \
95 if (NULL == shutdown_task) \ 95 if (NULL == shutdown_task) \
96 shutdown_task = GNUNET_SCHEDULER_add_now (&do_shutdown, NULL); \ 96 shutdown_task = GNUNET_SCHEDULER_add_now (&do_shutdown, NULL); \
97 return; \ 97 return; \
98 } \ 98 } \
99} while (0) 99} while (0)
diff --git a/src/testbed/testbed_api_hosts.c b/src/testbed/testbed_api_hosts.c
index 152762280..95a6bf76f 100644
--- a/src/testbed/testbed_api_hosts.c
+++ b/src/testbed/testbed_api_hosts.c
@@ -56,7 +56,7 @@
56 do \ 56 do \
57 { \ 57 { \
58 if (cond) \ 58 if (cond) \
59 break; \ 59 break; \
60 LOG (GNUNET_ERROR_TYPE_ERROR, "API violation detected: %s\n", errstr); \ 60 LOG (GNUNET_ERROR_TYPE_ERROR, "API violation detected: %s\n", errstr); \
61 GNUNET_assert (0); \ 61 GNUNET_assert (0); \
62 } while (0) 62 } while (0)
diff --git a/src/transport/gnunet-communicator-tcp.c b/src/transport/gnunet-communicator-tcp.c
index e25cdf139..177b5c26c 100644
--- a/src/transport/gnunet-communicator-tcp.c
+++ b/src/transport/gnunet-communicator-tcp.c
@@ -577,7 +577,6 @@ struct Addresses
577}; 577};
578 578
579 579
580
581/** 580/**
582 * Maximum queue length before we stop reading towards the transport service. 581 * Maximum queue length before we stop reading towards the transport service.
583 */ 582 */
@@ -1203,6 +1202,7 @@ queue_read (void *cls)
1203 queue_finish (queue); 1202 queue_finish (queue);
1204} 1203}
1205 1204
1205
1206/** 1206/**
1207 * Convert a `struct sockaddr_in6 to a `struct sockaddr *` 1207 * Convert a `struct sockaddr_in6 to a `struct sockaddr *`
1208 * 1208 *
@@ -1234,6 +1234,7 @@ tcp_address_to_sockaddr_numeric_v6 (socklen_t *sock_len, struct sockaddr_in6 v6,
1234 return in; 1234 return in;
1235} 1235}
1236 1236
1237
1237/** 1238/**
1238 * Convert a `struct sockaddr_in4 to a `struct sockaddr *` 1239 * Convert a `struct sockaddr_in4 to a `struct sockaddr *`
1239 * 1240 *
@@ -1257,6 +1258,7 @@ tcp_address_to_sockaddr_numeric_v4 (socklen_t *sock_len, struct sockaddr_in v4,
1257 return in; 1258 return in;
1258} 1259}
1259 1260
1261
1260/** 1262/**
1261 * Convert TCP bind specification to a `struct PortOnlyIpv4Ipv6 *` 1263 * Convert TCP bind specification to a `struct PortOnlyIpv4Ipv6 *`
1262 * 1264 *
@@ -1318,6 +1320,7 @@ tcp_address_to_sockaddr_port_only (const char *bindto, unsigned int *port)
1318 return po; 1320 return po;
1319} 1321}
1320 1322
1323
1321/** 1324/**
1322 * This Method extracts the address part of the BINDTO string. 1325 * This Method extracts the address part of the BINDTO string.
1323 * 1326 *
@@ -1344,7 +1347,8 @@ extract_address (const char *bindto)
1344 start++; /* skip over '['*/ 1347 start++; /* skip over '['*/
1345 cp[strlen (cp) - 1] = '\0'; /* eat ']'*/ 1348 cp[strlen (cp) - 1] = '\0'; /* eat ']'*/
1346 } 1349 }
1347 else { 1350 else
1351 {
1348 token = strtok_r (cp, "]", &rest); 1352 token = strtok_r (cp, "]", &rest);
1349 if (strlen (bindto) == strlen (token)) 1353 if (strlen (bindto) == strlen (token))
1350 { 1354 {
@@ -1362,6 +1366,7 @@ extract_address (const char *bindto)
1362 return start; 1366 return start;
1363} 1367}
1364 1368
1369
1365/** 1370/**
1366 * This Method extracts the port part of the BINDTO string. 1371 * This Method extracts the port part of the BINDTO string.
1367 * 1372 *
@@ -1440,6 +1445,7 @@ extract_port (const char *addr_and_port)
1440 return port; 1445 return port;
1441} 1446}
1442 1447
1448
1443/** 1449/**
1444 * Convert TCP bind specification to a `struct sockaddr *` 1450 * Convert TCP bind specification to a `struct sockaddr *`
1445 * 1451 *
@@ -2140,6 +2146,7 @@ queue_read_kx (void *cls)
2140 queue->read_task = GNUNET_SCHEDULER_add_now (&queue_read, queue); 2146 queue->read_task = GNUNET_SCHEDULER_add_now (&queue_read, queue);
2141} 2147}
2142 2148
2149
2143/** 2150/**
2144 * Function called by the transport service to initialize a 2151 * Function called by the transport service to initialize a
2145 * message queue given address information about another peer. 2152 * message queue given address information about another peer.
@@ -2229,6 +2236,7 @@ mq_init (void *cls, const struct GNUNET_PeerIdentity *peer, const char *address)
2229 return GNUNET_OK; 2236 return GNUNET_OK;
2230} 2237}
2231 2238
2239
2232/** 2240/**
2233 * Iterator over all message queues to clean up. 2241 * Iterator over all message queues to clean up.
2234 * 2242 *
@@ -2367,6 +2375,7 @@ nat_address_cb (void *cls,
2367 } 2375 }
2368} 2376}
2369 2377
2378
2370/** 2379/**
2371 * This method launch network interactions for each address we like to bind to. 2380 * This method launch network interactions for each address we like to bind to.
2372 * 2381 *
@@ -2474,7 +2483,7 @@ init_socket (const struct sockaddr *addr,
2474 if (NULL == queue_map) 2483 if (NULL == queue_map)
2475 queue_map = GNUNET_CONTAINER_multipeermap_create (10, GNUNET_NO); 2484 queue_map = GNUNET_CONTAINER_multipeermap_create (10, GNUNET_NO);
2476 2485
2477 if (NULL == ch ) 2486 if (NULL == ch)
2478 ch = GNUNET_TRANSPORT_communicator_connect (cfg, 2487 ch = GNUNET_TRANSPORT_communicator_connect (cfg,
2479 COMMUNICATOR_CONFIG_SECTION, 2488 COMMUNICATOR_CONFIG_SECTION,
2480 COMMUNICATOR_ADDRESS_PREFIX, 2489 COMMUNICATOR_ADDRESS_PREFIX,
@@ -2496,6 +2505,7 @@ init_socket (const struct sockaddr *addr,
2496 2505
2497} 2506}
2498 2507
2508
2499/** 2509/**
2500 * This method reads from the DLL addrs_head to register them at the NAT service. 2510 * This method reads from the DLL addrs_head to register them at the NAT service.
2501 */ 2511 */
@@ -2557,6 +2567,7 @@ nat_register ()
2557 } 2567 }
2558} 2568}
2559 2569
2570
2560/** 2571/**
2561 * This method adds addresses to the DLL, that are later register at the NAT service. 2572 * This method adds addresses to the DLL, that are later register at the NAT service.
2562 */ 2573 */
@@ -2573,6 +2584,7 @@ add_addr (struct sockaddr *in, socklen_t in_len)
2573 addrs_lens++; 2584 addrs_lens++;
2574} 2585}
2575 2586
2587
2576/** 2588/**
2577 * This method is the callback called by the resolver API, and wraps method init_socket. 2589 * This method is the callback called by the resolver API, and wraps method init_socket.
2578 * 2590 *
@@ -2625,6 +2637,7 @@ init_socket_resolv (void *cls,
2625 } 2637 }
2626} 2638}
2627 2639
2640
2628/** 2641/**
2629 * Setup communicator and launch network interactions. 2642 * Setup communicator and launch network interactions.
2630 * 2643 *
diff --git a/src/transport/gnunet-communicator-udp.c b/src/transport/gnunet-communicator-udp.c
index efbbd08a7..03c120cc9 100644
--- a/src/transport/gnunet-communicator-udp.c
+++ b/src/transport/gnunet-communicator-udp.c
@@ -1309,7 +1309,8 @@ handle_ack (void *cls, const struct GNUNET_PeerIdentity *pid, void *value)
1309 "Tell transport we have more acks!\n"); 1309 "Tell transport we have more acks!\n");
1310 GNUNET_TRANSPORT_communicator_mq_update (ch, 1310 GNUNET_TRANSPORT_communicator_mq_update (ch,
1311 receiver->d_qh, 1311 receiver->d_qh,
1312 (allowed - ss->sequence_allowed), 1312 (allowed
1313 - ss->sequence_allowed),
1313 1); 1314 1);
1314 ss->sequence_allowed = allowed; 1315 ss->sequence_allowed = allowed;
1315 /* move ss to head to avoid discarding it anytime soon! */ 1316 /* move ss to head to avoid discarding it anytime soon! */
diff --git a/src/transport/gnunet-communicator-unix.c b/src/transport/gnunet-communicator-unix.c
index 6ea0ea360..d7e18f87a 100644
--- a/src/transport/gnunet-communicator-unix.c
+++ b/src/transport/gnunet-communicator-unix.c
@@ -673,7 +673,8 @@ setup_queue (const struct GNUNET_PeerIdentity *target,
673 queue->qh = GNUNET_TRANSPORT_communicator_mq_add (ch, 673 queue->qh = GNUNET_TRANSPORT_communicator_mq_add (ch,
674 &queue->target, 674 &queue->target,
675 foreign_addr, 675 foreign_addr,
676 UNIX_MTU - sizeof (struct UNIXMessage), 676 UNIX_MTU - sizeof (struct
677 UNIXMessage),
677 GNUNET_TRANSPORT_QUEUE_LENGTH_UNLIMITED, 678 GNUNET_TRANSPORT_QUEUE_LENGTH_UNLIMITED,
678 0, 679 0,
679 GNUNET_NT_LOOPBACK, 680 GNUNET_NT_LOOPBACK,
@@ -799,7 +800,7 @@ select_read_cb (void *cls)
799 /* ensure aligned access */ 800 /* ensure aligned access */
800 memcpy (&al_hdr, currhdr, sizeof(al_hdr)); 801 memcpy (&al_hdr, currhdr, sizeof(al_hdr));
801 if ((tsize < sizeof(struct GNUNET_MessageHeader)) || 802 if ((tsize < sizeof(struct GNUNET_MessageHeader)) ||
802 (tsize != ntohs(al_hdr.size))) 803 (tsize != ntohs (al_hdr.size)))
803 { 804 {
804 GNUNET_break_op (0); 805 GNUNET_break_op (0);
805 return; 806 return;
diff --git a/src/transport/plugin_transport_smtp.c b/src/transport/plugin_transport_smtp.c
index 330023118..f3db4fc5a 100644
--- a/src/transport/plugin_transport_smtp.c
+++ b/src/transport/plugin_transport_smtp.c
@@ -174,9 +174,9 @@ listenAndDistribute (void *unused)
174 goto END; \ 174 goto END; \
175 } \ 175 } \
176 if (core_api->load_monitor != NULL) \ 176 if (core_api->load_monitor != NULL) \
177 GNUNET_network_monitor_notify_transmission (core_api->load_monitor, \ 177 GNUNET_network_monitor_notify_transmission (core_api->load_monitor, \
178 GNUNET_ND_DOWNLOAD, \ 178 GNUNET_ND_DOWNLOAD, \
179 strlen (retl)); \ 179 strlen (retl)); \
180 } while (0) 180 } while (0)
181 181
182 182
diff --git a/src/transport/test_communicator_basic.c b/src/transport/test_communicator_basic.c
index 290167960..45c268684 100644
--- a/src/transport/test_communicator_basic.c
+++ b/src/transport/test_communicator_basic.c
@@ -224,8 +224,8 @@ latency_timeout (void *cls)
224 } 224 }
225 225
226 LOG (GNUNET_ERROR_TYPE_ERROR, 226 LOG (GNUNET_ERROR_TYPE_ERROR,
227 "Latency too high. Test failed. (Phase: %d. Sent: %lu, Received: %lu)\n", 227 "Latency too high. Test failed. (Phase: %d. Sent: %lu, Received: %lu)\n",
228 phase, num_sent, num_received); 228 phase, num_sent, num_received);
229 ret = 2; 229 ret = 2;
230 GNUNET_SCHEDULER_shutdown (); 230 GNUNET_SCHEDULER_shutdown ();
231} 231}
@@ -403,7 +403,7 @@ incoming_message_cb (void *cls,
403 if (0 != strcmp ((char*) cls, cfg_peers_name[NUM_PEERS - 1])) 403 if (0 != strcmp ((char*) cls, cfg_peers_name[NUM_PEERS - 1]))
404 { 404 {
405 LOG (GNUNET_ERROR_TYPE_WARNING, 405 LOG (GNUNET_ERROR_TYPE_WARNING,
406 "unexpected receiver...\n"); 406 "unexpected receiver...\n");
407 return; 407 return;
408 } 408 }
409 /* Reset timeout */ 409 /* Reset timeout */
@@ -422,18 +422,18 @@ incoming_message_cb (void *cls,
422 if (num_received == BURST_PACKETS) 422 if (num_received == BURST_PACKETS)
423 { 423 {
424 LOG (GNUNET_ERROR_TYPE_MESSAGE, 424 LOG (GNUNET_ERROR_TYPE_MESSAGE,
425 "Short size packet test done.\n"); 425 "Short size packet test done.\n");
426 char *goodput = GNUNET_STRINGS_byte_size_fancy ((SHORT_MESSAGE_SIZE 426 char *goodput = GNUNET_STRINGS_byte_size_fancy ((SHORT_MESSAGE_SIZE
427 * num_received * 1000 427 * num_received * 1000
428 * 1000) 428 * 1000)
429 / duration.rel_value_us); 429 / duration.rel_value_us);
430 LOG (GNUNET_ERROR_TYPE_MESSAGE, 430 LOG (GNUNET_ERROR_TYPE_MESSAGE,
431 "%lu/%lu packets in %llu us (%s/s) -- avg latency: %llu us\n", 431 "%lu/%lu packets in %llu us (%s/s) -- avg latency: %llu us\n",
432 (unsigned long) num_received, 432 (unsigned long) num_received,
433 (unsigned long) num_sent, 433 (unsigned long) num_sent,
434 (unsigned long long) duration.rel_value_us, 434 (unsigned long long) duration.rel_value_us,
435 goodput, 435 goodput,
436 (unsigned long long) avg_latency); 436 (unsigned long long) avg_latency);
437 GNUNET_free (goodput); 437 GNUNET_free (goodput);
438 start_long = GNUNET_TIME_absolute_get (); 438 start_long = GNUNET_TIME_absolute_get ();
439 phase = TP_BURST_LONG; 439 phase = TP_BURST_LONG;
@@ -449,7 +449,7 @@ incoming_message_cb (void *cls,
449 if (long_message_size != payload_len) 449 if (long_message_size != payload_len)
450 { 450 {
451 LOG (GNUNET_ERROR_TYPE_WARNING, 451 LOG (GNUNET_ERROR_TYPE_WARNING,
452 "Ignoring packet with wrong length\n"); 452 "Ignoring packet with wrong length\n");
453 return; // Ignore 453 return; // Ignore
454 } 454 }
455 num_received++; 455 num_received++;
@@ -458,19 +458,19 @@ incoming_message_cb (void *cls,
458 if (num_received == BURST_PACKETS) 458 if (num_received == BURST_PACKETS)
459 { 459 {
460 LOG (GNUNET_ERROR_TYPE_MESSAGE, 460 LOG (GNUNET_ERROR_TYPE_MESSAGE,
461 "Long size packet test done.\n"); 461 "Long size packet test done.\n");
462 char *goodput = GNUNET_STRINGS_byte_size_fancy ((long_message_size 462 char *goodput = GNUNET_STRINGS_byte_size_fancy ((long_message_size
463 * num_received * 1000 463 * num_received * 1000
464 * 1000) 464 * 1000)
465 / duration.rel_value_us); 465 / duration.rel_value_us);
466 466
467 LOG (GNUNET_ERROR_TYPE_MESSAGE, 467 LOG (GNUNET_ERROR_TYPE_MESSAGE,
468 "%lu/%lu packets in %llu us (%s/s) -- avg latency: %llu us\n", 468 "%lu/%lu packets in %llu us (%s/s) -- avg latency: %llu us\n",
469 (unsigned long) num_received, 469 (unsigned long) num_received,
470 (unsigned long) num_sent, 470 (unsigned long) num_sent,
471 (unsigned long long) duration.rel_value_us, 471 (unsigned long long) duration.rel_value_us,
472 goodput, 472 goodput,
473 (unsigned long long) avg_latency); 473 (unsigned long long) avg_latency);
474 GNUNET_free (goodput); 474 GNUNET_free (goodput);
475 ack = 0; 475 ack = 0;
476 phase = TP_SIZE_CHECK; 476 phase = TP_SIZE_CHECK;
@@ -493,12 +493,12 @@ incoming_message_cb (void *cls,
493 if (num_received >= (max_size) / 10) 493 if (num_received >= (max_size) / 10)
494 { 494 {
495 LOG (GNUNET_ERROR_TYPE_MESSAGE, 495 LOG (GNUNET_ERROR_TYPE_MESSAGE,
496 "Size packet test done.\n"); 496 "Size packet test done.\n");
497 LOG (GNUNET_ERROR_TYPE_MESSAGE, 497 LOG (GNUNET_ERROR_TYPE_MESSAGE,
498 "%lu/%lu packets -- avg latency: %llu us\n", 498 "%lu/%lu packets -- avg latency: %llu us\n",
499 (unsigned long) num_received, 499 (unsigned long) num_received,
500 (unsigned long) num_sent, 500 (unsigned long) num_sent,
501 (unsigned long long) avg_latency); 501 (unsigned long long) avg_latency);
502 num_received = 0; 502 num_received = 0;
503 num_sent = 0; 503 num_sent = 0;
504 avg_latency = 0; 504 avg_latency = 0;
@@ -511,7 +511,7 @@ incoming_message_cb (void *cls,
511 break; 511 break;
512 } 512 }
513 LOG (GNUNET_ERROR_TYPE_DEBUG, 513 LOG (GNUNET_ERROR_TYPE_DEBUG,
514 "Finished\n"); 514 "Finished\n");
515 GNUNET_SCHEDULER_shutdown (); 515 GNUNET_SCHEDULER_shutdown ();
516 } 516 }
517 break; 517 break;
@@ -640,9 +640,9 @@ main (int argc,
640 &peer_id[i].public_key); 640 &peer_id[i].public_key);
641 GNUNET_free (private_key); 641 GNUNET_free (private_key);
642 LOG (GNUNET_ERROR_TYPE_INFO, 642 LOG (GNUNET_ERROR_TYPE_INFO,
643 "Identity of peer %u is %s\n", 643 "Identity of peer %u is %s\n",
644 i, 644 i,
645 GNUNET_i2s_full (&peer_id[i])); 645 GNUNET_i2s_full (&peer_id[i]));
646 } 646 }
647 LOG (GNUNET_ERROR_TYPE_MESSAGE, "Starting test...\n"); 647 LOG (GNUNET_ERROR_TYPE_MESSAGE, "Starting test...\n");
648 GNUNET_SCHEDULER_run (&run, 648 GNUNET_SCHEDULER_run (&run,
diff --git a/src/transport/transport-testing2.c b/src/transport/transport-testing2.c
index 2a7a1dfcb..772ad9f2d 100644
--- a/src/transport/transport-testing2.c
+++ b/src/transport/transport-testing2.c
@@ -671,8 +671,8 @@ handle_update_queue_message (void *cls,
671 struct GNUNET_TRANSPORT_TESTING_TransportCommunicatorQueue *tc_queue; 671 struct GNUNET_TRANSPORT_TESTING_TransportCommunicatorQueue *tc_queue;
672 672
673 LOG (GNUNET_ERROR_TYPE_DEBUG, 673 LOG (GNUNET_ERROR_TYPE_DEBUG,
674 "Received queue update message for %u with q_len %"PRIu64"\n", 674 "Received queue update message for %u with q_len %" PRIu64 "\n",
675 msg->qid, GNUNET_ntohll(msg->q_len)); 675 msg->qid, GNUNET_ntohll (msg->q_len));
676 tc_queue = tc_h->queue_head; 676 tc_queue = tc_h->queue_head;
677 if (NULL != tc_queue) 677 if (NULL != tc_queue)
678 { 678 {
@@ -947,6 +947,7 @@ shutdown_nat (void *cls)
947 shutdown_process (proc); 947 shutdown_process (proc);
948} 948}
949 949
950
950/** 951/**
951 * @brief Task run at shutdown to kill the resolver process 952 * @brief Task run at shutdown to kill the resolver process
952 * 953 *
@@ -959,6 +960,7 @@ shutdown_resolver (void *cls)
959 shutdown_process (proc); 960 shutdown_process (proc);
960} 961}
961 962
963
962static void 964static void
963resolver_start (struct 965resolver_start (struct
964 GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle *tc_h) 966 GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle *tc_h)
@@ -967,16 +969,17 @@ resolver_start (struct
967 969
968 LOG (GNUNET_ERROR_TYPE_DEBUG, "resolver_start\n"); 970 LOG (GNUNET_ERROR_TYPE_DEBUG, "resolver_start\n");
969 binary = GNUNET_OS_get_libexec_binary_path ("gnunet-service-resolver"); 971 binary = GNUNET_OS_get_libexec_binary_path ("gnunet-service-resolver");
970 tc_h->resolver_proc = GNUNET_OS_start_process (GNUNET_OS_INHERIT_STD_OUT_AND_ERR 972 tc_h->resolver_proc = GNUNET_OS_start_process (
971 | GNUNET_OS_USE_PIPE_CONTROL, 973 GNUNET_OS_INHERIT_STD_OUT_AND_ERR
972 NULL, 974 | GNUNET_OS_USE_PIPE_CONTROL,
973 NULL, 975 NULL,
974 NULL, 976 NULL,
975 binary, 977 NULL,
976 "gnunet-service-resolver", 978 binary,
977 "-c", 979 "gnunet-service-resolver",
978 tc_h->cfg_filename, 980 "-c",
979 NULL); 981 tc_h->cfg_filename,
982 NULL);
980 if (NULL == tc_h->resolver_proc) 983 if (NULL == tc_h->resolver_proc)
981 { 984 {
982 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Failed to start resolver service!"); 985 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Failed to start resolver service!");
@@ -987,6 +990,7 @@ resolver_start (struct
987 990
988} 991}
989 992
993
990/** 994/**
991 * @brief Start NAT 995 * @brief Start NAT
992 * 996 *
diff --git a/src/transport/transport.h b/src/transport/transport.h
index a64ffd5c6..dbae4ecfb 100644
--- a/src/transport/transport.h
+++ b/src/transport/transport.h
@@ -903,7 +903,6 @@ struct GNUNET_TRANSPORT_UpdateQueueMessage
903}; 903};
904 904
905 905
906
907/** 906/**
908 * Remove queue, it is no longer available. 907 * Remove queue, it is no longer available.
909 */ 908 */
diff --git a/src/transport/transport_api2_communication.c b/src/transport/transport_api2_communication.c
index cfa144415..d1e28cc36 100644
--- a/src/transport/transport_api2_communication.c
+++ b/src/transport/transport_api2_communication.c
@@ -420,6 +420,7 @@ send_add_queue (struct GNUNET_TRANSPORT_QueueHandle *qh)
420 GNUNET_MQ_send (qh->ch->mq, env); 420 GNUNET_MQ_send (qh->ch->mq, env);
421} 421}
422 422
423
423/** 424/**
424 * Send message to the transport service about queue @a qh 425 * Send message to the transport service about queue @a qh
425 * updated. 426 * updated.
@@ -446,7 +447,6 @@ send_update_queue (struct GNUNET_TRANSPORT_QueueHandle *qh)
446} 447}
447 448
448 449
449
450/** 450/**
451 * Send message to the transport service about queue @a qh 451 * Send message to the transport service about queue @a qh
452 * being no longer available. 452 * being no longer available.
@@ -1033,7 +1033,6 @@ GNUNET_TRANSPORT_communicator_mq_update (
1033} 1033}
1034 1034
1035 1035
1036
1037/** 1036/**
1038 * Notify transport service that an MQ became unavailable due to a 1037 * Notify transport service that an MQ became unavailable due to a
1039 * disconnect or timeout. 1038 * disconnect or timeout.
diff --git a/src/util/bio.c b/src/util/bio.c
index b27230240..39050bb87 100644
--- a/src/util/bio.c
+++ b/src/util/bio.c
@@ -260,7 +260,7 @@ read_from_buffer (struct GNUNET_BIO_ReadHandle *h,
260 char *result, 260 char *result,
261 size_t len) 261 size_t len)
262{ 262{
263 if (h->size < len || h->size - h->pos < len) 263 if ((h->size < len) || (h->size - h->pos < len))
264 { 264 {
265 GNUNET_asprintf (&h->emsg, 265 GNUNET_asprintf (&h->emsg,
266 _ ("Error while reading `%s' from buffer: %s"), 266 _ ("Error while reading `%s' from buffer: %s"),
@@ -431,6 +431,7 @@ GNUNET_BIO_read_meta_data (struct GNUNET_BIO_ReadHandle *h,
431 return GNUNET_OK; 431 return GNUNET_OK;
432} 432}
433 433
434
434/** 435/**
435 * Read a float. 436 * Read a float.
436 * 437 *
@@ -439,9 +440,9 @@ GNUNET_BIO_read_meta_data (struct GNUNET_BIO_ReadHandle *h,
439 * @param f address of float to read 440 * @param f address of float to read
440 */ 441 */
441int 442int
442GNUNET_BIO_read_float(struct GNUNET_BIO_ReadHandle *h, 443GNUNET_BIO_read_float (struct GNUNET_BIO_ReadHandle *h,
443 const char *what, 444 const char *what,
444 float *f) 445 float *f)
445{ 446{
446 int32_t *i = (int32_t *) f; 447 int32_t *i = (int32_t *) f;
447 return GNUNET_BIO_read_int32 (h, what, i); 448 return GNUNET_BIO_read_int32 (h, what, i);
@@ -456,9 +457,9 @@ GNUNET_BIO_read_float(struct GNUNET_BIO_ReadHandle *h,
456 * @param f address of double to read 457 * @param f address of double to read
457 */ 458 */
458int 459int
459GNUNET_BIO_read_double(struct GNUNET_BIO_ReadHandle *h, 460GNUNET_BIO_read_double (struct GNUNET_BIO_ReadHandle *h,
460 const char *what, 461 const char *what,
461 double *f) 462 double *f)
462{ 463{
463 int64_t *i = (int64_t *) f; 464 int64_t *i = (int64_t *) f;
464 return GNUNET_BIO_read_int64 (h, what, i); 465 return GNUNET_BIO_read_int64 (h, what, i);
@@ -692,7 +693,7 @@ GNUNET_BIO_get_buffer_contents (struct GNUNET_BIO_WriteHandle *h,
692{ 693{
693 if (IO_BUFFER != h->type) 694 if (IO_BUFFER != h->type)
694 return GNUNET_SYSERR; 695 return GNUNET_SYSERR;
695 if (NULL == contents || NULL == size) 696 if ((NULL == contents) || (NULL == size))
696 return GNUNET_SYSERR; 697 return GNUNET_SYSERR;
697 int ret = (NULL != h->emsg) ? GNUNET_SYSERR : GNUNET_OK; 698 int ret = (NULL != h->emsg) ? GNUNET_SYSERR : GNUNET_OK;
698 if (NULL != emsg) 699 if (NULL != emsg)
@@ -897,9 +898,9 @@ GNUNET_BIO_write_meta_data (struct GNUNET_BIO_WriteHandle *h,
897 * @param f float to write 898 * @param f float to write
898 */ 899 */
899int 900int
900GNUNET_BIO_write_float(struct GNUNET_BIO_WriteHandle *h, 901GNUNET_BIO_write_float (struct GNUNET_BIO_WriteHandle *h,
901 const char *what, 902 const char *what,
902 float f) 903 float f)
903{ 904{
904 int32_t i = f; 905 int32_t i = f;
905 return GNUNET_BIO_write_int32 (h, what, i); 906 return GNUNET_BIO_write_int32 (h, what, i);
@@ -914,9 +915,9 @@ GNUNET_BIO_write_float(struct GNUNET_BIO_WriteHandle *h,
914 * @param f double to write 915 * @param f double to write
915 */ 916 */
916int 917int
917GNUNET_BIO_write_double(struct GNUNET_BIO_WriteHandle *h, 918GNUNET_BIO_write_double (struct GNUNET_BIO_WriteHandle *h,
918 const char *what, 919 const char *what,
919 double f) 920 double f)
920{ 921{
921 int64_t i = f; 922 int64_t i = f;
922 return GNUNET_BIO_write_int64 (h, what, i); 923 return GNUNET_BIO_write_int64 (h, what, i);
@@ -1196,7 +1197,7 @@ GNUNET_BIO_read_spec_int64 (const char *what,
1196 * @param f address of float to read 1197 * @param f address of float to read
1197 */ 1198 */
1198struct GNUNET_BIO_ReadSpec 1199struct GNUNET_BIO_ReadSpec
1199GNUNET_BIO_read_spec_float(const char *what, float *f) 1200GNUNET_BIO_read_spec_float (const char *what, float *f)
1200{ 1201{
1201 struct GNUNET_BIO_ReadSpec rs = { 1202 struct GNUNET_BIO_ReadSpec rs = {
1202 .rh = &read_spec_handler_int32, 1203 .rh = &read_spec_handler_int32,
@@ -1216,7 +1217,7 @@ GNUNET_BIO_read_spec_float(const char *what, float *f)
1216 * @param f address of double to read 1217 * @param f address of double to read
1217 */ 1218 */
1218struct GNUNET_BIO_ReadSpec 1219struct GNUNET_BIO_ReadSpec
1219GNUNET_BIO_read_spec_double(const char *what, double *f) 1220GNUNET_BIO_read_spec_double (const char *what, double *f)
1220{ 1221{
1221 struct GNUNET_BIO_ReadSpec rs = { 1222 struct GNUNET_BIO_ReadSpec rs = {
1222 .rh = &read_spec_handler_int64, 1223 .rh = &read_spec_handler_int64,
@@ -1243,7 +1244,7 @@ GNUNET_BIO_read_spec_commit (struct GNUNET_BIO_ReadHandle *h,
1243{ 1244{
1244 int ret = GNUNET_OK; 1245 int ret = GNUNET_OK;
1245 1246
1246 for (size_t i=0; NULL!=rs[i].rh; ++i) 1247 for (size_t i = 0; NULL!=rs[i].rh; ++i)
1247 { 1248 {
1248 ret = rs[i].rh (rs[i].cls, h, rs[i].what, rs[i].target, rs[i].size); 1249 ret = rs[i].rh (rs[i].cls, h, rs[i].what, rs[i].target, rs[i].size);
1249 if (GNUNET_OK != ret) 1250 if (GNUNET_OK != ret)
@@ -1490,7 +1491,7 @@ GNUNET_BIO_write_spec_int64 (const char *what,
1490 * @return the write spec 1491 * @return the write spec
1491 */ 1492 */
1492struct GNUNET_BIO_WriteSpec 1493struct GNUNET_BIO_WriteSpec
1493GNUNET_BIO_write_spec_float(const char *what, float *f) 1494GNUNET_BIO_write_spec_float (const char *what, float *f)
1494{ 1495{
1495 struct GNUNET_BIO_WriteSpec ws = { 1496 struct GNUNET_BIO_WriteSpec ws = {
1496 .wh = &write_spec_handler_int32, 1497 .wh = &write_spec_handler_int32,
@@ -1512,7 +1513,7 @@ GNUNET_BIO_write_spec_float(const char *what, float *f)
1512 * @return the write spec 1513 * @return the write spec
1513 */ 1514 */
1514struct GNUNET_BIO_WriteSpec 1515struct GNUNET_BIO_WriteSpec
1515GNUNET_BIO_write_spec_double(const char *what, double *f) 1516GNUNET_BIO_write_spec_double (const char *what, double *f)
1516{ 1517{
1517 struct GNUNET_BIO_WriteSpec ws = { 1518 struct GNUNET_BIO_WriteSpec ws = {
1518 .wh = &write_spec_handler_int64, 1519 .wh = &write_spec_handler_int64,
@@ -1540,7 +1541,7 @@ GNUNET_BIO_write_spec_commit (struct GNUNET_BIO_WriteHandle *h,
1540{ 1541{
1541 int ret = GNUNET_OK; 1542 int ret = GNUNET_OK;
1542 1543
1543 for (size_t i=0; NULL!=ws[i].wh; ++i) 1544 for (size_t i = 0; NULL!=ws[i].wh; ++i)
1544 { 1545 {
1545 ret = ws[i].wh (ws[i].cls, h, ws[i].what, ws[i].source, ws[i].source_size); 1546 ret = ws[i].wh (ws[i].cls, h, ws[i].what, ws[i].source, ws[i].source_size);
1546 if (GNUNET_OK != ret) 1547 if (GNUNET_OK != ret)
diff --git a/src/util/configuration.c b/src/util/configuration.c
index faee9e3bf..26beacaff 100644
--- a/src/util/configuration.c
+++ b/src/util/configuration.c
@@ -1819,12 +1819,12 @@ GNUNET_CONFIGURATION_load_from (struct GNUNET_CONFIGURATION_Handle *cfg,
1819 * @return a freshly allocated configuration 1819 * @return a freshly allocated configuration
1820 */ 1820 */
1821struct GNUNET_CONFIGURATION_Handle * 1821struct GNUNET_CONFIGURATION_Handle *
1822GNUNET_CONFIGURATION_default(void) 1822GNUNET_CONFIGURATION_default (void)
1823{ 1823{
1824 const struct GNUNET_OS_ProjectData *pd = GNUNET_OS_project_data_get (); 1824 const struct GNUNET_OS_ProjectData *pd = GNUNET_OS_project_data_get ();
1825 const struct GNUNET_OS_ProjectData *dpd = GNUNET_OS_project_data_default (); 1825 const struct GNUNET_OS_ProjectData *dpd = GNUNET_OS_project_data_default ();
1826 1826
1827 GNUNET_OS_init(dpd); 1827 GNUNET_OS_init (dpd);
1828 1828
1829 struct GNUNET_CONFIGURATION_Handle *cfg = GNUNET_CONFIGURATION_create (); 1829 struct GNUNET_CONFIGURATION_Handle *cfg = GNUNET_CONFIGURATION_create ();
1830 const char *xdg = getenv ("XDG_CONFIG_HOME"); 1830 const char *xdg = getenv ("XDG_CONFIG_HOME");
@@ -1835,7 +1835,8 @@ GNUNET_CONFIGURATION_default(void)
1835 else 1835 else
1836 cfgname = GNUNET_strdup (pd->user_config_file); 1836 cfgname = GNUNET_strdup (pd->user_config_file);
1837 1837
1838 if (GNUNET_OK != GNUNET_CONFIGURATION_load (cfg, cfgname)) { 1838 if (GNUNET_OK != GNUNET_CONFIGURATION_load (cfg, cfgname))
1839 {
1839 GNUNET_OS_init (pd); 1840 GNUNET_OS_init (pd);
1840 GNUNET_CONFIGURATION_destroy (cfg); 1841 GNUNET_CONFIGURATION_destroy (cfg);
1841 GNUNET_free (cfgname); 1842 GNUNET_free (cfgname);
diff --git a/src/util/crypto_ecc.c b/src/util/crypto_ecc.c
index e1608ae55..019dbe94e 100644
--- a/src/util/crypto_ecc.c
+++ b/src/util/crypto_ecc.c
@@ -141,7 +141,7 @@ decode_private_ecdsa_key (const struct GNUNET_CRYPTO_EcdsaPrivateKey *priv)
141 int rc; 141 int rc;
142 uint8_t d[32]; 142 uint8_t d[32];
143 143
144 for (size_t i=0; i<32; i++) 144 for (size_t i = 0; i<32; i++)
145 d[i] = priv->d[31 - i]; 145 d[i] = priv->d[31 - i];
146 146
147 rc = gcry_sexp_build (&result, 147 rc = gcry_sexp_build (&result,
@@ -195,7 +195,7 @@ GNUNET_CRYPTO_eddsa_key_get_public (
195 struct GNUNET_CRYPTO_EddsaPublicKey *pub) 195 struct GNUNET_CRYPTO_EddsaPublicKey *pub)
196{ 196{
197 unsigned char pk[crypto_sign_PUBLICKEYBYTES]; 197 unsigned char pk[crypto_sign_PUBLICKEYBYTES];
198 unsigned char sk[crypto_sign_SECRETKEYBYTES]; 198 unsigned char sk[crypto_sign_SECRETKEYBYTES];
199 199
200 BENCHMARK_START (eddsa_key_get_public); 200 BENCHMARK_START (eddsa_key_get_public);
201 GNUNET_assert (0 == crypto_sign_seed_keypair (pk, sk, priv->d)); 201 GNUNET_assert (0 == crypto_sign_seed_keypair (pk, sk, priv->d));
@@ -929,7 +929,7 @@ GNUNET_CRYPTO_ecdsa_private_key_derive (
929 929
930 h = derive_h (&pub, label, context); 930 h = derive_h (&pub, label, context);
931 /* Convert to big endian for libgcrypt */ 931 /* Convert to big endian for libgcrypt */
932 for (size_t i=0; i < 32; i++) 932 for (size_t i = 0; i < 32; i++)
933 dc[i] = priv->d[31 - i]; 933 dc[i] = priv->d[31 - i];
934 GNUNET_CRYPTO_mpi_scan_unsigned (&x, dc, sizeof(dc)); 934 GNUNET_CRYPTO_mpi_scan_unsigned (&x, dc, sizeof(dc));
935 d = gcry_mpi_new (256); 935 d = gcry_mpi_new (256);
@@ -941,9 +941,9 @@ GNUNET_CRYPTO_ecdsa_private_key_derive (
941 ret = GNUNET_new (struct GNUNET_CRYPTO_EcdsaPrivateKey); 941 ret = GNUNET_new (struct GNUNET_CRYPTO_EcdsaPrivateKey);
942 GNUNET_CRYPTO_mpi_print_unsigned (dc, sizeof(dc), d); 942 GNUNET_CRYPTO_mpi_print_unsigned (dc, sizeof(dc), d);
943 /* Convert to big endian for libgcrypt */ 943 /* Convert to big endian for libgcrypt */
944 for (size_t i=0; i < 32; i++) 944 for (size_t i = 0; i < 32; i++)
945 ret->d[i] = dc[31 - i]; 945 ret->d[i] = dc[31 - i];
946 sodium_memzero(dc, sizeof(dc)); 946 sodium_memzero (dc, sizeof(dc));
947 gcry_mpi_release (d); 947 gcry_mpi_release (d);
948 return ret; 948 return ret;
949} 949}
diff --git a/src/util/crypto_hash.c b/src/util/crypto_hash.c
index 622953476..0dbe9dbe8 100644
--- a/src/util/crypto_hash.c
+++ b/src/util/crypto_hash.c
@@ -250,12 +250,13 @@ GNUNET_CRYPTO_hash_to_aes_key (const struct GNUNET_HashCode *hc,
250 */ 250 */
251int 251int
252GNUNET_CRYPTO_hash_get_bit_ltr (const struct GNUNET_HashCode *code, 252GNUNET_CRYPTO_hash_get_bit_ltr (const struct GNUNET_HashCode *code,
253 unsigned int bit) 253 unsigned int bit)
254{ 254{
255 GNUNET_assert (bit < 8 * sizeof(struct GNUNET_HashCode)); 255 GNUNET_assert (bit < 8 * sizeof(struct GNUNET_HashCode));
256 return (((unsigned char *) code)[bit >> 3] & (128 >> (bit & 7))) > 0; 256 return (((unsigned char *) code)[bit >> 3] & (128 >> (bit & 7))) > 0;
257} 257}
258 258
259
259/** 260/**
260 * Obtain a bit from a hashcode. 261 * Obtain a bit from a hashcode.
261 * @param code the GNUNET_CRYPTO_hash to index bit-wise 262 * @param code the GNUNET_CRYPTO_hash to index bit-wise
@@ -272,7 +273,6 @@ GNUNET_CRYPTO_hash_get_bit_rtl (const struct GNUNET_HashCode *code,
272} 273}
273 274
274 275
275
276/** 276/**
277 * Determine how many low order bits match in two 277 * Determine how many low order bits match in two
278 * `struct GNUNET_HashCode`s. i.e. - 010011 and 011111 share 278 * `struct GNUNET_HashCode`s. i.e. - 010011 and 011111 share
diff --git a/src/util/crypto_mpi.c b/src/util/crypto_mpi.c
index 099921611..6df47c7e1 100644
--- a/src/util/crypto_mpi.c
+++ b/src/util/crypto_mpi.c
@@ -157,8 +157,8 @@ GNUNET_CRYPTO_mpi_scan_unsigned (gcry_mpi_t *result,
157 */ 157 */
158void 158void
159GNUNET_CRYPTO_mpi_scan_unsigned_le (gcry_mpi_t *result, 159GNUNET_CRYPTO_mpi_scan_unsigned_le (gcry_mpi_t *result,
160 const void *data, 160 const void *data,
161 size_t size) 161 size_t size)
162{ 162{
163 int rc; 163 int rc;
164 164
diff --git a/src/util/disk.c b/src/util/disk.c
index cdead59d2..6560726ea 100644
--- a/src/util/disk.c
+++ b/src/util/disk.c
@@ -1451,33 +1451,23 @@ GNUNET_DISK_file_sync (const struct GNUNET_DISK_FileHandle *h)
1451/** 1451/**
1452 * Creates an interprocess channel 1452 * Creates an interprocess channel
1453 * 1453 *
1454 * @param blocking_read creates an asynchronous pipe for reading if set to GNUNET_NO 1454 * @param pf how to configure the pipe
1455 * @param blocking_write creates an asynchronous pipe for writing if set to GNUNET_NO
1456 * @param inherit_read inherit the parent processes stdin (only for windows)
1457 * @param inherit_write inherit the parent processes stdout (only for windows)
1458 * @return handle to the new pipe, NULL on error 1455 * @return handle to the new pipe, NULL on error
1459 */ 1456 */
1460struct GNUNET_DISK_PipeHandle * 1457struct GNUNET_DISK_PipeHandle *
1461GNUNET_DISK_pipe (int blocking_read, 1458GNUNET_DISK_pipe (enum GNUNET_DISK_PipeFlags pf)
1462 int blocking_write,
1463 int inherit_read,
1464 int inherit_write)
1465{ 1459{
1466 int fd[2]; 1460 int fd[2];
1467 int ret;
1468 int eno;
1469 1461
1470 (void) inherit_read; 1462 if (-1 == pipe (fd))
1471 (void) inherit_write;
1472 ret = pipe (fd);
1473 if (ret == -1)
1474 { 1463 {
1475 eno = errno; 1464 int eno = errno;
1465
1476 LOG_STRERROR (GNUNET_ERROR_TYPE_ERROR, "pipe"); 1466 LOG_STRERROR (GNUNET_ERROR_TYPE_ERROR, "pipe");
1477 errno = eno; 1467 errno = eno;
1478 return NULL; 1468 return NULL;
1479 } 1469 }
1480 return GNUNET_DISK_pipe_from_fd (blocking_read, blocking_write, fd); 1470 return GNUNET_DISK_pipe_from_fd (pf, fd);
1481} 1471}
1482 1472
1483 1473
@@ -1485,29 +1475,26 @@ GNUNET_DISK_pipe (int blocking_read,
1485 * Creates a pipe object from a couple of file descriptors. 1475 * Creates a pipe object from a couple of file descriptors.
1486 * Useful for wrapping existing pipe FDs. 1476 * Useful for wrapping existing pipe FDs.
1487 * 1477 *
1488 * @param blocking_read creates an asynchronous pipe for reading if set to GNUNET_NO 1478 * @param pf how to configure the pipe
1489 * @param blocking_write creates an asynchronous pipe for writing if set to GNUNET_NO
1490 * @param fd an array of two fd values. One of them may be -1 for read-only or write-only pipes 1479 * @param fd an array of two fd values. One of them may be -1 for read-only or write-only pipes
1491 * 1480 *
1492 * @return handle to the new pipe, NULL on error 1481 * @return handle to the new pipe, NULL on error
1493 */ 1482 */
1494struct GNUNET_DISK_PipeHandle * 1483struct GNUNET_DISK_PipeHandle *
1495GNUNET_DISK_pipe_from_fd (int blocking_read, int blocking_write, int fd[2]) 1484GNUNET_DISK_pipe_from_fd (enum GNUNET_DISK_PipeFlags pf,
1485 int fd[2])
1496{ 1486{
1497 struct GNUNET_DISK_PipeHandle *p; 1487 struct GNUNET_DISK_PipeHandle *p;
1498 1488 int ret = 0;
1499 p = GNUNET_new (struct GNUNET_DISK_PipeHandle);
1500
1501 int ret;
1502 int flags; 1489 int flags;
1503 int eno = 0; /* make gcc happy */ 1490 int eno = 0; /* make gcc happy */
1504 1491
1505 ret = 0; 1492 p = GNUNET_new (struct GNUNET_DISK_PipeHandle);
1506 if (fd[0] >= 0) 1493 if (fd[0] >= 0)
1507 { 1494 {
1508 p->fd[0] = GNUNET_new (struct GNUNET_DISK_FileHandle); 1495 p->fd[0] = GNUNET_new (struct GNUNET_DISK_FileHandle);
1509 p->fd[0]->fd = fd[0]; 1496 p->fd[0]->fd = fd[0];
1510 if (! blocking_read) 1497 if (0 == (GNUNET_DISK_PF_BLOCKING_READ & pf))
1511 { 1498 {
1512 flags = fcntl (fd[0], F_GETFL); 1499 flags = fcntl (fd[0], F_GETFL);
1513 flags |= O_NONBLOCK; 1500 flags |= O_NONBLOCK;
@@ -1530,7 +1517,7 @@ GNUNET_DISK_pipe_from_fd (int blocking_read, int blocking_write, int fd[2])
1530 { 1517 {
1531 p->fd[1] = GNUNET_new (struct GNUNET_DISK_FileHandle); 1518 p->fd[1] = GNUNET_new (struct GNUNET_DISK_FileHandle);
1532 p->fd[1]->fd = fd[1]; 1519 p->fd[1]->fd = fd[1];
1533 if (! blocking_write) 1520 if (0 == (GNUNET_DISK_PF_BLOCKING_WRITE & pf))
1534 { 1521 {
1535 flags = fcntl (fd[1], F_GETFL); 1522 flags = fcntl (fd[1], F_GETFL);
1536 flags |= O_NONBLOCK; 1523 flags |= O_NONBLOCK;
@@ -1562,7 +1549,6 @@ GNUNET_DISK_pipe_from_fd (int blocking_read, int blocking_write, int fd[2])
1562 errno = eno; 1549 errno = eno;
1563 return NULL; 1550 return NULL;
1564 } 1551 }
1565
1566 return p; 1552 return p;
1567} 1553}
1568 1554
@@ -1572,7 +1558,7 @@ GNUNET_DISK_pipe_from_fd (int blocking_read, int blocking_write, int fd[2])
1572 * 1558 *
1573 * @param p pipe to close 1559 * @param p pipe to close
1574 * @param end which end of the pipe to close 1560 * @param end which end of the pipe to close
1575 * @return GNUNET_OK on success, GNUNET_SYSERR otherwise 1561 * @return #GNUNET_OK on success, #GNUNET_SYSERR otherwise
1576 */ 1562 */
1577int 1563int
1578GNUNET_DISK_pipe_close_end (struct GNUNET_DISK_PipeHandle *p, 1564GNUNET_DISK_pipe_close_end (struct GNUNET_DISK_PipeHandle *p,
@@ -1644,7 +1630,7 @@ GNUNET_DISK_pipe_detach_end (struct GNUNET_DISK_PipeHandle *p,
1644 * Closes an interprocess channel 1630 * Closes an interprocess channel
1645 * 1631 *
1646 * @param p pipe to close 1632 * @param p pipe to close
1647 * @return GNUNET_OK on success, GNUNET_SYSERR otherwise 1633 * @return #GNUNET_OK on success, #GNUNET_SYSERR otherwise
1648 */ 1634 */
1649int 1635int
1650GNUNET_DISK_pipe_close (struct GNUNET_DISK_PipeHandle *p) 1636GNUNET_DISK_pipe_close (struct GNUNET_DISK_PipeHandle *p)
diff --git a/src/util/gnunet-qr.c b/src/util/gnunet-qr.c
index 84a3184bc..83b2af2fc 100644
--- a/src/util/gnunet-qr.c
+++ b/src/util/gnunet-qr.c
@@ -31,7 +31,7 @@
31 31
32#define LOG(fmt, ...) \ 32#define LOG(fmt, ...) \
33 if (verbose) \ 33 if (verbose) \
34 printf (fmt, ## __VA_ARGS__) 34 printf (fmt, ## __VA_ARGS__)
35 35
36/** 36/**
37 * Video device to capture from. Sane default for GNU/Linux systems. 37 * Video device to capture from. Sane default for GNU/Linux systems.
@@ -161,10 +161,7 @@ gnunet_uri (void *cls,
161 return; 161 return;
162 } 162 }
163 GNUNET_free (subsystem); 163 GNUNET_free (subsystem);
164 sigpipe = GNUNET_DISK_pipe (GNUNET_NO, 164 sigpipe = GNUNET_DISK_pipe (GNUNET_DISK_PF_NONE);
165 GNUNET_NO,
166 GNUNET_NO,
167 GNUNET_NO);
168 GNUNET_assert (NULL != sigpipe); 165 GNUNET_assert (NULL != sigpipe);
169 rt = GNUNET_SCHEDULER_add_read_file ( 166 rt = GNUNET_SCHEDULER_add_read_file (
170 GNUNET_TIME_UNIT_FOREVER_REL, 167 GNUNET_TIME_UNIT_FOREVER_REL,
diff --git a/src/util/gnunet-uri.c b/src/util/gnunet-uri.c
index f8754a6d1..9443c9120 100644
--- a/src/util/gnunet-uri.c
+++ b/src/util/gnunet-uri.c
@@ -167,7 +167,7 @@ main (int argc, char *const *argv)
167 167
168 if (GNUNET_OK != GNUNET_STRINGS_get_utf8_args (argc, argv, &argc, &argv)) 168 if (GNUNET_OK != GNUNET_STRINGS_get_utf8_args (argc, argv, &argc, &argv))
169 return 2; 169 return 2;
170 sigpipe = GNUNET_DISK_pipe (GNUNET_NO, GNUNET_NO, GNUNET_NO, GNUNET_NO); 170 sigpipe = GNUNET_DISK_pipe (GNUNET_DISK_PF_NONE);
171 GNUNET_assert (sigpipe != NULL); 171 GNUNET_assert (sigpipe != NULL);
172 shc_chld = 172 shc_chld =
173 GNUNET_SIGNAL_handler_install (GNUNET_SIGCHLD, &sighandler_child_death); 173 GNUNET_SIGNAL_handler_install (GNUNET_SIGCHLD, &sighandler_child_death);
diff --git a/src/util/helper.c b/src/util/helper.c
index 7985f2eca..7360b7d4b 100644
--- a/src/util/helper.c
+++ b/src/util/helper.c
@@ -401,9 +401,9 @@ static void
401start_helper (struct GNUNET_HELPER_Handle *h) 401start_helper (struct GNUNET_HELPER_Handle *h)
402{ 402{
403 h->helper_in = 403 h->helper_in =
404 GNUNET_DISK_pipe (GNUNET_YES, GNUNET_YES, GNUNET_YES, GNUNET_NO); 404 GNUNET_DISK_pipe (GNUNET_DISK_PF_BLOCKING_RW);
405 h->helper_out = 405 h->helper_out =
406 GNUNET_DISK_pipe (GNUNET_YES, GNUNET_YES, GNUNET_NO, GNUNET_YES); 406 GNUNET_DISK_pipe (GNUNET_DISK_PF_BLOCKING_RW);
407 if ((h->helper_in == NULL) || (h->helper_out == NULL)) 407 if ((h->helper_in == NULL) || (h->helper_out == NULL))
408 { 408 {
409 /* out of file descriptors? try again later... */ 409 /* out of file descriptors? try again later... */
@@ -423,7 +423,8 @@ start_helper (struct GNUNET_HELPER_Handle *h)
423 h->fh_to_helper = 423 h->fh_to_helper =
424 GNUNET_DISK_pipe_handle (h->helper_in, GNUNET_DISK_PIPE_END_WRITE); 424 GNUNET_DISK_pipe_handle (h->helper_in, GNUNET_DISK_PIPE_END_WRITE);
425 h->helper_proc = GNUNET_OS_start_process_vap (h->with_control_pipe 425 h->helper_proc = GNUNET_OS_start_process_vap (h->with_control_pipe
426 ? GNUNET_OS_INHERIT_STD_ERR | GNUNET_OS_USE_PIPE_CONTROL 426 ? GNUNET_OS_INHERIT_STD_ERR
427 | GNUNET_OS_USE_PIPE_CONTROL
427 : GNUNET_OS_INHERIT_STD_ERR, 428 : GNUNET_OS_INHERIT_STD_ERR,
428 h->helper_in, 429 h->helper_in,
429 h->helper_out, 430 h->helper_out,
diff --git a/src/util/os_priority.c b/src/util/os_priority.c
index 2f86f792f..8d045c72b 100644
--- a/src/util/os_priority.c
+++ b/src/util/os_priority.c
@@ -376,7 +376,7 @@ start_process (enum GNUNET_OS_InheritStdioFlags std_inheritance,
376 struct GNUNET_DISK_PipeHandle *childpipe; 376 struct GNUNET_DISK_PipeHandle *childpipe;
377 int dup_childpipe_read_fd = -1; 377 int dup_childpipe_read_fd = -1;
378 378
379 childpipe = GNUNET_DISK_pipe (GNUNET_NO, GNUNET_NO, GNUNET_YES, GNUNET_NO); 379 childpipe = GNUNET_DISK_pipe (GNUNET_DISK_PF_NONE);
380 if (NULL == childpipe) 380 if (NULL == childpipe)
381 return NULL; 381 return NULL;
382 childpipe_read = 382 childpipe_read =
@@ -1152,7 +1152,7 @@ GNUNET_OS_command_run (GNUNET_OS_LineProcessor proc,
1152 struct GNUNET_DISK_PipeHandle *opipe; 1152 struct GNUNET_DISK_PipeHandle *opipe;
1153 va_list ap; 1153 va_list ap;
1154 1154
1155 opipe = GNUNET_DISK_pipe (GNUNET_YES, GNUNET_YES, GNUNET_NO, GNUNET_YES); 1155 opipe = GNUNET_DISK_pipe (GNUNET_DISK_PF_BLOCKING_RW);
1156 if (NULL == opipe) 1156 if (NULL == opipe)
1157 return NULL; 1157 return NULL;
1158 va_start (ap, binary); 1158 va_start (ap, binary);
diff --git a/src/util/perf_malloc.c b/src/util/perf_malloc.c
index 6582505c8..1c91402da 100644
--- a/src/util/perf_malloc.c
+++ b/src/util/perf_malloc.c
@@ -56,11 +56,11 @@ perf_realloc ()
56 ptr = GNUNET_malloc (i); 56 ptr = GNUNET_malloc (i);
57 memset (ptr, 1, i); 57 memset (ptr, 1, i);
58 ptr = GNUNET_realloc (ptr, i + 5); 58 ptr = GNUNET_realloc (ptr, i + 5);
59 for (size_t j=0;j<i;j++) 59 for (size_t j = 0; j<i; j++)
60 GNUNET_assert (1 == ptr[j]); 60 GNUNET_assert (1 == ptr[j]);
61 memset (ptr, 6, i + 5); 61 memset (ptr, 6, i + 5);
62 ptr = GNUNET_realloc (ptr, i - 5); 62 ptr = GNUNET_realloc (ptr, i - 5);
63 for (size_t j=0;j<i-5;j++) 63 for (size_t j = 0; j<i - 5; j++)
64 GNUNET_assert (6 == ptr[j]); 64 GNUNET_assert (6 == ptr[j]);
65 GNUNET_free (ptr); 65 GNUNET_free (ptr);
66 } 66 }
diff --git a/src/util/perf_scheduler.c b/src/util/perf_scheduler.c
index 3ea76e24c..4d4d0a228 100644
--- a/src/util/perf_scheduler.c
+++ b/src/util/perf_scheduler.c
@@ -94,8 +94,8 @@ main (int argc, char *argv[])
94 GNUNET_YES)); 94 GNUNET_YES));
95 GAUGER ("UTIL", "Scheduler", 95 GAUGER ("UTIL", "Scheduler",
96 tasks / 1024 / (1 96 tasks / 1024 / (1
97 + GNUNET_TIME_absolute_get_duration 97 + GNUNET_TIME_absolute_get_duration
98 (start).rel_value_us / 1000LL), "tasks/ms"); 98 (start).rel_value_us / 1000LL), "tasks/ms");
99 return 0; 99 return 0;
100} 100}
101 101
diff --git a/src/util/scheduler.c b/src/util/scheduler.c
index 93393bd7c..b5ce20254 100644
--- a/src/util/scheduler.c
+++ b/src/util/scheduler.c
@@ -2214,10 +2214,7 @@ GNUNET_SCHEDULER_driver_init (const struct GNUNET_SCHEDULER_Driver *driver)
2214 GNUNET_assert (NULL == shutdown_pipe_handle); 2214 GNUNET_assert (NULL == shutdown_pipe_handle);
2215 /* general set-up */ 2215 /* general set-up */
2216 sh = GNUNET_new (struct GNUNET_SCHEDULER_Handle); 2216 sh = GNUNET_new (struct GNUNET_SCHEDULER_Handle);
2217 shutdown_pipe_handle = GNUNET_DISK_pipe (GNUNET_NO, 2217 shutdown_pipe_handle = GNUNET_DISK_pipe (GNUNET_DISK_PF_NONE);
2218 GNUNET_NO,
2219 GNUNET_NO,
2220 GNUNET_NO);
2221 GNUNET_assert (NULL != shutdown_pipe_handle); 2218 GNUNET_assert (NULL != shutdown_pipe_handle);
2222 pr = GNUNET_DISK_pipe_handle (shutdown_pipe_handle, 2219 pr = GNUNET_DISK_pipe_handle (shutdown_pipe_handle,
2223 GNUNET_DISK_PIPE_END_READ); 2220 GNUNET_DISK_PIPE_END_READ);
diff --git a/src/util/service.c b/src/util/service.c
index 1b80c8d13..e6bbe855f 100644
--- a/src/util/service.c
+++ b/src/util/service.c
@@ -2021,8 +2021,8 @@ GNUNET_SERVICE_run_ (int argc,
2021 sh.disconnect_cb = disconnect_cb; 2021 sh.disconnect_cb = disconnect_cb;
2022 sh.cb_cls = cls; 2022 sh.cb_cls = cls;
2023 sh.handlers = (NULL == pd->agpl_url) 2023 sh.handlers = (NULL == pd->agpl_url)
2024 ? GNUNET_MQ_copy_handlers (handlers) 2024 ? GNUNET_MQ_copy_handlers (handlers)
2025 : GNUNET_MQ_copy_handlers2 (handlers, &return_agpl, NULL); 2025 : GNUNET_MQ_copy_handlers2 (handlers, &return_agpl, NULL);
2026 sh.service_name = service_name; 2026 sh.service_name = service_name;
2027 sh.ret = 0; 2027 sh.ret = 0;
2028 /* setup subsystems */ 2028 /* setup subsystems */
diff --git a/src/util/strings.c b/src/util/strings.c
index 5148d0368..41180dd71 100644
--- a/src/util/strings.c
+++ b/src/util/strings.c
@@ -1985,7 +1985,7 @@ GNUNET_STRINGS_base64_decode (const char *data, size_t len, void **out)
1985 "ignoring CR/LF\n"); \ 1985 "ignoring CR/LF\n"); \
1986 i++; \ 1986 i++; \
1987 if (i >= len) \ 1987 if (i >= len) \
1988 goto END; \ 1988 goto END; \
1989 } 1989 }
1990 1990
1991 GNUNET_assert (len / 3 < SIZE_MAX); 1991 GNUNET_assert (len / 3 < SIZE_MAX);
diff --git a/src/util/test_bio.c b/src/util/test_bio.c
index 0c8453121..f18014719 100644
--- a/src/util/test_bio.c
+++ b/src/util/test_bio.c
@@ -52,14 +52,14 @@ test_normal_rw (void)
52 GNUNET_BIO_write_spec_string ("test-normal-rw-string", TESTSTRING), 52 GNUNET_BIO_write_spec_string ("test-normal-rw-string", TESTSTRING),
53 GNUNET_BIO_write_spec_meta_data ("test-normal-rw-metadata", mdW), 53 GNUNET_BIO_write_spec_meta_data ("test-normal-rw-metadata", mdW),
54 GNUNET_BIO_write_spec_int64 ("test-normal-rw-int64", &wNum), 54 GNUNET_BIO_write_spec_int64 ("test-normal-rw-int64", &wNum),
55 GNUNET_BIO_write_spec_end(), 55 GNUNET_BIO_write_spec_end (),
56 }; 56 };
57 57
58 struct GNUNET_BIO_ReadSpec rs[] = { 58 struct GNUNET_BIO_ReadSpec rs[] = {
59 GNUNET_BIO_read_spec_string ("test-normal-rw-string", &rString, 200), 59 GNUNET_BIO_read_spec_string ("test-normal-rw-string", &rString, 200),
60 GNUNET_BIO_read_spec_meta_data ("test-normal-rw-metadata", &mdR), 60 GNUNET_BIO_read_spec_meta_data ("test-normal-rw-metadata", &mdR),
61 GNUNET_BIO_read_spec_int64 ("test-normal-rw-int64", &rNum), 61 GNUNET_BIO_read_spec_int64 ("test-normal-rw-int64", &rNum),
62 GNUNET_BIO_read_spec_end(), 62 GNUNET_BIO_read_spec_end (),
63 }; 63 };
64 64
65 /* I/O on file */ 65 /* I/O on file */
@@ -73,12 +73,13 @@ test_normal_rw (void)
73 GNUNET_assert (GNUNET_OK == GNUNET_BIO_read_spec_commit (rh, rs)); 73 GNUNET_assert (GNUNET_OK == GNUNET_BIO_read_spec_commit (rh, rs));
74 GNUNET_assert (GNUNET_OK == GNUNET_BIO_read_close (rh, NULL)); 74 GNUNET_assert (GNUNET_OK == GNUNET_BIO_read_close (rh, NULL));
75 GNUNET_assert (0 == strcmp (TESTSTRING, rString)); 75 GNUNET_assert (0 == strcmp (TESTSTRING, rString));
76 GNUNET_assert (GNUNET_YES == GNUNET_CONTAINER_meta_data_test_equal (mdR, mdW)); 76 GNUNET_assert (GNUNET_YES == GNUNET_CONTAINER_meta_data_test_equal (mdR,
77 mdW));
77 GNUNET_assert (wNum == rNum); 78 GNUNET_assert (wNum == rNum);
78 79
79 GNUNET_CONTAINER_meta_data_destroy (mdR); 80 GNUNET_CONTAINER_meta_data_destroy (mdR);
80 GNUNET_assert (GNUNET_OK == GNUNET_DISK_directory_remove (filename)); 81 GNUNET_assert (GNUNET_OK == GNUNET_DISK_directory_remove (filename));
81 GNUNET_free(filename); 82 GNUNET_free (filename);
82 83
83 /* I/O on buffer */ 84 /* I/O on buffer */
84 wh = GNUNET_BIO_write_open_buffer (); 85 wh = GNUNET_BIO_write_open_buffer ();
@@ -96,7 +97,8 @@ test_normal_rw (void)
96 GNUNET_assert (GNUNET_OK == GNUNET_BIO_read_spec_commit (rh, rs)); 97 GNUNET_assert (GNUNET_OK == GNUNET_BIO_read_spec_commit (rh, rs));
97 GNUNET_assert (GNUNET_OK == GNUNET_BIO_read_close (rh, NULL)); 98 GNUNET_assert (GNUNET_OK == GNUNET_BIO_read_close (rh, NULL));
98 GNUNET_assert (0 == strcmp (TESTSTRING, rString)); 99 GNUNET_assert (0 == strcmp (TESTSTRING, rString));
99 GNUNET_assert (GNUNET_YES == GNUNET_CONTAINER_meta_data_test_equal (mdR, mdW)); 100 GNUNET_assert (GNUNET_YES == GNUNET_CONTAINER_meta_data_test_equal (mdR,
101 mdW));
100 GNUNET_assert (wNum == rNum); 102 GNUNET_assert (wNum == rNum);
101 103
102 GNUNET_free (buffer); 104 GNUNET_free (buffer);
@@ -314,7 +316,7 @@ test_fullfile_rw (void)
314 200), 316 200),
315 GNUNET_BIO_read_spec_meta_data ("test-fullfile-rw-metadata", 317 GNUNET_BIO_read_spec_meta_data ("test-fullfile-rw-metadata",
316 &mdR), 318 &mdR),
317 GNUNET_BIO_read_spec_end(), 319 GNUNET_BIO_read_spec_end (),
318 }; 320 };
319 321
320 wh = GNUNET_BIO_write_open_file ("/dev/full"); 322 wh = GNUNET_BIO_write_open_file ("/dev/full");
diff --git a/src/util/test_common_logging_runtime_loglevels.c b/src/util/test_common_logging_runtime_loglevels.c
index ce1cdadd6..79cf9d53a 100644
--- a/src/util/test_common_logging_runtime_loglevels.c
+++ b/src/util/test_common_logging_runtime_loglevels.c
@@ -207,7 +207,7 @@ read_output_line (int phase_from1, int phase_to1, int phase_from2,
207 */ 207 */
208#define LOG_MAX_LINE_LENGTH (17) 208#define LOG_MAX_LINE_LENGTH (17)
209 209
210#define LOG_BUFFER_SIZE LOG_MAX_NUM_LINES * LOG_MAX_LINE_LENGTH 210#define LOG_BUFFER_SIZE LOG_MAX_NUM_LINES *LOG_MAX_LINE_LENGTH
211 211
212static char buf[LOG_BUFFER_SIZE]; 212static char buf[LOG_BUFFER_SIZE];
213 213
@@ -347,8 +347,7 @@ runone ()
347{ 347{
348 const struct GNUNET_DISK_FileHandle *stdout_read_handle; 348 const struct GNUNET_DISK_FileHandle *stdout_read_handle;
349 349
350 pipe_stdout = GNUNET_DISK_pipe (GNUNET_YES, GNUNET_YES, GNUNET_NO, 350 pipe_stdout = GNUNET_DISK_pipe (GNUNET_DISK_PF_BLOCKING_RW);
351 GNUNET_YES);
352 351
353 if (pipe_stdout == NULL) 352 if (pipe_stdout == NULL)
354 { 353 {
diff --git a/src/util/test_container_multihashmap.c b/src/util/test_container_multihashmap.c
index bd9e7af31..f46b9f56e 100644
--- a/src/util/test_container_multihashmap.c
+++ b/src/util/test_container_multihashmap.c
@@ -31,7 +31,7 @@
31 if (m != NULL) GNUNET_CONTAINER_multihashmap_destroy (m); \ 31 if (m != NULL) GNUNET_CONTAINER_multihashmap_destroy (m); \
32 if (NULL != \ 32 if (NULL != \
33 iter) \ 33 iter) \
34 GNUNET_CONTAINER_multihashmap_iterator_destroy (iter); \ 34 GNUNET_CONTAINER_multihashmap_iterator_destroy (iter); \
35 return 1; } 35 return 1; }
36#define CHECK(c) { if (! (c)) ABORT (); } 36#define CHECK(c) { if (! (c)) ABORT (); }
37 37
diff --git a/src/util/test_container_multipeermap.c b/src/util/test_container_multipeermap.c
index 9aeead56c..cb6fc30d2 100644
--- a/src/util/test_container_multipeermap.c
+++ b/src/util/test_container_multipeermap.c
@@ -31,7 +31,7 @@
31 if (NULL != m) GNUNET_CONTAINER_multipeermap_destroy (m); \ 31 if (NULL != m) GNUNET_CONTAINER_multipeermap_destroy (m); \
32 if (NULL != \ 32 if (NULL != \
33 iter) \ 33 iter) \
34 GNUNET_CONTAINER_multipeermap_iterator_destroy (iter); \ 34 GNUNET_CONTAINER_multipeermap_iterator_destroy (iter); \
35 return 1; } 35 return 1; }
36#define CHECK(c) { if (! (c)) ABORT (); } 36#define CHECK(c) { if (! (c)) ABORT (); }
37 37
diff --git a/src/util/test_scheduler.c b/src/util/test_scheduler.c
index 471ca64e5..0e2e7f760 100644
--- a/src/util/test_scheduler.c
+++ b/src/util/test_scheduler.c
@@ -133,7 +133,7 @@ task4 (void *cls)
133 133
134 GNUNET_assert (4 == *ok); 134 GNUNET_assert (4 == *ok);
135 (*ok) = 6; 135 (*ok) = 6;
136 p = GNUNET_DISK_pipe (GNUNET_NO, GNUNET_NO, GNUNET_NO, GNUNET_NO); 136 p = GNUNET_DISK_pipe (GNUNET_DISK_PF_NONE);
137 GNUNET_assert (NULL != p); 137 GNUNET_assert (NULL != p);
138 fds[0] = GNUNET_DISK_pipe_handle (p, GNUNET_DISK_PIPE_END_READ); 138 fds[0] = GNUNET_DISK_pipe_handle (p, GNUNET_DISK_PIPE_END_READ);
139 fds[1] = GNUNET_DISK_pipe_handle (p, GNUNET_DISK_PIPE_END_WRITE); 139 fds[1] = GNUNET_DISK_pipe_handle (p, GNUNET_DISK_PIPE_END_WRITE);