diff options
Diffstat (limited to 'src/transport')
-rw-r--r-- | src/transport/gnunet-service-transport_validation.c | 2 | ||||
-rw-r--r-- | src/transport/gnunet-transport-profiler.c | 2 | ||||
-rw-r--r-- | src/transport/plugin_transport_http_client.c | 4 | ||||
-rw-r--r-- | src/transport/plugin_transport_http_server.c | 2 | ||||
-rw-r--r-- | src/transport/plugin_transport_tcp.c | 61 | ||||
-rw-r--r-- | src/transport/plugin_transport_udp.c | 2 | ||||
-rw-r--r-- | src/transport/plugin_transport_wlan.c | 2 | ||||
-rw-r--r-- | src/transport/tcp_connection_legacy.c | 23 | ||||
-rw-r--r-- | src/transport/tcp_server_legacy.c | 8 | ||||
-rw-r--r-- | src/transport/tcp_server_mst_legacy.c | 4 | ||||
-rw-r--r-- | src/transport/tcp_service_legacy.c | 72 | ||||
-rw-r--r-- | src/transport/test_transport_api_reliability.c | 2 | ||||
-rw-r--r-- | src/transport/transport_api_address_to_string.c | 6 | ||||
-rw-r--r-- | src/transport/transport_api_core.c | 2 |
14 files changed, 122 insertions, 70 deletions
diff --git a/src/transport/gnunet-service-transport_validation.c b/src/transport/gnunet-service-transport_validation.c index 505626b59..4a6d427be 100644 --- a/src/transport/gnunet-service-transport_validation.c +++ b/src/transport/gnunet-service-transport_validation.c | |||
@@ -599,7 +599,7 @@ transmit_ping_if_allowed (void *cls, | |||
599 | ping.challenge = htonl (ve->challenge); | 599 | ping.challenge = htonl (ve->challenge); |
600 | ping.target = *pid; | 600 | ping.target = *pid; |
601 | 601 | ||
602 | if (tsize >= GNUNET_SERVER_MAX_MESSAGE_SIZE) | 602 | if (tsize >= GNUNET_MAX_MESSAGE_SIZE) |
603 | { | 603 | { |
604 | GNUNET_break (0); | 604 | GNUNET_break (0); |
605 | hsize = 0; | 605 | hsize = 0; |
diff --git a/src/transport/gnunet-transport-profiler.c b/src/transport/gnunet-transport-profiler.c index bd4d3072b..9292c42d4 100644 --- a/src/transport/gnunet-transport-profiler.c +++ b/src/transport/gnunet-transport-profiler.c | |||
@@ -520,7 +520,7 @@ run (void *cls, | |||
520 | cfg = (struct GNUNET_CONFIGURATION_Handle *) mycfg; | 520 | cfg = (struct GNUNET_CONFIGURATION_Handle *) mycfg; |
521 | 521 | ||
522 | ret = 1; | 522 | ret = 1; |
523 | if (GNUNET_SERVER_MAX_MESSAGE_SIZE <= benchmark_size) | 523 | if (GNUNET_MAX_MESSAGE_SIZE <= benchmark_size) |
524 | { | 524 | { |
525 | FPRINTF (stderr, | 525 | FPRINTF (stderr, |
526 | "Message size too big!\n"); | 526 | "Message size too big!\n"); |
diff --git a/src/transport/plugin_transport_http_client.c b/src/transport/plugin_transport_http_client.c index e91149289..e20948c5a 100644 --- a/src/transport/plugin_transport_http_client.c +++ b/src/transport/plugin_transport_http_client.c | |||
@@ -1638,7 +1638,7 @@ client_connect_get (struct GNUNET_ATS_Session *s) | |||
1638 | CURLOPT_CONNECTTIMEOUT_MS, | 1638 | CURLOPT_CONNECTTIMEOUT_MS, |
1639 | (long) (HTTP_CLIENT_NOT_VALIDATED_TIMEOUT.rel_value_us / 1000LL)); | 1639 | (long) (HTTP_CLIENT_NOT_VALIDATED_TIMEOUT.rel_value_us / 1000LL)); |
1640 | curl_easy_setopt (s->get.easyhandle, CURLOPT_BUFFERSIZE, | 1640 | curl_easy_setopt (s->get.easyhandle, CURLOPT_BUFFERSIZE, |
1641 | 2 * GNUNET_SERVER_MAX_MESSAGE_SIZE); | 1641 | 2 * GNUNET_MAX_MESSAGE_SIZE); |
1642 | #if CURL_TCP_NODELAY | 1642 | #if CURL_TCP_NODELAY |
1643 | curl_easy_setopt (ps->recv_endpoint, | 1643 | curl_easy_setopt (ps->recv_endpoint, |
1644 | CURLOPT_TCP_NODELAY, | 1644 | CURLOPT_TCP_NODELAY, |
@@ -1815,7 +1815,7 @@ client_connect_put (struct GNUNET_ATS_Session *s) | |||
1815 | CURLOPT_CONNECTTIMEOUT_MS, | 1815 | CURLOPT_CONNECTTIMEOUT_MS, |
1816 | (long) (HTTP_CLIENT_NOT_VALIDATED_TIMEOUT.rel_value_us / 1000LL)); | 1816 | (long) (HTTP_CLIENT_NOT_VALIDATED_TIMEOUT.rel_value_us / 1000LL)); |
1817 | curl_easy_setopt (s->put.easyhandle, CURLOPT_BUFFERSIZE, | 1817 | curl_easy_setopt (s->put.easyhandle, CURLOPT_BUFFERSIZE, |
1818 | 2 * GNUNET_SERVER_MAX_MESSAGE_SIZE); | 1818 | 2 * GNUNET_MAX_MESSAGE_SIZE); |
1819 | #if CURL_TCP_NODELAY | 1819 | #if CURL_TCP_NODELAY |
1820 | curl_easy_setopt (s->put.easyhandle, CURLOPT_TCP_NODELAY, 1); | 1820 | curl_easy_setopt (s->put.easyhandle, CURLOPT_TCP_NODELAY, 1); |
1821 | #endif | 1821 | #endif |
diff --git a/src/transport/plugin_transport_http_server.c b/src/transport/plugin_transport_http_server.c index 2d6f40d58..ff2d68602 100644 --- a/src/transport/plugin_transport_http_server.c +++ b/src/transport/plugin_transport_http_server.c | |||
@@ -2224,7 +2224,7 @@ run_mhd_start_daemon (struct HTTP_Server_Plugin *plugin, | |||
2224 | timeout, | 2224 | timeout, |
2225 | MHD_OPTION_CONNECTION_MEMORY_LIMIT, | 2225 | MHD_OPTION_CONNECTION_MEMORY_LIMIT, |
2226 | (size_t) (2 * | 2226 | (size_t) (2 * |
2227 | GNUNET_SERVER_MAX_MESSAGE_SIZE), | 2227 | GNUNET_MAX_MESSAGE_SIZE), |
2228 | MHD_OPTION_NOTIFY_COMPLETED, | 2228 | MHD_OPTION_NOTIFY_COMPLETED, |
2229 | &server_disconnect_cb, plugin, | 2229 | &server_disconnect_cb, plugin, |
2230 | MHD_OPTION_EXTERNAL_LOGGER, | 2230 | MHD_OPTION_EXTERNAL_LOGGER, |
diff --git a/src/transport/plugin_transport_tcp.c b/src/transport/plugin_transport_tcp.c index 10ea01cec..a63013caa 100644 --- a/src/transport/plugin_transport_tcp.c +++ b/src/transport/plugin_transport_tcp.c | |||
@@ -71,6 +71,21 @@ struct GNUNET_SERVER_TransmitHandle; | |||
71 | */ | 71 | */ |
72 | struct GNUNET_CONNECTION_Handle; | 72 | struct GNUNET_CONNECTION_Handle; |
73 | 73 | ||
74 | /** | ||
75 | * @brief handle for a network service | ||
76 | */ | ||
77 | struct LEGACY_SERVICE_Context; | ||
78 | |||
79 | |||
80 | /** | ||
81 | * Stops a service that was started with #GNUNET_SERVICE_start(). | ||
82 | * | ||
83 | * @param srv service to stop | ||
84 | */ | ||
85 | void | ||
86 | LEGACY_SERVICE_stop (struct LEGACY_SERVICE_Context *srv); | ||
87 | |||
88 | |||
74 | 89 | ||
75 | /** | 90 | /** |
76 | * Function called to notify a client about the connection begin ready | 91 | * Function called to notify a client about the connection begin ready |
@@ -269,6 +284,34 @@ struct GNUNET_SERVER_MessageHandler | |||
269 | 284 | ||
270 | }; | 285 | }; |
271 | 286 | ||
287 | |||
288 | /** | ||
289 | * Options for the service (bitmask). | ||
290 | */ | ||
291 | enum LEGACY_SERVICE_Options | ||
292 | { | ||
293 | /** | ||
294 | * Use defaults. Terminates all client connections and the listen | ||
295 | * sockets immediately upon receiving the shutdown signal. | ||
296 | */ | ||
297 | LEGACY_SERVICE_OPTION_NONE = 0, | ||
298 | |||
299 | /** | ||
300 | * Do not trigger server shutdown on signal at all; instead, allow | ||
301 | * for the user to terminate the server explicitly when needed | ||
302 | * by calling #LEGACY_SERVICE_shutdown(). | ||
303 | */ | ||
304 | LEGACY_SERVICE_OPTION_MANUAL_SHUTDOWN = 1, | ||
305 | |||
306 | /** | ||
307 | * Trigger a SOFT server shutdown on signals, allowing active | ||
308 | * non-monitor clients to complete their transactions. | ||
309 | */ | ||
310 | LEGACY_SERVICE_OPTION_SOFT_SHUTDOWN = 2 | ||
311 | }; | ||
312 | |||
313 | |||
314 | |||
272 | /** | 315 | /** |
273 | * Ask the server to disconnect from the given client. This is the | 316 | * Ask the server to disconnect from the given client. This is the |
274 | * same as passing #GNUNET_SYSERR to #GNUNET_SERVER_receive_done, | 317 | * same as passing #GNUNET_SYSERR to #GNUNET_SERVER_receive_done, |
@@ -453,7 +496,7 @@ GNUNET_SERVER_client_drop (struct GNUNET_SERVER_Client *client); | |||
453 | * @param cfg configuration to use | 496 | * @param cfg configuration to use |
454 | */ | 497 | */ |
455 | typedef void | 498 | typedef void |
456 | (*GNUNET_SERVICE_Main) (void *cls, | 499 | (*LEGACY_SERVICE_Main) (void *cls, |
457 | struct GNUNET_SERVER_Handle *server, | 500 | struct GNUNET_SERVER_Handle *server, |
458 | const struct GNUNET_CONFIGURATION_Handle *cfg); | 501 | const struct GNUNET_CONFIGURATION_Handle *cfg); |
459 | 502 | ||
@@ -919,7 +962,7 @@ struct Plugin | |||
919 | /** | 962 | /** |
920 | * Handle to the network service. | 963 | * Handle to the network service. |
921 | */ | 964 | */ |
922 | struct GNUNET_SERVICE_Context *service; | 965 | struct LEGACY_SERVICE_Context *service; |
923 | 966 | ||
924 | /** | 967 | /** |
925 | * Handle to the server for this service. | 968 | * Handle to the server for this service. |
@@ -3733,7 +3776,7 @@ libgnunet_plugin_transport_tcp_init (void *cls) | |||
3733 | struct GNUNET_TRANSPORT_PluginEnvironment *env = cls; | 3776 | struct GNUNET_TRANSPORT_PluginEnvironment *env = cls; |
3734 | struct GNUNET_TRANSPORT_PluginFunctions *api; | 3777 | struct GNUNET_TRANSPORT_PluginFunctions *api; |
3735 | struct Plugin *plugin; | 3778 | struct Plugin *plugin; |
3736 | struct GNUNET_SERVICE_Context *service; | 3779 | struct LEGACY_SERVICE_Context *service; |
3737 | unsigned long long aport; | 3780 | unsigned long long aport; |
3738 | unsigned long long bport; | 3781 | unsigned long long bport; |
3739 | unsigned long long max_connections; | 3782 | unsigned long long max_connections; |
@@ -3788,9 +3831,9 @@ libgnunet_plugin_transport_tcp_init (void *cls) | |||
3788 | aport = 0; | 3831 | aport = 0; |
3789 | if (0 != bport) | 3832 | if (0 != bport) |
3790 | { | 3833 | { |
3791 | service = GNUNET_SERVICE_start ("transport-tcp", | 3834 | service = LEGACY_SERVICE_start ("transport-tcp", |
3792 | env->cfg, | 3835 | env->cfg, |
3793 | GNUNET_SERVICE_OPTION_NONE); | 3836 | LEGACY_SERVICE_OPTION_NONE); |
3794 | if (NULL == service) | 3837 | if (NULL == service) |
3795 | { | 3838 | { |
3796 | LOG (GNUNET_ERROR_TYPE_WARNING, | 3839 | LOG (GNUNET_ERROR_TYPE_WARNING, |
@@ -3821,7 +3864,7 @@ libgnunet_plugin_transport_tcp_init (void *cls) | |||
3821 | { | 3864 | { |
3822 | #ifdef TCP_STEALTH | 3865 | #ifdef TCP_STEALTH |
3823 | plugin->myoptions |= TCP_OPTIONS_TCP_STEALTH; | 3866 | plugin->myoptions |= TCP_OPTIONS_TCP_STEALTH; |
3824 | lsocks = GNUNET_SERVICE_get_listen_sockets (service); | 3867 | lsocks = LEGACY_SERVICE_get_listen_sockets (service); |
3825 | if (NULL != lsocks) | 3868 | if (NULL != lsocks) |
3826 | { | 3869 | { |
3827 | uint32_t len = sizeof (struct WelcomeMessage); | 3870 | uint32_t len = sizeof (struct WelcomeMessage); |
@@ -3914,7 +3957,7 @@ libgnunet_plugin_transport_tcp_init (void *cls) | |||
3914 | plugin->service = service; | 3957 | plugin->service = service; |
3915 | if (NULL != service) | 3958 | if (NULL != service) |
3916 | { | 3959 | { |
3917 | plugin->server = GNUNET_SERVICE_get_server (service); | 3960 | plugin->server = LEGACY_SERVICE_get_server (service); |
3918 | } | 3961 | } |
3919 | else | 3962 | else |
3920 | { | 3963 | { |
@@ -3977,7 +4020,7 @@ libgnunet_plugin_transport_tcp_init (void *cls) | |||
3977 | GNUNET_NAT_unregister (plugin->nat); | 4020 | GNUNET_NAT_unregister (plugin->nat); |
3978 | GNUNET_CONTAINER_multipeermap_destroy (plugin->sessionmap); | 4021 | GNUNET_CONTAINER_multipeermap_destroy (plugin->sessionmap); |
3979 | if (NULL != service) | 4022 | if (NULL != service) |
3980 | GNUNET_SERVICE_stop (service); | 4023 | LEGACY_SERVICE_stop (service); |
3981 | GNUNET_free (plugin); | 4024 | GNUNET_free (plugin); |
3982 | GNUNET_free_non_null (api); | 4025 | GNUNET_free_non_null (api); |
3983 | return NULL; | 4026 | return NULL; |
@@ -4030,7 +4073,7 @@ libgnunet_plugin_transport_tcp_done (void *cls) | |||
4030 | } | 4073 | } |
4031 | 4074 | ||
4032 | if (NULL != plugin->service) | 4075 | if (NULL != plugin->service) |
4033 | GNUNET_SERVICE_stop (plugin->service); | 4076 | LEGACY_SERVICE_stop (plugin->service); |
4034 | else | 4077 | else |
4035 | GNUNET_SERVER_destroy (plugin->server); | 4078 | GNUNET_SERVER_destroy (plugin->server); |
4036 | GNUNET_free (plugin->handlers); | 4079 | GNUNET_free (plugin->handlers); |
diff --git a/src/transport/plugin_transport_udp.c b/src/transport/plugin_transport_udp.c index 3a9013a5a..1ff962544 100644 --- a/src/transport/plugin_transport_udp.c +++ b/src/transport/plugin_transport_udp.c | |||
@@ -2061,7 +2061,7 @@ udp_plugin_send (void *cls, | |||
2061 | if ( (sizeof(struct IPv4UdpAddress) == s->address->address_length) && | 2061 | if ( (sizeof(struct IPv4UdpAddress) == s->address->address_length) && |
2062 | (NULL == plugin->sockv4) ) | 2062 | (NULL == plugin->sockv4) ) |
2063 | return GNUNET_SYSERR; | 2063 | return GNUNET_SYSERR; |
2064 | if (udpmlen >= GNUNET_SERVER_MAX_MESSAGE_SIZE) | 2064 | if (udpmlen >= GNUNET_MAX_MESSAGE_SIZE) |
2065 | { | 2065 | { |
2066 | GNUNET_break (0); | 2066 | GNUNET_break (0); |
2067 | return GNUNET_SYSERR; | 2067 | return GNUNET_SYSERR; |
diff --git a/src/transport/plugin_transport_wlan.c b/src/transport/plugin_transport_wlan.c index 3f5ada10b..b23739d3c 100644 --- a/src/transport/plugin_transport_wlan.c +++ b/src/transport/plugin_transport_wlan.c | |||
@@ -744,7 +744,7 @@ send_ack (void *cls, | |||
744 | GNUNET_break (0); | 744 | GNUNET_break (0); |
745 | return; | 745 | return; |
746 | } | 746 | } |
747 | if (size >= GNUNET_SERVER_MAX_MESSAGE_SIZE) | 747 | if (size >= GNUNET_MAX_MESSAGE_SIZE) |
748 | { | 748 | { |
749 | GNUNET_break (0); | 749 | GNUNET_break (0); |
750 | return; | 750 | return; |
diff --git a/src/transport/tcp_connection_legacy.c b/src/transport/tcp_connection_legacy.c index f5253445d..5b219a467 100644 --- a/src/transport/tcp_connection_legacy.c +++ b/src/transport/tcp_connection_legacy.c | |||
@@ -35,6 +35,15 @@ | |||
35 | #include "gnunet_resolver_service.h" | 35 | #include "gnunet_resolver_service.h" |
36 | 36 | ||
37 | 37 | ||
38 | /** | ||
39 | * Timeout we use on TCP connect before trying another | ||
40 | * result from the DNS resolver. Actual value used | ||
41 | * is this value divided by the number of address families. | ||
42 | * Default is 5s. | ||
43 | */ | ||
44 | #define CONNECT_RETRY_TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 5) | ||
45 | |||
46 | |||
38 | 47 | ||
39 | #define LOG_STRERROR(kind,syscall) GNUNET_log_from_strerror (kind, "util-connection", syscall) | 48 | #define LOG_STRERROR(kind,syscall) GNUNET_log_from_strerror (kind, "util-connection", syscall) |
40 | 49 | ||
@@ -304,7 +313,7 @@ GNUNET_CONNECTION_create_from_existing (struct GNUNET_NETWORK_Handle *osSocket) | |||
304 | struct GNUNET_CONNECTION_Handle *connection; | 313 | struct GNUNET_CONNECTION_Handle *connection; |
305 | 314 | ||
306 | connection = GNUNET_new (struct GNUNET_CONNECTION_Handle); | 315 | connection = GNUNET_new (struct GNUNET_CONNECTION_Handle); |
307 | connection->write_buffer_size = GNUNET_SERVER_MIN_BUFFER_SIZE; | 316 | connection->write_buffer_size = GNUNET_MIN_MESSAGE_SIZE; |
308 | connection->write_buffer = GNUNET_malloc (connection->write_buffer_size); | 317 | connection->write_buffer = GNUNET_malloc (connection->write_buffer_size); |
309 | connection->sock = osSocket; | 318 | connection->sock = osSocket; |
310 | return connection; | 319 | return connection; |
@@ -451,7 +460,7 @@ GNUNET_CONNECTION_create_from_accept (GNUNET_CONNECTION_AccessCheck access_cb, | |||
451 | return NULL; | 460 | return NULL; |
452 | } | 461 | } |
453 | connection = GNUNET_new (struct GNUNET_CONNECTION_Handle); | 462 | connection = GNUNET_new (struct GNUNET_CONNECTION_Handle); |
454 | connection->write_buffer_size = GNUNET_SERVER_MIN_BUFFER_SIZE; | 463 | connection->write_buffer_size = GNUNET_MIN_MESSAGE_SIZE; |
455 | connection->write_buffer = GNUNET_malloc (connection->write_buffer_size); | 464 | connection->write_buffer = GNUNET_malloc (connection->write_buffer_size); |
456 | connection->addr = uaddr; | 465 | connection->addr = uaddr; |
457 | connection->addrlen = addrlen; | 466 | connection->addrlen = addrlen; |
@@ -824,7 +833,7 @@ try_connect_using_address (void *cls, | |||
824 | return; | 833 | return; |
825 | } | 834 | } |
826 | GNUNET_CONTAINER_DLL_insert (connection->ap_head, connection->ap_tail, ap); | 835 | GNUNET_CONTAINER_DLL_insert (connection->ap_head, connection->ap_tail, ap); |
827 | delay = GNUNET_CONNECTION_CONNECT_RETRY_TIMEOUT; | 836 | delay = CONNECT_RETRY_TIMEOUT; |
828 | if (NULL != connection->nth.notify_ready) | 837 | if (NULL != connection->nth.notify_ready) |
829 | delay = GNUNET_TIME_relative_min (delay, | 838 | delay = GNUNET_TIME_relative_min (delay, |
830 | GNUNET_TIME_absolute_get_remaining (connection->nth.transmit_timeout)); | 839 | GNUNET_TIME_absolute_get_remaining (connection->nth.transmit_timeout)); |
@@ -858,14 +867,14 @@ GNUNET_CONNECTION_create_from_connect (const struct GNUNET_CONFIGURATION_Handle | |||
858 | GNUNET_assert (0 < strlen (hostname)); /* sanity check */ | 867 | GNUNET_assert (0 < strlen (hostname)); /* sanity check */ |
859 | connection = GNUNET_new (struct GNUNET_CONNECTION_Handle); | 868 | connection = GNUNET_new (struct GNUNET_CONNECTION_Handle); |
860 | connection->cfg = cfg; | 869 | connection->cfg = cfg; |
861 | connection->write_buffer_size = GNUNET_SERVER_MIN_BUFFER_SIZE; | 870 | connection->write_buffer_size = GNUNET_MIN_MESSAGE_SIZE; |
862 | connection->write_buffer = GNUNET_malloc (connection->write_buffer_size); | 871 | connection->write_buffer = GNUNET_malloc (connection->write_buffer_size); |
863 | connection->port = port; | 872 | connection->port = port; |
864 | connection->hostname = GNUNET_strdup (hostname); | 873 | connection->hostname = GNUNET_strdup (hostname); |
865 | connection->dns_active = | 874 | connection->dns_active = |
866 | GNUNET_RESOLVER_ip_get (connection->hostname, | 875 | GNUNET_RESOLVER_ip_get (connection->hostname, |
867 | AF_UNSPEC, | 876 | AF_UNSPEC, |
868 | GNUNET_CONNECTION_CONNECT_RETRY_TIMEOUT, | 877 | CONNECT_RETRY_TIMEOUT, |
869 | &try_connect_using_address, | 878 | &try_connect_using_address, |
870 | connection); | 879 | connection); |
871 | return connection; | 880 | return connection; |
@@ -909,7 +918,7 @@ GNUNET_CONNECTION_create_from_connect_to_unixpath (const struct GNUNET_CONFIGURA | |||
909 | #endif | 918 | #endif |
910 | connection = GNUNET_new (struct GNUNET_CONNECTION_Handle); | 919 | connection = GNUNET_new (struct GNUNET_CONNECTION_Handle); |
911 | connection->cfg = cfg; | 920 | connection->cfg = cfg; |
912 | connection->write_buffer_size = GNUNET_SERVER_MIN_BUFFER_SIZE; | 921 | connection->write_buffer_size = GNUNET_MIN_MESSAGE_SIZE; |
913 | connection->write_buffer = GNUNET_malloc (connection->write_buffer_size); | 922 | connection->write_buffer = GNUNET_malloc (connection->write_buffer_size); |
914 | connection->port = 0; | 923 | connection->port = 0; |
915 | connection->hostname = NULL; | 924 | connection->hostname = NULL; |
@@ -1535,7 +1544,7 @@ GNUNET_CONNECTION_notify_transmit_ready (struct GNUNET_CONNECTION_Handle *connec | |||
1535 | return NULL; | 1544 | return NULL; |
1536 | } | 1545 | } |
1537 | GNUNET_assert (NULL != notify); | 1546 | GNUNET_assert (NULL != notify); |
1538 | GNUNET_assert (size < GNUNET_SERVER_MAX_MESSAGE_SIZE); | 1547 | GNUNET_assert (size < GNUNET_MAX_MESSAGE_SIZE); |
1539 | GNUNET_assert (connection->write_buffer_off <= connection->write_buffer_size); | 1548 | GNUNET_assert (connection->write_buffer_off <= connection->write_buffer_size); |
1540 | GNUNET_assert (connection->write_buffer_pos <= connection->write_buffer_size); | 1549 | GNUNET_assert (connection->write_buffer_pos <= connection->write_buffer_size); |
1541 | GNUNET_assert (connection->write_buffer_pos <= connection->write_buffer_off); | 1550 | GNUNET_assert (connection->write_buffer_pos <= connection->write_buffer_off); |
diff --git a/src/transport/tcp_server_legacy.c b/src/transport/tcp_server_legacy.c index c055285b1..6b4daa525 100644 --- a/src/transport/tcp_server_legacy.c +++ b/src/transport/tcp_server_legacy.c | |||
@@ -1045,7 +1045,7 @@ process_mst (struct GNUNET_SERVER_Client *client, | |||
1045 | GNUNET_STRINGS_relative_time_to_string (client->idle_timeout, GNUNET_YES)); | 1045 | GNUNET_STRINGS_relative_time_to_string (client->idle_timeout, GNUNET_YES)); |
1046 | client->receive_pending = GNUNET_YES; | 1046 | client->receive_pending = GNUNET_YES; |
1047 | GNUNET_CONNECTION_receive (client->connection, | 1047 | GNUNET_CONNECTION_receive (client->connection, |
1048 | GNUNET_SERVER_MAX_MESSAGE_SIZE - 1, | 1048 | GNUNET_MAX_MESSAGE_SIZE - 1, |
1049 | client->idle_timeout, | 1049 | client->idle_timeout, |
1050 | &process_incoming, | 1050 | &process_incoming, |
1051 | client); | 1051 | client); |
@@ -1124,7 +1124,7 @@ process_incoming (void *cls, | |||
1124 | client); | 1124 | client); |
1125 | client->receive_pending = GNUNET_YES; | 1125 | client->receive_pending = GNUNET_YES; |
1126 | GNUNET_CONNECTION_receive (client->connection, | 1126 | GNUNET_CONNECTION_receive (client->connection, |
1127 | GNUNET_SERVER_MAX_MESSAGE_SIZE - 1, | 1127 | GNUNET_MAX_MESSAGE_SIZE - 1, |
1128 | GNUNET_TIME_absolute_get_remaining (end), | 1128 | GNUNET_TIME_absolute_get_remaining (end), |
1129 | &process_incoming, | 1129 | &process_incoming, |
1130 | client); | 1130 | client); |
@@ -1200,7 +1200,7 @@ restart_processing (void *cls) | |||
1200 | LOG (GNUNET_ERROR_TYPE_DEBUG, "Server begins to read again from client.\n"); | 1200 | LOG (GNUNET_ERROR_TYPE_DEBUG, "Server begins to read again from client.\n"); |
1201 | client->receive_pending = GNUNET_YES; | 1201 | client->receive_pending = GNUNET_YES; |
1202 | GNUNET_CONNECTION_receive (client->connection, | 1202 | GNUNET_CONNECTION_receive (client->connection, |
1203 | GNUNET_SERVER_MAX_MESSAGE_SIZE - 1, | 1203 | GNUNET_MAX_MESSAGE_SIZE - 1, |
1204 | client->idle_timeout, | 1204 | client->idle_timeout, |
1205 | &process_incoming, | 1205 | &process_incoming, |
1206 | client); | 1206 | client); |
@@ -1288,7 +1288,7 @@ GNUNET_SERVER_connect_socket (struct GNUNET_SERVER_Handle *server, | |||
1288 | n->callback (n->callback_cls, client); | 1288 | n->callback (n->callback_cls, client); |
1289 | client->receive_pending = GNUNET_YES; | 1289 | client->receive_pending = GNUNET_YES; |
1290 | GNUNET_CONNECTION_receive (client->connection, | 1290 | GNUNET_CONNECTION_receive (client->connection, |
1291 | GNUNET_SERVER_MAX_MESSAGE_SIZE - 1, | 1291 | GNUNET_MAX_MESSAGE_SIZE - 1, |
1292 | client->idle_timeout, | 1292 | client->idle_timeout, |
1293 | &process_incoming, | 1293 | &process_incoming, |
1294 | client); | 1294 | client); |
diff --git a/src/transport/tcp_server_mst_legacy.c b/src/transport/tcp_server_mst_legacy.c index ba42b1837..78e04c1b1 100644 --- a/src/transport/tcp_server_mst_legacy.c +++ b/src/transport/tcp_server_mst_legacy.c | |||
@@ -89,8 +89,8 @@ GNUNET_SERVER_mst_create (GNUNET_SERVER_MessageTokenizerCallback cb, | |||
89 | struct GNUNET_SERVER_MessageStreamTokenizer *ret; | 89 | struct GNUNET_SERVER_MessageStreamTokenizer *ret; |
90 | 90 | ||
91 | ret = GNUNET_new (struct GNUNET_SERVER_MessageStreamTokenizer); | 91 | ret = GNUNET_new (struct GNUNET_SERVER_MessageStreamTokenizer); |
92 | ret->hdr = GNUNET_malloc (GNUNET_SERVER_MIN_BUFFER_SIZE); | 92 | ret->hdr = GNUNET_malloc (GNUNET_MIN_MESSAGE_SIZE); |
93 | ret->curr_buf = GNUNET_SERVER_MIN_BUFFER_SIZE; | 93 | ret->curr_buf = GNUNET_MIN_MESSAGE_SIZE; |
94 | ret->cb = cb; | 94 | ret->cb = cb; |
95 | ret->cb_cls = cb_cls; | 95 | ret->cb_cls = cb_cls; |
96 | return ret; | 96 | return ret; |
diff --git a/src/transport/tcp_service_legacy.c b/src/transport/tcp_service_legacy.c index 050a38acc..7c2d3e55a 100644 --- a/src/transport/tcp_service_legacy.c +++ b/src/transport/tcp_service_legacy.c | |||
@@ -105,7 +105,7 @@ NEXT: | |||
105 | /** | 105 | /** |
106 | * Context for "service_task". | 106 | * Context for "service_task". |
107 | */ | 107 | */ |
108 | struct GNUNET_SERVICE_Context | 108 | struct LEGACY_SERVICE_Context |
109 | { | 109 | { |
110 | /** | 110 | /** |
111 | * Our configuration. | 111 | * Our configuration. |
@@ -131,7 +131,7 @@ struct GNUNET_SERVICE_Context | |||
131 | /** | 131 | /** |
132 | * Main service-specific task to run. | 132 | * Main service-specific task to run. |
133 | */ | 133 | */ |
134 | GNUNET_SERVICE_Main task; | 134 | LEGACY_SERVICE_Main task; |
135 | 135 | ||
136 | /** | 136 | /** |
137 | * Closure for @e task. | 137 | * Closure for @e task. |
@@ -223,7 +223,7 @@ struct GNUNET_SERVICE_Context | |||
223 | /** | 223 | /** |
224 | * Our options. | 224 | * Our options. |
225 | */ | 225 | */ |
226 | enum GNUNET_SERVICE_Options options; | 226 | enum LEGACY_SERVICE_Options options; |
227 | 227 | ||
228 | }; | 228 | }; |
229 | 229 | ||
@@ -307,7 +307,7 @@ static int | |||
307 | check_access (void *cls, const struct GNUNET_CONNECTION_Credentials *uc, | 307 | check_access (void *cls, const struct GNUNET_CONNECTION_Credentials *uc, |
308 | const struct sockaddr *addr, socklen_t addrlen) | 308 | const struct sockaddr *addr, socklen_t addrlen) |
309 | { | 309 | { |
310 | struct GNUNET_SERVICE_Context *sctx = cls; | 310 | struct LEGACY_SERVICE_Context *sctx = cls; |
311 | const struct sockaddr_in *i4; | 311 | const struct sockaddr_in *i4; |
312 | const struct sockaddr_in6 *i6; | 312 | const struct sockaddr_in6 *i6; |
313 | int ret; | 313 | int ret; |
@@ -359,7 +359,7 @@ check_access (void *cls, const struct GNUNET_CONNECTION_Credentials *uc, | |||
359 | * @return name of the file for the process ID | 359 | * @return name of the file for the process ID |
360 | */ | 360 | */ |
361 | static char * | 361 | static char * |
362 | get_pid_file_name (struct GNUNET_SERVICE_Context *sctx) | 362 | get_pid_file_name (struct LEGACY_SERVICE_Context *sctx) |
363 | { | 363 | { |
364 | char *pif; | 364 | char *pif; |
365 | 365 | ||
@@ -382,7 +382,7 @@ get_pid_file_name (struct GNUNET_SERVICE_Context *sctx) | |||
382 | */ | 382 | */ |
383 | static int | 383 | static int |
384 | process_acl4 (struct GNUNET_STRINGS_IPv4NetworkPolicy **ret, | 384 | process_acl4 (struct GNUNET_STRINGS_IPv4NetworkPolicy **ret, |
385 | struct GNUNET_SERVICE_Context *sctx, | 385 | struct LEGACY_SERVICE_Context *sctx, |
386 | const char *option) | 386 | const char *option) |
387 | { | 387 | { |
388 | char *opt; | 388 | char *opt; |
@@ -420,7 +420,7 @@ process_acl4 (struct GNUNET_STRINGS_IPv4NetworkPolicy **ret, | |||
420 | */ | 420 | */ |
421 | static int | 421 | static int |
422 | process_acl6 (struct GNUNET_STRINGS_IPv6NetworkPolicy **ret, | 422 | process_acl6 (struct GNUNET_STRINGS_IPv6NetworkPolicy **ret, |
423 | struct GNUNET_SERVICE_Context *sctx, | 423 | struct LEGACY_SERVICE_Context *sctx, |
424 | const char *option) | 424 | const char *option) |
425 | { | 425 | { |
426 | char *opt; | 426 | char *opt; |
@@ -507,7 +507,7 @@ add_unixpath (struct sockaddr **saddrs, | |||
507 | * set to NULL). | 507 | * set to NULL). |
508 | */ | 508 | */ |
509 | int | 509 | int |
510 | GNUNET_SERVICE_get_server_addresses (const char *service_name, | 510 | LEGACY_SERVICE_get_server_addresses (const char *service_name, |
511 | const struct GNUNET_CONFIGURATION_Handle *cfg, | 511 | const struct GNUNET_CONFIGURATION_Handle *cfg, |
512 | struct sockaddr ***addrs, | 512 | struct sockaddr ***addrs, |
513 | socklen_t ** addr_lens) | 513 | socklen_t ** addr_lens) |
@@ -838,7 +838,7 @@ GNUNET_SERVICE_get_server_addresses (const char *service_name, | |||
838 | * and #GNUNET_SYSERR on error. | 838 | * and #GNUNET_SYSERR on error. |
839 | */ | 839 | */ |
840 | static int | 840 | static int |
841 | receive_sockets_from_parent (struct GNUNET_SERVICE_Context *sctx) | 841 | receive_sockets_from_parent (struct LEGACY_SERVICE_Context *sctx) |
842 | { | 842 | { |
843 | const char *env_buf; | 843 | const char *env_buf; |
844 | int fail; | 844 | int fail; |
@@ -932,7 +932,7 @@ receive_sockets_from_parent (struct GNUNET_SERVICE_Context *sctx) | |||
932 | * @return #GNUNET_OK if configuration succeeded | 932 | * @return #GNUNET_OK if configuration succeeded |
933 | */ | 933 | */ |
934 | static int | 934 | static int |
935 | setup_service (struct GNUNET_SERVICE_Context *sctx) | 935 | setup_service (struct LEGACY_SERVICE_Context *sctx) |
936 | { | 936 | { |
937 | struct GNUNET_TIME_Relative idleout; | 937 | struct GNUNET_TIME_Relative idleout; |
938 | int tolerant; | 938 | int tolerant; |
@@ -1015,7 +1015,7 @@ setup_service (struct GNUNET_SERVICE_Context *sctx) | |||
1015 | 1015 | ||
1016 | if ((NULL == sctx->lsocks) && | 1016 | if ((NULL == sctx->lsocks) && |
1017 | (GNUNET_SYSERR == | 1017 | (GNUNET_SYSERR == |
1018 | GNUNET_SERVICE_get_server_addresses (sctx->service_name, sctx->cfg, | 1018 | LEGACY_SERVICE_get_server_addresses (sctx->service_name, sctx->cfg, |
1019 | &sctx->addrs, &sctx->addrlens))) | 1019 | &sctx->addrs, &sctx->addrlens))) |
1020 | return GNUNET_SYSERR; | 1020 | return GNUNET_SYSERR; |
1021 | sctx->require_found = tolerant ? GNUNET_NO : GNUNET_YES; | 1021 | sctx->require_found = tolerant ? GNUNET_NO : GNUNET_YES; |
@@ -1042,7 +1042,7 @@ setup_service (struct GNUNET_SERVICE_Context *sctx) | |||
1042 | * @return value of the 'USERNAME' option | 1042 | * @return value of the 'USERNAME' option |
1043 | */ | 1043 | */ |
1044 | static char * | 1044 | static char * |
1045 | get_user_name (struct GNUNET_SERVICE_Context *sctx) | 1045 | get_user_name (struct LEGACY_SERVICE_Context *sctx) |
1046 | { | 1046 | { |
1047 | char *un; | 1047 | char *un; |
1048 | 1048 | ||
@@ -1062,7 +1062,7 @@ get_user_name (struct GNUNET_SERVICE_Context *sctx) | |||
1062 | * @return #GNUNET_OK on success (including no work to be done) | 1062 | * @return #GNUNET_OK on success (including no work to be done) |
1063 | */ | 1063 | */ |
1064 | static int | 1064 | static int |
1065 | write_pid_file (struct GNUNET_SERVICE_Context *sctx, pid_t pid) | 1065 | write_pid_file (struct LEGACY_SERVICE_Context *sctx, pid_t pid) |
1066 | { | 1066 | { |
1067 | FILE *pidfd; | 1067 | FILE *pidfd; |
1068 | char *pif; | 1068 | char *pif; |
@@ -1117,16 +1117,16 @@ write_pid_file (struct GNUNET_SERVICE_Context *sctx, pid_t pid) | |||
1117 | /** | 1117 | /** |
1118 | * Task run during shutdown. Stops the server/service. | 1118 | * Task run during shutdown. Stops the server/service. |
1119 | * | 1119 | * |
1120 | * @param cls the `struct GNUNET_SERVICE_Context` | 1120 | * @param cls the `struct LEGACY_SERVICE_Context` |
1121 | */ | 1121 | */ |
1122 | static void | 1122 | static void |
1123 | shutdown_task (void *cls) | 1123 | shutdown_task (void *cls) |
1124 | { | 1124 | { |
1125 | struct GNUNET_SERVICE_Context *service = cls; | 1125 | struct LEGACY_SERVICE_Context *service = cls; |
1126 | struct GNUNET_SERVER_Handle *server = service->server; | 1126 | struct GNUNET_SERVER_Handle *server = service->server; |
1127 | 1127 | ||
1128 | service->shutdown_task = NULL; | 1128 | service->shutdown_task = NULL; |
1129 | if (0 != (service->options & GNUNET_SERVICE_OPTION_SOFT_SHUTDOWN)) | 1129 | if (0 != (service->options & LEGACY_SERVICE_OPTION_SOFT_SHUTDOWN)) |
1130 | GNUNET_SERVER_stop_listening (server); | 1130 | GNUNET_SERVER_stop_listening (server); |
1131 | else | 1131 | else |
1132 | GNUNET_SERVER_destroy (server); | 1132 | GNUNET_SERVER_destroy (server); |
@@ -1141,7 +1141,7 @@ shutdown_task (void *cls) | |||
1141 | static void | 1141 | static void |
1142 | service_task (void *cls) | 1142 | service_task (void *cls) |
1143 | { | 1143 | { |
1144 | struct GNUNET_SERVICE_Context *sctx = cls; | 1144 | struct LEGACY_SERVICE_Context *sctx = cls; |
1145 | unsigned int i; | 1145 | unsigned int i; |
1146 | 1146 | ||
1147 | GNUNET_RESOLVER_connect (sctx->cfg); | 1147 | GNUNET_RESOLVER_connect (sctx->cfg); |
@@ -1174,7 +1174,7 @@ service_task (void *cls) | |||
1174 | #endif | 1174 | #endif |
1175 | 1175 | ||
1176 | 1176 | ||
1177 | if (0 == (sctx->options & GNUNET_SERVICE_OPTION_MANUAL_SHUTDOWN)) | 1177 | if (0 == (sctx->options & LEGACY_SERVICE_OPTION_MANUAL_SHUTDOWN)) |
1178 | { | 1178 | { |
1179 | /* install a task that will kill the server | 1179 | /* install a task that will kill the server |
1180 | * process if the scheduler ever gets a shutdown signal */ | 1180 | * process if the scheduler ever gets a shutdown signal */ |
@@ -1215,7 +1215,7 @@ service_task (void *cls) | |||
1215 | * @return #GNUNET_OK on success, #GNUNET_SYSERR on error | 1215 | * @return #GNUNET_OK on success, #GNUNET_SYSERR on error |
1216 | */ | 1216 | */ |
1217 | static int | 1217 | static int |
1218 | detach_terminal (struct GNUNET_SERVICE_Context *sctx) | 1218 | detach_terminal (struct LEGACY_SERVICE_Context *sctx) |
1219 | { | 1219 | { |
1220 | #ifndef MINGW | 1220 | #ifndef MINGW |
1221 | pid_t pid; | 1221 | pid_t pid; |
@@ -1296,7 +1296,7 @@ detach_terminal (struct GNUNET_SERVICE_Context *sctx) | |||
1296 | * @return #GNUNET_OK on success, #GNUNET_SYSERR on error | 1296 | * @return #GNUNET_OK on success, #GNUNET_SYSERR on error |
1297 | */ | 1297 | */ |
1298 | static int | 1298 | static int |
1299 | set_user_id (struct GNUNET_SERVICE_Context *sctx) | 1299 | set_user_id (struct LEGACY_SERVICE_Context *sctx) |
1300 | { | 1300 | { |
1301 | char *user; | 1301 | char *user; |
1302 | 1302 | ||
@@ -1342,7 +1342,7 @@ set_user_id (struct GNUNET_SERVICE_Context *sctx) | |||
1342 | * @param sctx service context | 1342 | * @param sctx service context |
1343 | */ | 1343 | */ |
1344 | static void | 1344 | static void |
1345 | pid_file_delete (struct GNUNET_SERVICE_Context *sctx) | 1345 | pid_file_delete (struct LEGACY_SERVICE_Context *sctx) |
1346 | { | 1346 | { |
1347 | char *pif = get_pid_file_name (sctx); | 1347 | char *pif = get_pid_file_name (sctx); |
1348 | 1348 | ||
@@ -1368,10 +1368,10 @@ pid_file_delete (struct GNUNET_SERVICE_Context *sctx) | |||
1368 | * if we shutdown nicely | 1368 | * if we shutdown nicely |
1369 | */ | 1369 | */ |
1370 | int | 1370 | int |
1371 | GNUNET_SERVICE_run (int argc, char *const *argv, | 1371 | LEGACY_SERVICE_run (int argc, char *const *argv, |
1372 | const char *service_name, | 1372 | const char *service_name, |
1373 | enum GNUNET_SERVICE_Options options, | 1373 | enum LEGACY_SERVICE_Options options, |
1374 | GNUNET_SERVICE_Main task, | 1374 | LEGACY_SERVICE_Main task, |
1375 | void *task_cls) | 1375 | void *task_cls) |
1376 | { | 1376 | { |
1377 | #define HANDLE_ERROR do { GNUNET_break (0); goto shutdown; } while (0) | 1377 | #define HANDLE_ERROR do { GNUNET_break (0); goto shutdown; } while (0) |
@@ -1387,7 +1387,7 @@ GNUNET_SERVICE_run (int argc, char *const *argv, | |||
1387 | unsigned long long skew_offset; | 1387 | unsigned long long skew_offset; |
1388 | unsigned long long skew_variance; | 1388 | unsigned long long skew_variance; |
1389 | long long clock_offset; | 1389 | long long clock_offset; |
1390 | struct GNUNET_SERVICE_Context sctx; | 1390 | struct LEGACY_SERVICE_Context sctx; |
1391 | struct GNUNET_CONFIGURATION_Handle *cfg; | 1391 | struct GNUNET_CONFIGURATION_Handle *cfg; |
1392 | const char *xdg; | 1392 | const char *xdg; |
1393 | 1393 | ||
@@ -1548,15 +1548,15 @@ shutdown: | |||
1548 | * @param options service options | 1548 | * @param options service options |
1549 | * @return NULL on error, service handle | 1549 | * @return NULL on error, service handle |
1550 | */ | 1550 | */ |
1551 | struct GNUNET_SERVICE_Context * | 1551 | struct LEGACY_SERVICE_Context * |
1552 | GNUNET_SERVICE_start (const char *service_name, | 1552 | LEGACY_SERVICE_start (const char *service_name, |
1553 | const struct GNUNET_CONFIGURATION_Handle *cfg, | 1553 | const struct GNUNET_CONFIGURATION_Handle *cfg, |
1554 | enum GNUNET_SERVICE_Options options) | 1554 | enum LEGACY_SERVICE_Options options) |
1555 | { | 1555 | { |
1556 | int i; | 1556 | int i; |
1557 | struct GNUNET_SERVICE_Context *sctx; | 1557 | struct LEGACY_SERVICE_Context *sctx; |
1558 | 1558 | ||
1559 | sctx = GNUNET_new (struct GNUNET_SERVICE_Context); | 1559 | sctx = GNUNET_new (struct LEGACY_SERVICE_Context); |
1560 | sctx->ready_confirm_fd = -1; /* no daemonizing */ | 1560 | sctx->ready_confirm_fd = -1; /* no daemonizing */ |
1561 | sctx->ret = GNUNET_OK; | 1561 | sctx->ret = GNUNET_OK; |
1562 | sctx->timeout = GNUNET_TIME_UNIT_FOREVER_REL; | 1562 | sctx->timeout = GNUNET_TIME_UNIT_FOREVER_REL; |
@@ -1567,7 +1567,7 @@ GNUNET_SERVICE_start (const char *service_name, | |||
1567 | /* setup subsystems */ | 1567 | /* setup subsystems */ |
1568 | if (GNUNET_OK != setup_service (sctx)) | 1568 | if (GNUNET_OK != setup_service (sctx)) |
1569 | { | 1569 | { |
1570 | GNUNET_SERVICE_stop (sctx); | 1570 | LEGACY_SERVICE_stop (sctx); |
1571 | return NULL; | 1571 | return NULL; |
1572 | } | 1572 | } |
1573 | if (NULL != sctx->lsocks) | 1573 | if (NULL != sctx->lsocks) |
@@ -1581,7 +1581,7 @@ GNUNET_SERVICE_start (const char *service_name, | |||
1581 | 1581 | ||
1582 | if (NULL == sctx->server) | 1582 | if (NULL == sctx->server) |
1583 | { | 1583 | { |
1584 | GNUNET_SERVICE_stop (sctx); | 1584 | LEGACY_SERVICE_stop (sctx); |
1585 | return NULL; | 1585 | return NULL; |
1586 | } | 1586 | } |
1587 | #ifndef WINDOWS | 1587 | #ifndef WINDOWS |
@@ -1611,7 +1611,7 @@ GNUNET_SERVICE_start (const char *service_name, | |||
1611 | * @return handle to the server for this service, NULL if there is none | 1611 | * @return handle to the server for this service, NULL if there is none |
1612 | */ | 1612 | */ |
1613 | struct GNUNET_SERVER_Handle * | 1613 | struct GNUNET_SERVER_Handle * |
1614 | GNUNET_SERVICE_get_server (struct GNUNET_SERVICE_Context *ctx) | 1614 | LEGACY_SERVICE_get_server (struct LEGACY_SERVICE_Context *ctx) |
1615 | { | 1615 | { |
1616 | return ctx->server; | 1616 | return ctx->server; |
1617 | } | 1617 | } |
@@ -1625,19 +1625,19 @@ GNUNET_SERVICE_get_server (struct GNUNET_SERVICE_Context *ctx) | |||
1625 | * array of listen sockets. | 1625 | * array of listen sockets. |
1626 | */ | 1626 | */ |
1627 | struct GNUNET_NETWORK_Handle *const* | 1627 | struct GNUNET_NETWORK_Handle *const* |
1628 | GNUNET_SERVICE_get_listen_sockets (struct GNUNET_SERVICE_Context *ctx) | 1628 | LEGACY_SERVICE_get_listen_sockets (struct LEGACY_SERVICE_Context *ctx) |
1629 | { | 1629 | { |
1630 | return ctx->lsocks; | 1630 | return ctx->lsocks; |
1631 | } | 1631 | } |
1632 | 1632 | ||
1633 | 1633 | ||
1634 | /** | 1634 | /** |
1635 | * Stop a service that was started with "GNUNET_SERVICE_start". | 1635 | * Stop a service that was started with "LEGACY_SERVICE_start". |
1636 | * | 1636 | * |
1637 | * @param sctx the service context returned from the start function | 1637 | * @param sctx the service context returned from the start function |
1638 | */ | 1638 | */ |
1639 | void | 1639 | void |
1640 | GNUNET_SERVICE_stop (struct GNUNET_SERVICE_Context *sctx) | 1640 | LEGACY_SERVICE_stop (struct LEGACY_SERVICE_Context *sctx) |
1641 | { | 1641 | { |
1642 | unsigned int i; | 1642 | unsigned int i; |
1643 | 1643 | ||
diff --git a/src/transport/test_transport_api_reliability.c b/src/transport/test_transport_api_reliability.c index 375a935c8..e5ba2831b 100644 --- a/src/transport/test_transport_api_reliability.c +++ b/src/transport/test_transport_api_reliability.c | |||
@@ -217,7 +217,7 @@ notify_receive (void *cls, | |||
217 | { | 217 | { |
218 | static int n; | 218 | static int n; |
219 | unsigned int s; | 219 | unsigned int s; |
220 | char cbuf[GNUNET_SERVER_MAX_MESSAGE_SIZE - 1]; | 220 | char cbuf[GNUNET_MAX_MESSAGE_SIZE - 1]; |
221 | 221 | ||
222 | if (GNUNET_TRANSPORT_TESTING_SIMPLE_MTYPE != ntohs (hdr->header.type)) | 222 | if (GNUNET_TRANSPORT_TESTING_SIMPLE_MTYPE != ntohs (hdr->header.type)) |
223 | return; | 223 | return; |
diff --git a/src/transport/transport_api_address_to_string.c b/src/transport/transport_api_address_to_string.c index b9c72dcb3..902764a8f 100644 --- a/src/transport/transport_api_address_to_string.c +++ b/src/transport/transport_api_address_to_string.c | |||
@@ -199,10 +199,10 @@ GNUNET_TRANSPORT_address_to_string (const struct GNUNET_CONFIGURATION_Handle *cf | |||
199 | 199 | ||
200 | alen = address->address_length; | 200 | alen = address->address_length; |
201 | slen = strlen (address->transport_name) + 1; | 201 | slen = strlen (address->transport_name) + 1; |
202 | if ( (alen + slen >= GNUNET_SERVER_MAX_MESSAGE_SIZE | 202 | if ( (alen + slen >= GNUNET_MAX_MESSAGE_SIZE |
203 | - sizeof (struct AddressLookupMessage)) || | 203 | - sizeof (struct AddressLookupMessage)) || |
204 | (alen >= GNUNET_SERVER_MAX_MESSAGE_SIZE) || | 204 | (alen >= GNUNET_MAX_MESSAGE_SIZE) || |
205 | (slen >= GNUNET_SERVER_MAX_MESSAGE_SIZE) ) | 205 | (slen >= GNUNET_MAX_MESSAGE_SIZE) ) |
206 | { | 206 | { |
207 | GNUNET_break (0); | 207 | GNUNET_break (0); |
208 | GNUNET_free (alc); | 208 | GNUNET_free (alc); |
diff --git a/src/transport/transport_api_core.c b/src/transport/transport_api_core.c index c99ade92f..9c29d4908 100644 --- a/src/transport/transport_api_core.c +++ b/src/transport/transport_api_core.c | |||
@@ -425,7 +425,7 @@ mq_send_impl (struct GNUNET_MQ_Handle *mq, | |||
425 | 425 | ||
426 | GNUNET_assert (GNUNET_YES == n->is_ready); | 426 | GNUNET_assert (GNUNET_YES == n->is_ready); |
427 | msize = ntohs (msg->size); | 427 | msize = ntohs (msg->size); |
428 | if (msize >= GNUNET_SERVER_MAX_MESSAGE_SIZE - sizeof (*obm)) | 428 | if (msize >= GNUNET_MAX_MESSAGE_SIZE - sizeof (*obm)) |
429 | { | 429 | { |
430 | GNUNET_break (0); | 430 | GNUNET_break (0); |
431 | GNUNET_MQ_impl_send_continue (mq); | 431 | GNUNET_MQ_impl_send_continue (mq); |