summaryrefslogtreecommitdiff
path: root/src/transport
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2016-04-30 08:17:37 +0000
committerChristian Grothoff <christian@grothoff.org>2016-04-30 08:17:37 +0000
commit95f9076a2139f5fb042b944a0658b6cda2fa35db (patch)
treeb0826a2a1dcf812e6b4450fe6b05d47cd53ae49d /src/transport
parent7746f68db77b9ca3c4aaca24ab2ce5253461240b (diff)
implementing new scheduler shutdown semantics
Diffstat (limited to 'src/transport')
-rw-r--r--src/transport/gnunet-service-transport.c5
-rw-r--r--src/transport/gnunet-service-transport_validation.c1
-rw-r--r--src/transport/gnunet-transport-profiler.c14
-rw-r--r--src/transport/gnunet-transport.c34
-rw-r--r--src/transport/plugin_transport_http_client.c21
-rw-r--r--src/transport/plugin_transport_http_server.c56
-rw-r--r--src/transport/plugin_transport_udp.c10
-rw-r--r--src/transport/plugin_transport_unix.c12
-rw-r--r--src/transport/test_transport_api.c5
-rw-r--r--src/transport/test_transport_api_bidirectional_connect.c8
-rw-r--r--src/transport/test_transport_api_blacklisting.c5
-rw-r--r--src/transport/test_transport_api_disconnect.c11
-rw-r--r--src/transport/test_transport_api_http_reverse_peer2.conf1
-rw-r--r--src/transport/test_transport_api_https_peer1.conf1
-rw-r--r--src/transport/test_transport_api_https_peer2.conf1
-rw-r--r--src/transport/test_transport_api_limited_sockets.c6
-rw-r--r--src/transport/test_transport_api_manipulation_cfg.c10
-rw-r--r--src/transport/test_transport_api_manipulation_recv_tcp.c5
-rw-r--r--src/transport/test_transport_api_manipulation_send_tcp.c4
-rw-r--r--src/transport/test_transport_api_monitor_peers.c5
-rw-r--r--src/transport/test_transport_api_monitor_validation.c5
-rw-r--r--src/transport/test_transport_api_restart_1peer.c5
-rw-r--r--src/transport/test_transport_api_restart_2peers.c6
-rw-r--r--src/transport/test_transport_api_timeout.c6
-rw-r--r--src/transport/test_transport_startonly.c13
-rw-r--r--src/transport/transport-testing.c6
-rw-r--r--src/transport/transport_api.c7
27 files changed, 63 insertions, 200 deletions
diff --git a/src/transport/gnunet-service-transport.c b/src/transport/gnunet-service-transport.c
index 9fde3d83e..119e5e564 100644
--- a/src/transport/gnunet-service-transport.c
+++ b/src/transport/gnunet-service-transport.c
@@ -848,9 +848,8 @@ run (void *cls,
"My identity is `%4s'\n",
GNUNET_i2s_full (&GST_my_identity));
- GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_FOREVER_REL,
- &shutdown_task,
- NULL);
+ GNUNET_SCHEDULER_add_shutdown (&shutdown_task,
+ NULL);
if (NULL == GST_peerinfo)
{
GNUNET_log(GNUNET_ERROR_TYPE_ERROR,
diff --git a/src/transport/gnunet-service-transport_validation.c b/src/transport/gnunet-service-transport_validation.c
index 836aa418c..6ea5394bf 100644
--- a/src/transport/gnunet-service-transport_validation.c
+++ b/src/transport/gnunet-service-transport_validation.c
@@ -873,7 +873,6 @@ add_valid_address (void *cls,
validation_entry_changed (ve,
GNUNET_TRANSPORT_VS_UPDATE);
memset (&prop, 0, sizeof (prop));
- GNUNET_break (GNUNET_ATS_NET_UNSPECIFIED != ve->network);
prop.scope = ve->network;
prop.delay = GNUNET_TIME_relative_divide (ve->latency, 2);
if (GNUNET_YES != ve->known_to_ats)
diff --git a/src/transport/gnunet-transport-profiler.c b/src/transport/gnunet-transport-profiler.c
index 624d1a16c..af47c5c56 100644
--- a/src/transport/gnunet-transport-profiler.c
+++ b/src/transport/gnunet-transport-profiler.c
@@ -146,11 +146,6 @@ static struct GNUNET_TRANSPORT_Blacklist *bl_handle;
static struct GNUNET_PeerIdentity pid;
/**
- * Task scheduled for cleanup / termination of the process.
- */
-static struct GNUNET_SCHEDULER_Task * end;
-
-/**
* Selected level of verbosity.
*/
static int verbosity;
@@ -380,9 +375,7 @@ iteration_done ()
if (it_count == benchmark_iterations)
{
benchmark_running = GNUNET_NO;
- if (NULL != end)
- GNUNET_SCHEDULER_cancel (end);
- end = GNUNET_SCHEDULER_add_now (&shutdown_task, NULL);
+ GNUNET_SCHEDULER_shutdown ();
return;
}
else
@@ -570,9 +563,8 @@ testservice_task (void *cls, int result)
ats_sh = GNUNET_ATS_connectivity_suggest (ats,
&pid,
1);
- end = GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_FOREVER_REL,
- &shutdown_task,
- NULL);
+ GNUNET_SCHEDULER_add_shutdown (&shutdown_task,
+ NULL);
}
diff --git a/src/transport/gnunet-transport.c b/src/transport/gnunet-transport.c
index bed9bdc85..cbddee905 100644
--- a/src/transport/gnunet-transport.c
+++ b/src/transport/gnunet-transport.c
@@ -607,9 +607,7 @@ operation_timeout (void *cls)
FPRINTF (stdout,
_("Failed to connect to `%s'\n"),
GNUNET_i2s_full (&pid));
- if (NULL != end)
- GNUNET_SCHEDULER_cancel (end);
- end = GNUNET_SCHEDULER_add_now (&shutdown_task, NULL);
+ GNUNET_SCHEDULER_shutdown ();
ret = 1;
return;
}
@@ -633,9 +631,7 @@ operation_timeout (void *cls)
FPRINTF (stdout,
"%s",
_("Failed to list connections, timeout occured\n"));
- if (NULL != end)
- GNUNET_SCHEDULER_cancel (end);
- end = GNUNET_SCHEDULER_add_now (&shutdown_task, NULL);
+ GNUNET_SCHEDULER_shutdown ();
ret = 1;
return;
}
@@ -851,18 +847,13 @@ process_validation_string (void *cls,
GNUNET_free (vc);
if ((0 == address_resolutions) && (iterate_validation))
{
- if (NULL != end)
- {
- GNUNET_SCHEDULER_cancel (end);
- end = NULL;
- }
if (NULL != op_timeout)
{
GNUNET_SCHEDULER_cancel (op_timeout);
op_timeout = NULL;
}
ret = 0;
- end = GNUNET_SCHEDULER_add_now (&shutdown_task, NULL);
+ GNUNET_SCHEDULER_shutdown ();
}
}
@@ -937,9 +928,7 @@ process_validation_cb (void *cls,
return;
}
vic = NULL;
- if (NULL != end)
- GNUNET_SCHEDULER_cancel (end);
- end = GNUNET_SCHEDULER_add_now (&shutdown_task, NULL);
+ GNUNET_SCHEDULER_shutdown ();
return;
}
resolve_validation_address (address,
@@ -1364,19 +1353,13 @@ process_peer_string (void *cls,
GNUNET_free (rc);
if ((0 == address_resolutions) && (iterate_connections))
{
- if (NULL != end)
- {
- GNUNET_SCHEDULER_cancel (end);
- end = NULL;
- }
if (NULL != op_timeout)
{
GNUNET_SCHEDULER_cancel (op_timeout);
op_timeout = NULL;
}
ret = 0;
- end = GNUNET_SCHEDULER_add_now (&shutdown_task,
- NULL);
+ GNUNET_SCHEDULER_shutdown ();
}
}
@@ -1950,10 +1933,9 @@ testservice_task (void *cls,
GNUNET_break(0);
return;
}
-
- end = GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_FOREVER_REL,
- &shutdown_task,
- NULL);
+
+ GNUNET_SCHEDULER_add_shutdown (&shutdown_task,
+ NULL);
}
diff --git a/src/transport/plugin_transport_http_client.c b/src/transport/plugin_transport_http_client.c
index 2b0b8939e..132406799 100644
--- a/src/transport/plugin_transport_http_client.c
+++ b/src/transport/plugin_transport_http_client.c
@@ -226,17 +226,17 @@ struct GNUNET_ATS_Session
/**
* Session timeout task
*/
- struct GNUNET_SCHEDULER_Task * put_disconnect_task;
+ struct GNUNET_SCHEDULER_Task *put_disconnect_task;
/**
* Session timeout task
*/
- struct GNUNET_SCHEDULER_Task * timeout_task;
+ struct GNUNET_SCHEDULER_Task *timeout_task;
/**
* Task to wake up client receive handle when receiving is allowed again
*/
- struct GNUNET_SCHEDULER_Task * recv_wakeup_task;
+ struct GNUNET_SCHEDULER_Task *recv_wakeup_task;
/**
* Absolute time when to receive data again.
@@ -1130,12 +1130,8 @@ static void
client_wake_up (void *cls)
{
struct GNUNET_ATS_Session *s = cls;
- const struct GNUNET_SCHEDULER_TaskContext *tc;
s->recv_wakeup_task = NULL;
- tc = GNUNET_SCHEDULER_get_task_context ();
- if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
- return;
LOG (GNUNET_ERROR_TYPE_DEBUG,
"Session %p/request %p: Waking up GET handle\n",
s, s->get.easyhandle);
@@ -1301,13 +1297,8 @@ client_run (void *cls)
CURLMsg *msg;
int put_request; /* GNUNET_YES if easy handle is put, GNUNET_NO for get */
int msgs_left;
- const struct GNUNET_SCHEDULER_TaskContext *tc;
plugin->client_perform_task = NULL;
- tc = GNUNET_SCHEDULER_get_task_context ();
- if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
- return;
-
/* While data are available or timeouts occured */
do
{
@@ -2379,8 +2370,10 @@ http_client_plugin_update_inbound_delay (void *cls,
if (s->recv_wakeup_task != NULL)
{
GNUNET_SCHEDULER_cancel (s->recv_wakeup_task);
- s->recv_wakeup_task = GNUNET_SCHEDULER_add_delayed (delay,
- &client_wake_up, s);
+ s->recv_wakeup_task
+ = GNUNET_SCHEDULER_add_delayed (delay,
+ &client_wake_up,
+ s);
}
}
diff --git a/src/transport/plugin_transport_http_server.c b/src/transport/plugin_transport_http_server.c
index dfd0294e5..c43124c2e 100644
--- a/src/transport/plugin_transport_http_server.c
+++ b/src/transport/plugin_transport_http_server.c
@@ -374,17 +374,17 @@ struct HTTP_Server_Plugin
/**
* MHD IPv4 task
*/
- struct GNUNET_SCHEDULER_Task * server_v4_task;
+ struct GNUNET_SCHEDULER_Task *server_v4_task;
/**
* MHD IPv6 task
*/
- struct GNUNET_SCHEDULER_Task * server_v6_task;
+ struct GNUNET_SCHEDULER_Task *server_v6_task;
/**
* Task calling transport service about external address
*/
- struct GNUNET_SCHEDULER_Task * notify_ext_task;
+ struct GNUNET_SCHEDULER_Task *notify_ext_task;
/**
* Notify transport only about external address
@@ -496,12 +496,8 @@ static void
server_wake_up (void *cls)
{
struct GNUNET_ATS_Session *s = cls;
- const struct GNUNET_SCHEDULER_TaskContext *tc;
- tc = GNUNET_SCHEDULER_get_task_context ();
s->recv_wakeup_task = NULL;
- if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
- return;
LOG (GNUNET_ERROR_TYPE_DEBUG,
"Session %p: Waking up PUT handle\n",
s);
@@ -913,12 +909,8 @@ static void
server_v4_run (void *cls)
{
struct HTTP_Server_Plugin *plugin = cls;
- const struct GNUNET_SCHEDULER_TaskContext *tc;
plugin->server_v4_task = NULL;
- tc = GNUNET_SCHEDULER_get_task_context ();
- if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
- return;
plugin->server_v4_immediately = GNUNET_NO;
GNUNET_assert (MHD_YES == MHD_run (plugin->server_v4));
server_reschedule (plugin, plugin->server_v4, GNUNET_NO);
@@ -935,12 +927,8 @@ static void
server_v6_run (void *cls)
{
struct HTTP_Server_Plugin *plugin = cls;
- const struct GNUNET_SCHEDULER_TaskContext *tc;
plugin->server_v6_task = NULL;
- tc = GNUNET_SCHEDULER_get_task_context ();
- if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
- return;
plugin->server_v6_immediately = GNUNET_NO;
GNUNET_assert (MHD_YES == MHD_run (plugin->server_v6));
server_reschedule (plugin, plugin->server_v6, GNUNET_NO);
@@ -1869,8 +1857,10 @@ server_access_cb (void *cls,
GNUNET_assert(s->server_recv->mhd_conn == mhd_connection);
MHD_suspend_connection (s->server_recv->mhd_conn);
if (NULL == s->recv_wakeup_task)
- s->recv_wakeup_task = GNUNET_SCHEDULER_add_delayed (delay,
- &server_wake_up, s);
+ s->recv_wakeup_task
+ = GNUNET_SCHEDULER_add_delayed (delay,
+ &server_wake_up,
+ s);
}
return MHD_YES;
}
@@ -2851,18 +2841,12 @@ server_notify_external_hostname (void *cls)
size_t ext_addr_len;
unsigned int urlen;
char *url;
- const struct GNUNET_SCHEDULER_TaskContext *tc;
plugin->notify_ext_task = NULL;
- tc = GNUNET_SCHEDULER_get_task_context ();
- if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
- return;
-
- GNUNET_asprintf(&url,
- "%s://%s",
- plugin->protocol,
- plugin->external_hostname);
-
+ GNUNET_asprintf (&url,
+ "%s://%s",
+ plugin->protocol,
+ plugin->external_hostname);
urlen = strlen (url) + 1;
ext_addr = GNUNET_malloc (sizeof (struct HttpAddress) + urlen);
ext_addr->options = htonl (plugin->options);
@@ -2881,13 +2865,23 @@ server_notify_external_hostname (void *cls)
"Enabling SSL verification for external hostname address `%s'\n",
plugin->external_hostname);
plugin->ext_addr = GNUNET_HELLO_address_allocate (plugin->env->my_identity,
- "https_client", ext_addr, ext_addr_len, GNUNET_HELLO_ADDRESS_INFO_NONE );
- plugin->env->notify_address (plugin->env->cls, GNUNET_YES, plugin->ext_addr);
+ "https_client",
+ ext_addr,
+ ext_addr_len,
+ GNUNET_HELLO_ADDRESS_INFO_NONE);
+ plugin->env->notify_address (plugin->env->cls,
+ GNUNET_YES,
+ plugin->ext_addr);
GNUNET_free (ext_addr);
#else
plugin->ext_addr = GNUNET_HELLO_address_allocate (plugin->env->my_identity,
- "http_client", ext_addr, ext_addr_len, GNUNET_HELLO_ADDRESS_INFO_NONE );
- plugin->env->notify_address (plugin->env->cls, GNUNET_YES, plugin->ext_addr);
+ "http_client",
+ ext_addr,
+ ext_addr_len,
+ GNUNET_HELLO_ADDRESS_INFO_NONE);
+ plugin->env->notify_address (plugin->env->cls,
+ GNUNET_YES,
+ plugin->ext_addr);
GNUNET_free (ext_addr);
#endif
}
diff --git a/src/transport/plugin_transport_udp.c b/src/transport/plugin_transport_udp.c
index 89feb8f5c..b5706f024 100644
--- a/src/transport/plugin_transport_udp.c
+++ b/src/transport/plugin_transport_udp.c
@@ -3516,13 +3516,11 @@ udp_plugin_select_v4 (void *cls)
{
struct Plugin *plugin = cls;
const struct GNUNET_SCHEDULER_TaskContext *tc;
-
- tc = GNUNET_SCHEDULER_get_task_context ();
+
plugin->select_task_v4 = NULL;
- if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
- return;
if (NULL == plugin->sockv4)
return;
+ tc = GNUNET_SCHEDULER_get_task_context ();
if ((0 != (tc->reason & GNUNET_SCHEDULER_REASON_READ_READY)) &&
(GNUNET_NETWORK_fdset_isset (tc->read_ready,
plugin->sockv4)))
@@ -3547,12 +3545,10 @@ udp_plugin_select_v6 (void *cls)
struct Plugin *plugin = cls;
const struct GNUNET_SCHEDULER_TaskContext *tc;
- tc = GNUNET_SCHEDULER_get_task_context ();
plugin->select_task_v6 = NULL;
- if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
- return;
if (NULL == plugin->sockv6)
return;
+ tc = GNUNET_SCHEDULER_get_task_context ();
if ( (0 != (tc->reason & GNUNET_SCHEDULER_REASON_READ_READY)) &&
(GNUNET_NETWORK_fdset_isset (tc->read_ready,
plugin->sockv6)) )
diff --git a/src/transport/plugin_transport_unix.c b/src/transport/plugin_transport_unix.c
index e320785d4..d0566c2d3 100644
--- a/src/transport/plugin_transport_unix.c
+++ b/src/transport/plugin_transport_unix.c
@@ -1229,11 +1229,9 @@ unix_plugin_select_read (void *cls)
{
struct Plugin *plugin = cls;
const struct GNUNET_SCHEDULER_TaskContext *tc;
-
- tc = GNUNET_SCHEDULER_get_task_context ();
+
plugin->read_task = NULL;
- if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
- return;
+ tc = GNUNET_SCHEDULER_get_task_context ();
if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_READ_READY))
unix_plugin_do_read (plugin);
plugin->read_task =
@@ -1254,11 +1252,9 @@ unix_plugin_select_write (void *cls)
{
struct Plugin *plugin = cls;
const struct GNUNET_SCHEDULER_TaskContext *tc;
-
- tc = GNUNET_SCHEDULER_get_task_context ();
+
plugin->write_task = NULL;
- if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
- return;
+ tc = GNUNET_SCHEDULER_get_task_context ();
if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_WRITE_READY))
unix_plugin_do_write (plugin);
if (NULL == plugin->msg_head)
diff --git a/src/transport/test_transport_api.c b/src/transport/test_transport_api.c
index 13333b371..528b8f2bf 100644
--- a/src/transport/test_transport_api.c
+++ b/src/transport/test_transport_api.c
@@ -228,12 +228,7 @@ notify_ready (void *cls, size_t size, void *buf)
static void
sendtask (void *cls)
{
- const struct GNUNET_SCHEDULER_TaskContext *tc;
-
send_task = NULL;
- tc = GNUNET_SCHEDULER_get_task_context ();
- if ((tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN) != 0)
- return;
char *receiver_s = GNUNET_strdup (GNUNET_i2s (&p1->id));
GNUNET_log (GNUNET_ERROR_TYPE_INFO,
diff --git a/src/transport/test_transport_api_bidirectional_connect.c b/src/transport/test_transport_api_bidirectional_connect.c
index 1e00e982d..a5d6b6b71 100644
--- a/src/transport/test_transport_api_bidirectional_connect.c
+++ b/src/transport/test_transport_api_bidirectional_connect.c
@@ -210,14 +210,10 @@ notify_ready (void *cls, size_t size, void *buf)
static void
sendtask (void *cls)
{
- const struct GNUNET_SCHEDULER_TaskContext *tc;
+ char *receiver_s;
send_task = NULL;
- tc = GNUNET_SCHEDULER_get_task_context ();
- if ((tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN) != 0)
- return;
- char *receiver_s = GNUNET_strdup (GNUNET_i2s (&p1->id));
-
+ receiver_s = GNUNET_strdup (GNUNET_i2s (&p1->id));
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"Sending message from peer %u (`%4s') -> peer %u (`%s') !\n",
p2->no, GNUNET_i2s (&p2->id), p1->no, receiver_s);
diff --git a/src/transport/test_transport_api_blacklisting.c b/src/transport/test_transport_api_blacklisting.c
index f65fb74f9..963d3b045 100644
--- a/src/transport/test_transport_api_blacklisting.c
+++ b/src/transport/test_transport_api_blacklisting.c
@@ -262,12 +262,7 @@ notify_ready (void *cls, size_t size, void *buf)
static void
sendtask (void *cls)
{
- const struct GNUNET_SCHEDULER_TaskContext *tc;
-
send_task = NULL;
- tc = GNUNET_SCHEDULER_get_task_context ();
- if ((tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN) != 0)
- return;
char *receiver_s = GNUNET_strdup (GNUNET_i2s (&p1->id));
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
diff --git a/src/transport/test_transport_api_disconnect.c b/src/transport/test_transport_api_disconnect.c
index 36497ece5..f52634bde 100644
--- a/src/transport/test_transport_api_disconnect.c
+++ b/src/transport/test_transport_api_disconnect.c
@@ -165,12 +165,6 @@ notify_disconnect (void *cls, const struct GNUNET_PeerIdentity *peer)
static void
stop_peer (void *cls)
{
- const struct GNUNET_SCHEDULER_TaskContext *tc;
-
- tc = GNUNET_SCHEDULER_get_task_context ();
- if ((tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN) != 0)
- return;
-
struct PeerContext *p = cls;
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Shutting down peer %u (`%s')\n", p->no,
@@ -254,12 +248,7 @@ notify_ready (void *cls, size_t size, void *buf)
static void
sendtask (void *cls)
{
- const struct GNUNET_SCHEDULER_TaskContext *tc;
-
send_task = NULL;
- tc = GNUNET_SCHEDULER_get_task_context ();
- if ((tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN) != 0)
- return;
char *receiver_s = GNUNET_strdup (GNUNET_i2s (&p1->id));
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
diff --git a/src/transport/test_transport_api_http_reverse_peer2.conf b/src/transport/test_transport_api_http_reverse_peer2.conf
index 7117895ef..136c09008 100644
--- a/src/transport/test_transport_api_http_reverse_peer2.conf
+++ b/src/transport/test_transport_api_http_reverse_peer2.conf
@@ -10,4 +10,3 @@ EXTERNAL_HOSTNAME_ONLY = YES
[transport]
PLUGINS = http_server
-
diff --git a/src/transport/test_transport_api_https_peer1.conf b/src/transport/test_transport_api_https_peer1.conf
index 8fc2edf2e..c6a083f37 100644
--- a/src/transport/test_transport_api_https_peer1.conf
+++ b/src/transport/test_transport_api_https_peer1.conf
@@ -21,5 +21,6 @@ UNIXPATH = $GNUNET_RUNTIME_DIR/gnunet-p1-service-peerinfo.sock
PORT = 12101
PLUGINS = https_client
UNIXPATH = $GNUNET_RUNTIME_DIR/gnunet-p1-service-transport.sock
+#PREFIX = valgrind
diff --git a/src/transport/test_transport_api_https_peer2.conf b/src/transport/test_transport_api_https_peer2.conf
index d2bf20011..49210651c 100644
--- a/src/transport/test_transport_api_https_peer2.conf
+++ b/src/transport/test_transport_api_https_peer2.conf
@@ -27,5 +27,6 @@ UNIXPATH = $GNUNET_RUNTIME_DIR/gnunet-p2-service-peerinfo.sock
PORT = 12111
PLUGINS = https_server
UNIXPATH = $GNUNET_RUNTIME_DIR/gnunet-p2-service-transport.sock
+#PREFIX = valgrind
diff --git a/src/transport/test_transport_api_limited_sockets.c b/src/transport/test_transport_api_limited_sockets.c
index 8d875ed52..0ae807077 100644
--- a/src/transport/test_transport_api_limited_sockets.c
+++ b/src/transport/test_transport_api_limited_sockets.c
@@ -198,13 +198,7 @@ notify_disconnect (void *cls, const struct GNUNET_PeerIdentity *peer)
static void
sendtask (void *cls)
{
- const struct GNUNET_SCHEDULER_TaskContext *tc;
-
send_task = NULL;
- tc = GNUNET_SCHEDULER_get_task_context ();
- if ((tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN) != 0)
- return;
-
th = GNUNET_TRANSPORT_notify_transmit_ready (p1->th, &p2->id, 256, TIMEOUT,
&notify_ready, &p1);
}
diff --git a/src/transport/test_transport_api_manipulation_cfg.c b/src/transport/test_transport_api_manipulation_cfg.c
index 915b79719..fe3d31f7b 100644
--- a/src/transport/test_transport_api_manipulation_cfg.c
+++ b/src/transport/test_transport_api_manipulation_cfg.c
@@ -206,12 +206,7 @@ notify_request_ready (void *cls, size_t size, void *buf)
static void
sendtask_request_task (void *cls)
{
- const struct GNUNET_SCHEDULER_TaskContext *tc;
-
send_task = NULL;
- tc = GNUNET_SCHEDULER_get_task_context ();
- if ((tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN) != 0)
- return;
char *receiver_s = GNUNET_strdup (GNUNET_i2s (&p2->id));
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
@@ -272,12 +267,7 @@ notify_response_ready (void *cls, size_t size, void *buf)
static void
sendtask_response_task (void *cls)
{
- const struct GNUNET_SCHEDULER_TaskContext *tc;
-
send_task = NULL;
- tc = GNUNET_SCHEDULER_get_task_context ();
- if ((tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN) != 0)
- return;
{
char *receiver_s = GNUNET_strdup (GNUNET_i2s (&p1->id));
diff --git a/src/transport/test_transport_api_manipulation_recv_tcp.c b/src/transport/test_transport_api_manipulation_recv_tcp.c
index 7b82236f9..02c9408a6 100644
--- a/src/transport/test_transport_api_manipulation_recv_tcp.c
+++ b/src/transport/test_transport_api_manipulation_recv_tcp.c
@@ -292,12 +292,7 @@ notify_ready (void *cls, size_t size, void *buf)
static void
sendtask (void *cls)
{
- const struct GNUNET_SCHEDULER_TaskContext *tc;
-
send_task = NULL;
- tc = GNUNET_SCHEDULER_get_task_context ();
- if ((tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN) != 0)
- return;
char *receiver_s = GNUNET_strdup (GNUNET_i2s (&p1->id));
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
diff --git a/src/transport/test_transport_api_manipulation_send_tcp.c b/src/transport/test_transport_api_manipulation_send_tcp.c
index 22b420c27..e031b7111 100644
--- a/src/transport/test_transport_api_manipulation_send_tcp.c
+++ b/src/transport/test_transport_api_manipulation_send_tcp.c
@@ -288,12 +288,8 @@ sendtask (void *cls)
{
struct GNUNET_TIME_Relative delay;
struct GNUNET_ATS_Properties prop;
- const struct GNUNET_SCHEDULER_TaskContext *tc;
send_task = NULL;
- tc = GNUNET_SCHEDULER_get_task_context ();
- if ((tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN) != 0)
- return;
char *receiver_s = GNUNET_strdup (GNUNET_i2s (&p1->id));
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
diff --git a/src/transport/test_transport_api_monitor_peers.c b/src/transport/test_transport_api_monitor_peers.c
index 79b39325c..549394944 100644
--- a/src/transport/test_transport_api_monitor_peers.c
+++ b/src/transport/test_transport_api_monitor_peers.c
@@ -262,12 +262,7 @@ notify_ready (void *cls, size_t size, void *buf)
static void
sendtask (void *cls)
{
- const struct GNUNET_SCHEDULER_TaskContext *tc;
-
send_task = NULL;
- tc = GNUNET_SCHEDULER_get_task_context ();
- if ((tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN) != 0)
- return;
char *receiver_s = GNUNET_strdup (GNUNET_i2s (&p1->id));
GNUNET_log (GNUNET_ERROR_TYPE_INFO,
diff --git a/src/transport/test_transport_api_monitor_validation.c b/src/transport/test_transport_api_monitor_validation.c
index 37b8494f1..49550e011 100644
--- a/src/transport/test_transport_api_monitor_validation.c
+++ b/src/transport/test_transport_api_monitor_validation.c
@@ -275,12 +275,7 @@ notify_ready (void *cls,
static void
sendtask (void *cls)
{
- const struct GNUNET_SCHEDULER_TaskContext *tc;
-
send_task = NULL;
- tc = GNUNET_SCHEDULER_get_task_context ();
- if ((tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN) != 0)
- return;
char *receiver_s = GNUNET_strdup (GNUNET_i2s (&p1->id));
GNUNET_log (GNUNET_ERROR_TYPE_INFO,
diff --git a/src/transport/test_transport_api_restart_1peer.c b/src/transport/test_transport_api_restart_1peer.c
index adec15f4f..50f9ebb9c 100644
--- a/src/transport/test_transport_api_restart_1peer.c
+++ b/src/transport/test_transport_api_restart_1peer.c
@@ -260,12 +260,7 @@ notify_ready (void *cls, size_t size, void *buf)
static void
sendtask (void *cls)
{
- const struct GNUNET_SCHEDULER_TaskContext *tc;
-
send_task = NULL;
- tc = GNUNET_SCHEDULER_get_task_context ();
- if ((tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN) != 0)
- return;
char *receiver_s = GNUNET_strdup (GNUNET_i2s (&p1->id));
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
diff --git a/src/transport/test_transport_api_restart_2peers.c b/src/transport/test_transport_api_restart_2peers.c
index 2a669c9a0..18cc87c78 100644
--- a/src/transport/test_transport_api_restart_2peers.c
+++ b/src/transport/test_transport_api_restart_2peers.c
@@ -266,13 +266,7 @@ notify_ready (void *cls,
static void
sendtask (void *cls)
{
- const struct GNUNET_SCHEDULER_TaskContext *tc;
-
send_task = NULL;
- tc = GNUNET_SCHEDULER_get_task_context ();
- if ((tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN) != 0)
- return;
-
{
char *receiver_s = GNUNET_strdup (GNUNET_i2s (&p1->id));
diff --git a/src/transport/test_transport_api_timeout.c b/src/transport/test_transport_api_timeout.c
index aa9884a2e..89fabdefd 100644
--- a/src/transport/test_transport_api_timeout.c
+++ b/src/transport/test_transport_api_timeout.c
@@ -185,13 +185,8 @@ static void
timer (void *cls)
{
static int percentage;
- const struct GNUNET_SCHEDULER_TaskContext *tc;
timer_task = NULL;
- tc = GNUNET_SCHEDULER_get_task_context ();
- if ((tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN) != 0)
- return;
-
percentage += 10;
time_running =
GNUNET_TIME_relative_add (time_running,
@@ -213,6 +208,7 @@ timer (void *cls)
}
}
+
static void
testing_connect_cb (struct PeerContext *p1, struct PeerContext *p2, void *cls)
{
diff --git a/src/transport/test_transport_startonly.c b/src/transport/test_transport_startonly.c
index d49e3a8c0..7dd4984e2 100644
--- a/src/transport/test_transport_startonly.c
+++ b/src/transport/test_transport_startonly.c
@@ -67,15 +67,9 @@ end ()
static void
end_badly (void *cls)
{
- const struct GNUNET_SCHEDULER_TaskContext *tc;
-
- tc = GNUNET_SCHEDULER_get_task_context ();
- GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Fail! Stopping peers\n");
-
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+ "Fail! Stopping peers\n");
timeout_task = NULL;
- if ((tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN) != 0)
- return;
-
if (p1 != NULL)
GNUNET_TRANSPORT_TESTING_stop_peer (tth, p1);
if (NULL != tth)
@@ -83,6 +77,7 @@ end_badly (void *cls)
ret = GNUNET_SYSERR;
}
+
static void
notify_connect (void *cls, const struct GNUNET_PeerIdentity *peer)
{
@@ -91,6 +86,7 @@ notify_connect (void *cls, const struct GNUNET_PeerIdentity *peer)
connected++;
}
+
static void
notify_disconnect (void *cls, const struct GNUNET_PeerIdentity *peer)
{
@@ -98,6 +94,7 @@ notify_disconnect (void *cls, const struct GNUNET_PeerIdentity *peer)
GNUNET_i2s (peer));
}
+
static void
notify_receive (void *cls, const struct GNUNET_PeerIdentity *peer,
const struct GNUNET_MessageHeader *message)
diff --git a/src/transport/transport-testing.c b/src/transport/transport-testing.c
index 652a4e08f..4a514ea72 100644
--- a/src/transport/transport-testing.c
+++ b/src/transport/transport-testing.c
@@ -220,7 +220,7 @@ hello_offered (void *cls)
/**
* Offer the current HELLO of P2 to P1.
*
- * @param cls our `struct GNUNET_TRANSPORT_TESTING_ConnectRequest `
+ * @param cls our `struct GNUNET_TRANSPORT_TESTING_ConnectRequest`
*/
static void
offer_hello (void *cls)
@@ -228,12 +228,8 @@ offer_hello (void *cls)
struct GNUNET_TRANSPORT_TESTING_ConnectRequest *cc = cls;
struct PeerContext *p1 = cc->p1;
struct PeerContext *p2 = cc->p2;
- const struct GNUNET_SCHEDULER_TaskContext *tc;
cc->tct = NULL;
- tc = GNUNET_SCHEDULER_get_task_context ();
- if ((tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN) != 0)
- return;
{
char *p2_s = GNUNET_strdup (GNUNET_i2s (&p2->id));
diff --git a/src/transport/transport_api.c b/src/transport/transport_api.c
index 6fc538f25..59f249686 100644
--- a/src/transport/transport_api.c
+++ b/src/transport/transport_api.c
@@ -1196,15 +1196,8 @@ static void
reconnect (void *cls)
{
struct GNUNET_TRANSPORT_Handle *h = cls;
- const struct GNUNET_SCHEDULER_TaskContext *tc;
h->reconnect_task = NULL;
- tc = GNUNET_SCHEDULER_get_task_context ();
- if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
- {
- /* shutdown, just give up */
- return;
- }
LOG (GNUNET_ERROR_TYPE_DEBUG,
"Connecting to transport service.\n");
GNUNET_assert (NULL == h->client);