/*
This file is part of GNUnet
- Copyright (C) 2002-2014 Christian Grothoff (and other contributing authors)
+ Copyright (C) 2002-2014 GNUnet e.V.
GNUnet is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published
/**
* 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.
* @param tc gnunet scheduler task context
*/
static void
-client_run (void *cls,
- const struct GNUNET_SCHEDULER_TaskContext *tc);
+client_run (void *cls);
/**
ttype = "UNSPECIFIED";
break;
}
- memcpy (text, data, size);
+ GNUNET_memcpy (text, data, size);
if (text[size - 1] == '\n')
{
text[size] = '\0';
msg->buf = (char *) &msg[1];
msg->transmit_cont = cont;
msg->transmit_cont_cls = cont_cls;
- memcpy (msg->buf,
+ GNUNET_memcpy (msg->buf,
msgbuf,
msgbuf_size);
GNUNET_CONTAINER_DLL_insert_tail (s->msg_head,
* is the delayed task that actually disconnects the PUT.
*
* @param cls the `struct GNUNET_ATS_Session *` with the put
- * @param tc scheduler context
*/
static void
-client_put_disconnect (void *cls,
- const struct GNUNET_SCHEDULER_TaskContext *tc)
+client_put_disconnect (void *cls)
{
struct GNUNET_ATS_Session *s = cls;
"Session %p/request %p: nothing to send, suspending\n",
s,
s->put.easyhandle);
- s->put_disconnect_task = GNUNET_SCHEDULER_add_delayed (PUT_DISCONNECT_TIMEOUT,
- &client_put_disconnect, s);
+ s->put_disconnect_task
+ = GNUNET_SCHEDULER_add_delayed (PUT_DISCONNECT_TIMEOUT,
+ &client_put_disconnect,
+ s);
s->put.state = H_PAUSED;
return CURL_READFUNC_PAUSE;
}
/* calculate how much fits in buffer */
len = GNUNET_MIN (msg->size - msg->pos,
size * nmemb);
- memcpy (stream, &msg->buf[msg->pos], len);
+ GNUNET_memcpy (stream,
+ &msg->buf[msg->pos],
+ len);
msg->pos += len;
if (msg->pos == msg->size)
{
* Wake up a curl handle which was suspended
*
* @param cls the session
- * @param tc task context
*/
static void
-client_wake_up (void *cls,
- const struct GNUNET_SCHEDULER_TaskContext *tc)
+client_wake_up (void *cls)
{
struct GNUNET_ATS_Session *s = cls;
s->recv_wakeup_task = NULL;
- 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);
* Task performing curl operations
*
* @param cls plugin as closure
- * @param tc scheduler task context
*/
static void
-client_run (void *cls,
- const struct GNUNET_SCHEDULER_TaskContext *tc)
+client_run (void *cls)
{
struct HTTP_Client_Plugin *plugin = cls;
int running;
int msgs_left;
plugin->client_perform_task = NULL;
- if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
- return;
-
/* While data are available or timeouts occured */
do
{
* Session was idle, so disconnect it
*
* @param cls the `struct GNUNET_ATS_Session` of the idle session
- * @param tc scheduler context
*/
static void
-client_session_timeout (void *cls,
- const struct GNUNET_SCHEDULER_TaskContext *tc)
+client_session_timeout (void *cls)
{
struct GNUNET_ATS_Session *s = cls;
struct GNUNET_TIME_Relative left;
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);
}
}