aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/core/gnunet-core.c8
-rw-r--r--src/gns/gnunet-gns-fcfsd.c5
-rw-r--r--src/gns/gnunet-gns-proxy.c28
-rw-r--r--src/hostlist/hostlist-server.c3
-rw-r--r--src/transport/plugin_transport_http_server.c4
-rw-r--r--src/transport/plugin_transport_smtp.c4
6 files changed, 24 insertions, 28 deletions
diff --git a/src/core/gnunet-core.c b/src/core/gnunet-core.c
index 571a2a53d..17b840480 100644
--- a/src/core/gnunet-core.c
+++ b/src/core/gnunet-core.c
@@ -166,6 +166,9 @@ static void
166run (void *cls, char *const *args, const char *cfgfile, 166run (void *cls, char *const *args, const char *cfgfile,
167 const struct GNUNET_CONFIGURATION_Handle *cfg) 167 const struct GNUNET_CONFIGURATION_Handle *cfg)
168{ 168{
169 static const struct GNUNET_CORE_MessageHandler handlers[] = {
170 {NULL, 0, 0}
171 };
169 if (args[0] != NULL) 172 if (args[0] != NULL)
170 { 173 {
171 FPRINTF (stderr, _("Invalid command line argument `%s'\n"), args[0]); 174 FPRINTF (stderr, _("Invalid command line argument `%s'\n"), args[0]);
@@ -175,12 +178,7 @@ run (void *cls, char *const *args, const char *cfgfile,
175 GNUNET_CORE_iterate_peers (cfg, &connected_peer_callback, NULL); 178 GNUNET_CORE_iterate_peers (cfg, &connected_peer_callback, NULL);
176 else 179 else
177 { 180 {
178 const static struct GNUNET_CORE_MessageHandler handlers[] = {
179 {NULL, 0, 0}
180 };
181
182 memset(&my_id, '\0', sizeof (my_id)); 181 memset(&my_id, '\0', sizeof (my_id));
183
184 ch = GNUNET_CORE_connect (cfg, NULL, 182 ch = GNUNET_CORE_connect (cfg, NULL,
185 monitor_notify_startup, 183 monitor_notify_startup,
186 monitor_notify_connect, 184 monitor_notify_connect,
diff --git a/src/gns/gnunet-gns-fcfsd.c b/src/gns/gnunet-gns-fcfsd.c
index 1d69cde17..7ef066957 100644
--- a/src/gns/gnunet-gns-fcfsd.c
+++ b/src/gns/gnunet-gns-fcfsd.c
@@ -771,6 +771,9 @@ request_completed_callback (void *cls,
771} 771}
772 772
773 773
774#define UNSIGNED_MHD_LONG_LONG unsigned MHD_LONG_LONG
775
776
774/** 777/**
775 * Schedule tasks to run MHD server. 778 * Schedule tasks to run MHD server.
776 */ 779 */
@@ -785,7 +788,7 @@ run_httpd ()
785 struct GNUNET_NETWORK_FDSet *wes; 788 struct GNUNET_NETWORK_FDSet *wes;
786 int max; 789 int max;
787 int haveto; 790 int haveto;
788 unsigned MHD_LONG_LONG timeout; 791 UNSIGNED_MHD_LONG_LONG timeout;
789 struct GNUNET_TIME_Relative tv; 792 struct GNUNET_TIME_Relative tv;
790 793
791 FD_ZERO (&rs); 794 FD_ZERO (&rs);
diff --git a/src/gns/gnunet-gns-proxy.c b/src/gns/gnunet-gns-proxy.c
index 2017018c3..bef3c75e0 100644
--- a/src/gns/gnunet-gns-proxy.c
+++ b/src/gns/gnunet-gns-proxy.c
@@ -1074,13 +1074,11 @@ mhd_content_cb (void *cls,
1074 struct ProxyCurlTask *ctask = cls; 1074 struct ProxyCurlTask *ctask = cls;
1075 struct ProxyREMatch *re_match; 1075 struct ProxyREMatch *re_match;
1076 ssize_t copied = 0; 1076 ssize_t copied = 0;
1077 long long int bytes_to_copy = ctask->buffer_write_ptr - ctask->buffer_read_ptr; 1077 size_t bytes_to_copy = ctask->buffer_write_ptr - ctask->buffer_read_ptr;
1078 1078
1079 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 1079 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
1080 "MHD: content cb for %s. To copy: %lld\n", 1080 "MHD: content cb for %s. To copy: %u\n",
1081 ctask->url, bytes_to_copy); 1081 ctask->url, (unsigned int) bytes_to_copy);
1082 GNUNET_assert (bytes_to_copy >= 0);
1083
1084 if ((GNUNET_YES == ctask->download_is_finished) && 1082 if ((GNUNET_YES == ctask->download_is_finished) &&
1085 (GNUNET_NO == ctask->download_error) && 1083 (GNUNET_NO == ctask->download_error) &&
1086 (0 == bytes_to_copy)) 1084 (0 == bytes_to_copy))
@@ -1117,15 +1115,13 @@ mhd_content_cb (void *cls,
1117 "MHD: Processing PP %s\n", 1115 "MHD: Processing PP %s\n",
1118 re_match->hostname); 1116 re_match->hostname);
1119 bytes_to_copy = re_match->start - ctask->buffer_read_ptr; 1117 bytes_to_copy = re_match->start - ctask->buffer_read_ptr;
1120 GNUNET_assert (bytes_to_copy >= 0);
1121
1122 if (bytes_to_copy+copied > max) 1118 if (bytes_to_copy+copied > max)
1123 { 1119 {
1124 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 1120 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
1125 "MHD: buffer in response too small for %d. Using available space (%d). (%s)\n", 1121 "MHD: buffer in response too small for %u. Using available space (%d). (%s)\n",
1126 bytes_to_copy, 1122 (unsigned int) bytes_to_copy,
1127 max, 1123 max,
1128 ctask->url); 1124 ctask->url);
1129 memcpy (buf+copied, ctask->buffer_read_ptr, max-copied); 1125 memcpy (buf+copied, ctask->buffer_read_ptr, max-copied);
1130 ctask->buffer_read_ptr += max-copied; 1126 ctask->buffer_read_ptr += max-copied;
1131 copied = max; 1127 copied = max;
@@ -1135,8 +1131,8 @@ mhd_content_cb (void *cls,
1135 } 1131 }
1136 1132
1137 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 1133 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
1138 "MHD: copying %d bytes to mhd response at offset %d\n", 1134 "MHD: copying %u bytes to mhd response at offset %d\n",
1139 bytes_to_copy, ctask->buffer_read_ptr); 1135 (unsigned int) bytes_to_copy, ctask->buffer_read_ptr);
1140 memcpy (buf+copied, ctask->buffer_read_ptr, bytes_to_copy); 1136 memcpy (buf+copied, ctask->buffer_read_ptr, bytes_to_copy);
1141 copied += bytes_to_copy; 1137 copied += bytes_to_copy;
1142 1138
@@ -1178,12 +1174,10 @@ mhd_content_cb (void *cls,
1178 bytes_to_copy = ctask->buffer_write_ptr - ctask->buffer_read_ptr; 1174 bytes_to_copy = ctask->buffer_write_ptr - ctask->buffer_read_ptr;
1179 1175
1180 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 1176 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
1181 "MHD: copied: %d left: %d, space left in buf: %d\n", 1177 "MHD: copied: %d left: %u, space left in buf: %d\n",
1182 copied, 1178 copied,
1183 bytes_to_copy, (int) (max - copied)); 1179 (unsigned int) bytes_to_copy, (int) (max - copied));
1184 1180
1185 GNUNET_assert (0 <= bytes_to_copy);
1186
1187 if (GNUNET_NO == ctask->download_is_finished) 1181 if (GNUNET_NO == ctask->download_is_finished)
1188 { 1182 {
1189 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 1183 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
diff --git a/src/hostlist/hostlist-server.c b/src/hostlist/hostlist-server.c
index af46110ca..0b82b7d1f 100644
--- a/src/hostlist/hostlist-server.c
+++ b/src/hostlist/hostlist-server.c
@@ -465,6 +465,7 @@ run_daemon (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
465 hostlist_task_v6 = prepare_daemon (daemon_handle); 465 hostlist_task_v6 = prepare_daemon (daemon_handle);
466} 466}
467 467
468#define UNSIGNED_MHD_LONG_LONG unsigned MHD_LONG_LONG
468 469
469/** 470/**
470 * Function that queries MHD's select sets and 471 * Function that queries MHD's select sets and
@@ -481,7 +482,7 @@ prepare_daemon (struct MHD_Daemon *daemon_handle)
481 struct GNUNET_NETWORK_FDSet *wws; 482 struct GNUNET_NETWORK_FDSet *wws;
482 struct GNUNET_NETWORK_FDSet *wes; 483 struct GNUNET_NETWORK_FDSet *wes;
483 int max; 484 int max;
484 unsigned MHD_LONG_LONG timeout; 485 UNSIGNED_MHD_LONG_LONG timeout;
485 int haveto; 486 int haveto;
486 struct GNUNET_TIME_Relative tv; 487 struct GNUNET_TIME_Relative tv;
487 488
diff --git a/src/transport/plugin_transport_http_server.c b/src/transport/plugin_transport_http_server.c
index ea8ef428f..7426dee10 100644
--- a/src/transport/plugin_transport_http_server.c
+++ b/src/transport/plugin_transport_http_server.c
@@ -1633,6 +1633,8 @@ server_v6_run (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
1633} 1633}
1634 1634
1635 1635
1636#define UNSIGNED_MHD_LONG_LONG unsigned MHD_LONG_LONG
1637
1636/** 1638/**
1637 * Function that queries MHD's select sets and 1639 * Function that queries MHD's select sets and
1638 * starts the task waiting for them. 1640 * starts the task waiting for them.
@@ -1654,7 +1656,7 @@ server_schedule (struct HTTP_Server_Plugin *plugin,
1654 struct GNUNET_NETWORK_FDSet *wws; 1656 struct GNUNET_NETWORK_FDSet *wws;
1655 struct GNUNET_NETWORK_FDSet *wes; 1657 struct GNUNET_NETWORK_FDSet *wes;
1656 int max; 1658 int max;
1657 unsigned MHD_LONG_LONG timeout; 1659 UNSIGNED_MHD_LONG_LONG timeout;
1658 static unsigned long long last_timeout = 0; 1660 static unsigned long long last_timeout = 0;
1659 int haveto; 1661 int haveto;
1660 1662
diff --git a/src/transport/plugin_transport_smtp.c b/src/transport/plugin_transport_smtp.c
index 609b11596..c305578e0 100644
--- a/src/transport/plugin_transport_smtp.c
+++ b/src/transport/plugin_transport_smtp.c
@@ -813,9 +813,7 @@ inittransport_smtp (struct GNUNET_CoreAPIForTransport * core)
813 stat_bytesDropped = 813 stat_bytesDropped =
814 stats->create (gettext_noop ("# bytes dropped by SMTP (outgoing)")); 814 stats->create (gettext_noop ("# bytes dropped by SMTP (outgoing)"));
815 } 815 }
816 GNUNET_GC_get_configuration_value_filename (coreAPI->cfg, "SMTP", "PIPE", 816 GNUNET_GC_get_configuration_value_filename (coreAPI->cfg, "SMTP", "PIPE", &pipename);
817 GNUNET_DEFAULT_DAEMON_VAR_DIRECTORY
818 "/smtp-pipe", &pipename);
819 UNLINK (pipename); 817 UNLINK (pipename);
820 if (0 != mkfifo (pipename, S_IWUSR | S_IRUSR | S_IWGRP | S_IWOTH)) 818 if (0 != mkfifo (pipename, S_IWUSR | S_IRUSR | S_IWGRP | S_IWOTH))
821 { 819 {