summaryrefslogtreecommitdiff
path: root/src/transport
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2017-03-17 18:13:55 +0100
committerChristian Grothoff <christian@grothoff.org>2017-03-17 18:13:55 +0100
commit17d34d5e094c2f8a90717b07e3a711d6e2c15903 (patch)
tree777b5323145a5f4d1f044da29a682799008a11d4 /src/transport
parent3391977e3f92a2ebcafc14ea6374aecd580df873 (diff)
more renamings relating to 'new' service now just being the 'normal' service
Diffstat (limited to 'src/transport')
-rw-r--r--src/transport/gnunet-service-transport_validation.c2
-rw-r--r--src/transport/gnunet-transport-profiler.c2
-rw-r--r--src/transport/plugin_transport_http_client.c4
-rw-r--r--src/transport/plugin_transport_http_server.c2
-rw-r--r--src/transport/plugin_transport_tcp.c61
-rw-r--r--src/transport/plugin_transport_udp.c2
-rw-r--r--src/transport/plugin_transport_wlan.c2
-rw-r--r--src/transport/tcp_connection_legacy.c23
-rw-r--r--src/transport/tcp_server_legacy.c8
-rw-r--r--src/transport/tcp_server_mst_legacy.c4
-rw-r--r--src/transport/tcp_service_legacy.c72
-rw-r--r--src/transport/test_transport_api_reliability.c2
-rw-r--r--src/transport/transport_api_address_to_string.c6
-rw-r--r--src/transport/transport_api_core.c2
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,
ping.challenge = htonl (ve->challenge);
ping.target = *pid;
- if (tsize >= GNUNET_SERVER_MAX_MESSAGE_SIZE)
+ if (tsize >= GNUNET_MAX_MESSAGE_SIZE)
{
GNUNET_break (0);
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,
cfg = (struct GNUNET_CONFIGURATION_Handle *) mycfg;
ret = 1;
- if (GNUNET_SERVER_MAX_MESSAGE_SIZE <= benchmark_size)
+ if (GNUNET_MAX_MESSAGE_SIZE <= benchmark_size)
{
FPRINTF (stderr,
"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)
CURLOPT_CONNECTTIMEOUT_MS,
(long) (HTTP_CLIENT_NOT_VALIDATED_TIMEOUT.rel_value_us / 1000LL));
curl_easy_setopt (s->get.easyhandle, CURLOPT_BUFFERSIZE,
- 2 * GNUNET_SERVER_MAX_MESSAGE_SIZE);
+ 2 * GNUNET_MAX_MESSAGE_SIZE);
#if CURL_TCP_NODELAY
curl_easy_setopt (ps->recv_endpoint,
CURLOPT_TCP_NODELAY,
@@ -1815,7 +1815,7 @@ client_connect_put (struct GNUNET_ATS_Session *s)
CURLOPT_CONNECTTIMEOUT_MS,
(long) (HTTP_CLIENT_NOT_VALIDATED_TIMEOUT.rel_value_us / 1000LL));
curl_easy_setopt (s->put.easyhandle, CURLOPT_BUFFERSIZE,
- 2 * GNUNET_SERVER_MAX_MESSAGE_SIZE);
+ 2 * GNUNET_MAX_MESSAGE_SIZE);
#if CURL_TCP_NODELAY
curl_easy_setopt (s->put.easyhandle, CURLOPT_TCP_NODELAY, 1);
#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,
timeout,
MHD_OPTION_CONNECTION_MEMORY_LIMIT,
(size_t) (2 *
- GNUNET_SERVER_MAX_MESSAGE_SIZE),
+ GNUNET_MAX_MESSAGE_SIZE),
MHD_OPTION_NOTIFY_COMPLETED,
&server_disconnect_cb, plugin,
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;
*/
struct GNUNET_CONNECTION_Handle;
+/**
+ * @brief handle for a network service
+ */
+struct LEGACY_SERVICE_Context;
+
+
+/**
+ * Stops a service that was started with #GNUNET_SERVICE_start().
+ *
+ * @param srv service to stop
+ */
+void
+LEGACY_SERVICE_stop (struct LEGACY_SERVICE_Context *srv);
+
+
/**
* Function called to notify a client about the connection begin ready
@@ -269,6 +284,34 @@ struct GNUNET_SERVER_MessageHandler
};
+
+/**
+ * Options for the service (bitmask).
+ */
+enum LEGACY_SERVICE_Options
+{
+ /**
+ * Use defaults. Terminates all client connections and the listen
+ * sockets immediately upon receiving the shutdown signal.
+ */
+ LEGACY_SERVICE_OPTION_NONE = 0,
+
+ /**
+ * Do not trigger server shutdown on signal at all; instead, allow
+ * for the user to terminate the server explicitly when needed
+ * by calling #LEGACY_SERVICE_shutdown().
+ */
+ LEGACY_SERVICE_OPTION_MANUAL_SHUTDOWN = 1,
+
+ /**
+ * Trigger a SOFT server shutdown on signals, allowing active
+ * non-monitor clients to complete their transactions.
+ */
+ LEGACY_SERVICE_OPTION_SOFT_SHUTDOWN = 2
+};
+
+
+
/**
* Ask the server to disconnect from the given client. This is the
* same as passing #GNUNET_SYSERR to #GNUNET_SERVER_receive_done,
@@ -453,7 +496,7 @@ GNUNET_SERVER_client_drop (struct GNUNET_SERVER_Client *client);
* @param cfg configuration to use
*/
typedef void
-(*GNUNET_SERVICE_Main) (void *cls,
+(*LEGACY_SERVICE_Main) (void *cls,
struct GNUNET_SERVER_Handle *server,
const struct GNUNET_CONFIGURATION_Handle *cfg);
@@ -919,7 +962,7 @@ struct Plugin
/**
* Handle to the network service.
*/
- struct GNUNET_SERVICE_Context *service;
+ struct LEGACY_SERVICE_Context *service;
/**
* Handle to the server for this service.
@@ -3733,7 +3776,7 @@ libgnunet_plugin_transport_tcp_init (void *cls)
struct GNUNET_TRANSPORT_PluginEnvironment *env = cls;
struct GNUNET_TRANSPORT_PluginFunctions *api;
struct Plugin *plugin;
- struct GNUNET_SERVICE_Context *service;
+ struct LEGACY_SERVICE_Context *service;
unsigned long long aport;
unsigned long long bport;
unsigned long long max_connections;
@@ -3788,9 +3831,9 @@ libgnunet_plugin_transport_tcp_init (void *cls)
aport = 0;
if (0 != bport)
{
- service = GNUNET_SERVICE_start ("transport-tcp",
+ service = LEGACY_SERVICE_start ("transport-tcp",
env->cfg,
- GNUNET_SERVICE_OPTION_NONE);
+ LEGACY_SERVICE_OPTION_NONE);
if (NULL == service)
{
LOG (GNUNET_ERROR_TYPE_WARNING,
@@ -3821,7 +3864,7 @@ libgnunet_plugin_transport_tcp_init (void *cls)
{
#ifdef TCP_STEALTH
plugin->myoptions |= TCP_OPTIONS_TCP_STEALTH;
- lsocks = GNUNET_SERVICE_get_listen_sockets (service);
+ lsocks = LEGACY_SERVICE_get_listen_sockets (service);
if (NULL != lsocks)
{
uint32_t len = sizeof (struct WelcomeMessage);
@@ -3914,7 +3957,7 @@ libgnunet_plugin_transport_tcp_init (void *cls)
plugin->service = service;
if (NULL != service)
{
- plugin->server = GNUNET_SERVICE_get_server (service);
+ plugin->server = LEGACY_SERVICE_get_server (service);
}
else
{
@@ -3977,7 +4020,7 @@ libgnunet_plugin_transport_tcp_init (void *cls)
GNUNET_NAT_unregister (plugin->nat);
GNUNET_CONTAINER_multipeermap_destroy (plugin->sessionmap);
if (NULL != service)
- GNUNET_SERVICE_stop (service);
+ LEGACY_SERVICE_stop (service);
GNUNET_free (plugin);
GNUNET_free_non_null (api);
return NULL;
@@ -4030,7 +4073,7 @@ libgnunet_plugin_transport_tcp_done (void *cls)
}
if (NULL != plugin->service)
- GNUNET_SERVICE_stop (plugin->service);
+ LEGACY_SERVICE_stop (plugin->service);
else
GNUNET_SERVER_destroy (plugin->server);
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,
if ( (sizeof(struct IPv4UdpAddress) == s->address->address_length) &&
(NULL == plugin->sockv4) )
return GNUNET_SYSERR;
- if (udpmlen >= GNUNET_SERVER_MAX_MESSAGE_SIZE)
+ if (udpmlen >= GNUNET_MAX_MESSAGE_SIZE)
{
GNUNET_break (0);
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,
GNUNET_break (0);
return;
}
- if (size >= GNUNET_SERVER_MAX_MESSAGE_SIZE)
+ if (size >= GNUNET_MAX_MESSAGE_SIZE)
{
GNUNET_break (0);
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 @@
#include "gnunet_resolver_service.h"
+/**
+ * Timeout we use on TCP connect before trying another
+ * result from the DNS resolver. Actual value used
+ * is this value divided by the number of address families.
+ * Default is 5s.
+ */
+#define CONNECT_RETRY_TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 5)
+
+
#define LOG_STRERROR(kind,syscall) GNUNET_log_from_strerror (kind, "util-connection", syscall)
@@ -304,7 +313,7 @@ GNUNET_CONNECTION_create_from_existing (struct GNUNET_NETWORK_Handle *osSocket)
struct GNUNET_CONNECTION_Handle *connection;
connection = GNUNET_new (struct GNUNET_CONNECTION_Handle);
- connection->write_buffer_size = GNUNET_SERVER_MIN_BUFFER_SIZE;
+ connection->write_buffer_size = GNUNET_MIN_MESSAGE_SIZE;
connection->write_buffer = GNUNET_malloc (connection->write_buffer_size);
connection->sock = osSocket;
return connection;
@@ -451,7 +460,7 @@ GNUNET_CONNECTION_create_from_accept (GNUNET_CONNECTION_AccessCheck access_cb,
return NULL;
}
connection = GNUNET_new (struct GNUNET_CONNECTION_Handle);
- connection->write_buffer_size = GNUNET_SERVER_MIN_BUFFER_SIZE;
+ connection->write_buffer_size = GNUNET_MIN_MESSAGE_SIZE;
connection->write_buffer = GNUNET_malloc (connection->write_buffer_size);
connection->addr = uaddr;
connection->addrlen = addrlen;
@@ -824,7 +833,7 @@ try_connect_using_address (void *cls,
return;
}
GNUNET_CONTAINER_DLL_insert (connection->ap_head, connection->ap_tail, ap);
- delay = GNUNET_CONNECTION_CONNECT_RETRY_TIMEOUT;
+ delay = CONNECT_RETRY_TIMEOUT;
if (NULL != connection->nth.notify_ready)
delay = GNUNET_TIME_relative_min (delay,
GNUNET_TIME_absolute_get_remaining (connection->nth.transmit_timeout));
@@ -858,14 +867,14 @@ GNUNET_CONNECTION_create_from_connect (const struct GNUNET_CONFIGURATION_Handle
GNUNET_assert (0 < strlen (hostname)); /* sanity check */
connection = GNUNET_new (struct GNUNET_CONNECTION_Handle);
connection->cfg = cfg;
- connection->write_buffer_size = GNUNET_SERVER_MIN_BUFFER_SIZE;
+ connection->write_buffer_size = GNUNET_MIN_MESSAGE_SIZE;
connection->write_buffer = GNUNET_malloc (connection->write_buffer_size);
connection->port = port;
connection->hostname = GNUNET_strdup (hostname);
connection->dns_active =
GNUNET_RESOLVER_ip_get (connection->hostname,
AF_UNSPEC,
- GNUNET_CONNECTION_CONNECT_RETRY_TIMEOUT,
+ CONNECT_RETRY_TIMEOUT,
&try_connect_using_address,
connection);
return connection;
@@ -909,7 +918,7 @@ GNUNET_CONNECTION_create_from_connect_to_unixpath (const struct GNUNET_CONFIGURA
#endif
connection = GNUNET_new (struct GNUNET_CONNECTION_Handle);
connection->cfg = cfg;
- connection->write_buffer_size = GNUNET_SERVER_MIN_BUFFER_SIZE;
+ connection->write_buffer_size = GNUNET_MIN_MESSAGE_SIZE;
connection->write_buffer = GNUNET_malloc (connection->write_buffer_size);
connection->port = 0;
connection->hostname = NULL;
@@ -1535,7 +1544,7 @@ GNUNET_CONNECTION_notify_transmit_ready (struct GNUNET_CONNECTION_Handle *connec
return NULL;
}
GNUNET_assert (NULL != notify);
- GNUNET_assert (size < GNUNET_SERVER_MAX_MESSAGE_SIZE);
+ GNUNET_assert (size < GNUNET_MAX_MESSAGE_SIZE);
GNUNET_assert (connection->write_buffer_off <= connection->write_buffer_size);
GNUNET_assert (connection->write_buffer_pos <= connection->write_buffer_size);
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,
GNUNET_STRINGS_relative_time_to_string (client->idle_timeout, GNUNET_YES));
client->receive_pending = GNUNET_YES;
GNUNET_CONNECTION_receive (client->connection,
- GNUNET_SERVER_MAX_MESSAGE_SIZE - 1,
+ GNUNET_MAX_MESSAGE_SIZE - 1,
client->idle_timeout,
&process_incoming,
client);
@@ -1124,7 +1124,7 @@ process_incoming (void *cls,
client);
client->receive_pending = GNUNET_YES;
GNUNET_CONNECTION_receive (client->connection,
- GNUNET_SERVER_MAX_MESSAGE_SIZE - 1,
+ GNUNET_MAX_MESSAGE_SIZE - 1,
GNUNET_TIME_absolute_get_remaining (end),
&process_incoming,
client);
@@ -1200,7 +1200,7 @@ restart_processing (void *cls)
LOG (GNUNET_ERROR_TYPE_DEBUG, "Server begins to read again from client.\n");
client->receive_pending = GNUNET_YES;
GNUNET_CONNECTION_receive (client->connection,
- GNUNET_SERVER_MAX_MESSAGE_SIZE - 1,
+ GNUNET_MAX_MESSAGE_SIZE - 1,
client->idle_timeout,
&process_incoming,
client);
@@ -1288,7 +1288,7 @@ GNUNET_SERVER_connect_socket (struct GNUNET_SERVER_Handle *server,
n->callback (n->callback_cls, client);
client->receive_pending = GNUNET_YES;
GNUNET_CONNECTION_receive (client->connection,
- GNUNET_SERVER_MAX_MESSAGE_SIZE - 1,
+ GNUNET_MAX_MESSAGE_SIZE - 1,
client->idle_timeout,
&process_incoming,
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,
struct GNUNET_SERVER_MessageStreamTokenizer *ret;
ret = GNUNET_new (struct GNUNET_SERVER_MessageStreamTokenizer);
- ret->hdr = GNUNET_malloc (GNUNET_SERVER_MIN_BUFFER_SIZE);
- ret->curr_buf = GNUNET_SERVER_MIN_BUFFER_SIZE;
+ ret->hdr = GNUNET_malloc (GNUNET_MIN_MESSAGE_SIZE);
+ ret->curr_buf = GNUNET_MIN_MESSAGE_SIZE;
ret->cb = cb;
ret->cb_cls = cb_cls;
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:
/**
* Context for "service_task".
*/
-struct GNUNET_SERVICE_Context
+struct LEGACY_SERVICE_Context
{
/**
* Our configuration.
@@ -131,7 +131,7 @@ struct GNUNET_SERVICE_Context
/**
* Main service-specific task to run.
*/
- GNUNET_SERVICE_Main task;
+ LEGACY_SERVICE_Main task;
/**
* Closure for @e task.
@@ -223,7 +223,7 @@ struct GNUNET_SERVICE_Context
/**
* Our options.
*/
- enum GNUNET_SERVICE_Options options;
+ enum LEGACY_SERVICE_Options options;
};
@@ -307,7 +307,7 @@ static int
check_access (void *cls, const struct GNUNET_CONNECTION_Credentials *uc,
const struct sockaddr *addr, socklen_t addrlen)
{
- struct GNUNET_SERVICE_Context *sctx = cls;
+ struct LEGACY_SERVICE_Context *sctx = cls;
const struct sockaddr_in *i4;
const struct sockaddr_in6 *i6;
int ret;
@@ -359,7 +359,7 @@ check_access (void *cls, const struct GNUNET_CONNECTION_Credentials *uc,
* @return name of the file for the process ID
*/
static char *
-get_pid_file_name (struct GNUNET_SERVICE_Context *sctx)
+get_pid_file_name (struct LEGACY_SERVICE_Context *sctx)
{
char *pif;
@@ -382,7 +382,7 @@ get_pid_file_name (struct GNUNET_SERVICE_Context *sctx)
*/
static int
process_acl4 (struct GNUNET_STRINGS_IPv4NetworkPolicy **ret,
- struct GNUNET_SERVICE_Context *sctx,
+ struct LEGACY_SERVICE_Context *sctx,
const char *option)
{
char *opt;
@@ -420,7 +420,7 @@ process_acl4 (struct GNUNET_STRINGS_IPv4NetworkPolicy **ret,
*/
static int
process_acl6 (struct GNUNET_STRINGS_IPv6NetworkPolicy **ret,
- struct GNUNET_SERVICE_Context *sctx,
+ struct LEGACY_SERVICE_Context *sctx,
const char *option)
{
char *opt;
@@ -507,7 +507,7 @@ add_unixpath (struct sockaddr **saddrs,
* set to NULL).
*/
int
-GNUNET_SERVICE_get_server_addresses (const char *service_name,
+LEGACY_SERVICE_get_server_addresses (const char *service_name,
const struct GNUNET_CONFIGURATION_Handle *cfg,
struct sockaddr ***addrs,
socklen_t ** addr_lens)
@@ -838,7 +838,7 @@ GNUNET_SERVICE_get_server_addresses (const char *service_name,
* and #GNUNET_SYSERR on error.
*/
static int
-receive_sockets_from_parent (struct GNUNET_SERVICE_Context *sctx)
+receive_sockets_from_parent (struct LEGACY_SERVICE_Context *sctx)
{
const char *env_buf;
int fail;
@@ -932,7 +932,7 @@ receive_sockets_from_parent (struct GNUNET_SERVICE_Context *sctx)
* @return #GNUNET_OK if configuration succeeded
*/
static int
-setup_service (struct GNUNET_SERVICE_Context *sctx)
+setup_service (struct LEGACY_SERVICE_Context *sctx)
{
struct GNUNET_TIME_Relative idleout;
int tolerant;
@@ -1015,7 +1015,7 @@ setup_service (struct GNUNET_SERVICE_Context *sctx)
if ((NULL == sctx->lsocks) &&
(GNUNET_SYSERR ==
- GNUNET_SERVICE_get_server_addresses (sctx->service_name, sctx->cfg,
+ LEGACY_SERVICE_get_server_addresses (sctx->service_name, sctx->cfg,
&sctx->addrs, &sctx->addrlens)))
return GNUNET_SYSERR;
sctx->require_found = tolerant ? GNUNET_NO : GNUNET_YES;
@@ -1042,7 +1042,7 @@ setup_service (struct GNUNET_SERVICE_Context *sctx)
* @return value of the 'USERNAME' option
*/
static char *
-get_user_name (struct GNUNET_SERVICE_Context *sctx)
+get_user_name (struct LEGACY_SERVICE_Context *sctx)
{
char *un;
@@ -1062,7 +1062,7 @@ get_user_name (struct GNUNET_SERVICE_Context *sctx)
* @return #GNUNET_OK on success (including no work to be done)
*/
static int
-write_pid_file (struct GNUNET_SERVICE_Context *sctx, pid_t pid)
+write_pid_file (struct LEGACY_SERVICE_Context *sctx, pid_t pid)
{
FILE *pidfd;
char *pif;
@@ -1117,16 +1117,16 @@ write_pid_file (struct GNUNET_SERVICE_Context *sctx, pid_t pid)
/**
* Task run during shutdown. Stops the server/service.
*
- * @param cls the `struct GNUNET_SERVICE_Context`
+ * @param cls the `struct LEGACY_SERVICE_Context`
*/
static void
shutdown_task (void *cls)
{
- struct GNUNET_SERVICE_Context *service = cls;
+ struct LEGACY_SERVICE_Context *service = cls;
struct GNUNET_SERVER_Handle *server = service->server;
service->shutdown_task = NULL;
- if (0 != (service->options & GNUNET_SERVICE_OPTION_SOFT_SHUTDOWN))
+ if (0 != (service->options & LEGACY_SERVICE_OPTION_SOFT_SHUTDOWN))
GNUNET_SERVER_stop_listening (server);
else
GNUNET_SERVER_destroy (server);
@@ -1141,7 +1141,7 @@ shutdown_task (void *cls)
static void
service_task (void *cls)
{
- struct GNUNET_SERVICE_Context *sctx = cls;
+ struct LEGACY_SERVICE_Context *sctx = cls;
unsigned int i;
GNUNET_RESOLVER_connect (sctx->cfg);
@@ -1174,7 +1174,7 @@ service_task (void *cls)
#endif
- if (0 == (sctx->options & GNUNET_SERVICE_OPTION_MANUAL_SHUTDOWN))
+ if (0 == (sctx->options & LEGACY_SERVICE_OPTION_MANUAL_SHUTDOWN))
{
/* install a task that will kill the server
* process if the scheduler ever gets a shutdown signal */
@@ -1215,7 +1215,7 @@ service_task (void *cls)
* @return #GNUNET_OK on success, #GNUNET_SYSERR on error
*/
static int
-detach_terminal (struct GNUNET_SERVICE_Context *sctx)
+detach_terminal (struct LEGACY_SERVICE_Context *sctx)
{
#ifndef MINGW
pid_t pid;
@@ -1296,7 +1296,7 @@ detach_terminal (struct GNUNET_SERVICE_Context *sctx)
* @return #GNUNET_OK on success, #GNUNET_SYSERR on error
*/
static int
-set_user_id (struct GNUNET_SERVICE_Context *sctx)
+set_user_id (struct LEGACY_SERVICE_Context *sctx)
{
char *user;
@@ -1342,7 +1342,7 @@ set_user_id (struct GNUNET_SERVICE_Context *sctx)
* @param sctx service context
*/
static void
-pid_file_delete (struct GNUNET_SERVICE_Context *sctx)
+pid_file_delete (struct LEGACY_SERVICE_Context *sctx)
{
char *pif = get_pid_file_name (sctx);
@@ -1368,10 +1368,10 @@ pid_file_delete (struct GNUNET_SERVICE_Context *sctx)
* if we shutdown nicely
*/
int
-GNUNET_SERVICE_run (int argc, char *const *argv,
+LEGACY_SERVICE_run (int argc, char *const *argv,
const char *service_name,
- enum GNUNET_SERVICE_Options options,
- GNUNET_SERVICE_Main task,
+ enum LEGACY_SERVICE_Options options,
+ LEGACY_SERVICE_Main task,
void *task_cls)
{
#define HANDLE_ERROR do { GNUNET_break (0); goto shutdown; } while (0)
@@ -1387,7 +1387,7 @@ GNUNET_SERVICE_run (int argc, char *const *argv,
unsigned long long skew_offset;
unsigned long long skew_variance;
long long clock_offset;
- struct GNUNET_SERVICE_Context sctx;
+ struct LEGACY_SERVICE_Context sctx;
struct GNUNET_CONFIGURATION_Handle *cfg;
const char *xdg;
@@ -1548,15 +1548,15 @@ shutdown:
* @param options service options
* @return NULL on error, service handle
*/
-struct GNUNET_SERVICE_Context *
-GNUNET_SERVICE_start (const char *service_name,
+struct LEGACY_SERVICE_Context *
+LEGACY_SERVICE_start (const char *service_name,
const struct GNUNET_CONFIGURATION_Handle *cfg,
- enum GNUNET_SERVICE_Options options)
+ enum LEGACY_SERVICE_Options options)
{
int i;
- struct GNUNET_SERVICE_Context *sctx;
+ struct LEGACY_SERVICE_Context *sctx;
- sctx = GNUNET_new (struct GNUNET_SERVICE_Context);
+ sctx = GNUNET_new (struct LEGACY_SERVICE_Context);
sctx->ready_confirm_fd = -1; /* no daemonizing */
sctx->ret = GNUNET_OK;
sctx->timeout = GNUNET_TIME_UNIT_FOREVER_REL;
@@ -1567,7 +1567,7 @@ GNUNET_SERVICE_start (const char *service_name,
/* setup subsystems */
if (GNUNET_OK != setup_service (sctx))
{
- GNUNET_SERVICE_stop (sctx);
+ LEGACY_SERVICE_stop (sctx);
return NULL;
}
if (NULL != sctx->lsocks)
@@ -1581,7 +1581,7 @@ GNUNET_SERVICE_start (const char *service_name,
if (NULL == sctx->server)
{
- GNUNET_SERVICE_stop (sctx);
+ LEGACY_SERVICE_stop (sctx);
return NULL;
}
#ifndef WINDOWS
@@ -1611,7 +1611,7 @@ GNUNET_SERVICE_start (const char *service_name,
* @return handle to the server for this service, NULL if there is none
*/
struct GNUNET_SERVER_Handle *
-GNUNET_SERVICE_get_server (struct GNUNET_SERVICE_Context *ctx)
+LEGACY_SERVICE_get_server (struct LEGACY_SERVICE_Context *ctx)
{
return ctx->server;
}
@@ -1625,19 +1625,19 @@ GNUNET_SERVICE_get_server (struct GNUNET_SERVICE_Context *ctx)
* array of listen sockets.
*/
struct GNUNET_NETWORK_Handle *const*
-GNUNET_SERVICE_get_listen_sockets (struct GNUNET_SERVICE_Context *ctx)
+LEGACY_SERVICE_get_listen_sockets (struct LEGACY_SERVICE_Context *ctx)
{
return ctx->lsocks;
}
/**
- * Stop a service that was started with "GNUNET_SERVICE_start".
+ * Stop a service that was started with "LEGACY_SERVICE_start".
*
* @param sctx the service context returned from the start function
*/
void
-GNUNET_SERVICE_stop (struct GNUNET_SERVICE_Context *sctx)
+LEGACY_SERVICE_stop (struct LEGACY_SERVICE_Context *sctx)
{
unsigned int i;
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,
{
static int n;
unsigned int s;
- char cbuf[GNUNET_SERVER_MAX_MESSAGE_SIZE - 1];
+ char cbuf[GNUNET_MAX_MESSAGE_SIZE - 1];
if (GNUNET_TRANSPORT_TESTING_SIMPLE_MTYPE != ntohs (hdr->header.type))
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
alen = address->address_length;
slen = strlen (address->transport_name) + 1;
- if ( (alen + slen >= GNUNET_SERVER_MAX_MESSAGE_SIZE
+ if ( (alen + slen >= GNUNET_MAX_MESSAGE_SIZE
- sizeof (struct AddressLookupMessage)) ||
- (alen >= GNUNET_SERVER_MAX_MESSAGE_SIZE) ||
- (slen >= GNUNET_SERVER_MAX_MESSAGE_SIZE) )
+ (alen >= GNUNET_MAX_MESSAGE_SIZE) ||
+ (slen >= GNUNET_MAX_MESSAGE_SIZE) )
{
GNUNET_break (0);
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,
GNUNET_assert (GNUNET_YES == n->is_ready);
msize = ntohs (msg->size);
- if (msize >= GNUNET_SERVER_MAX_MESSAGE_SIZE - sizeof (*obm))
+ if (msize >= GNUNET_MAX_MESSAGE_SIZE - sizeof (*obm))
{
GNUNET_break (0);
GNUNET_MQ_impl_send_continue (mq);