static char* allow_headers;
/**
- * MHD Connection handle
+ * MHD Connection handle
*/
struct MhdConnectionHandle
{
* Task run whenever HTTP server operations are pending.
*
* @param cls NULL
- * @param tc sched context
*/
static void
-do_httpd (void *cls,
- const struct GNUNET_SCHEDULER_TaskContext *tc);
+do_httpd (void *cls);
/**
struct MhdConnectionHandle *handle = cls;
handle->status = status;
handle->response = resp;
- run_mhd_now();
+ run_mhd_now();
}
struct RestConnectionDataHandle *handle = cls;
struct GNUNET_HashCode hkey;
char *val;
-
+
GNUNET_CRYPTO_hash (key, strlen (key), &hkey);
GNUNET_asprintf (&val, "%s", value);
if (GNUNET_OK !=
httpd = NULL;
}
if (NULL != httpd_task)
- {
+ {
GNUNET_SCHEDULER_cancel (httpd_task);
httpd_task = NULL;
}
* Task run whenever HTTP server is idle for too long. Kill it.
*
* @param cls NULL
- * @param tc sched context
*/
static void
-kill_httpd_task (void *cls,
- const struct GNUNET_SCHEDULER_TaskContext *tc)
+kill_httpd_task (void *cls)
{
httpd_task = NULL;
kill_httpd ();
* Task run whenever HTTP server operations are pending.
*
* @param cls NULL
- * @param tc scheduler context
*/
static void
-do_httpd (void *cls,
- const struct GNUNET_SCHEDULER_TaskContext *tc)
+do_httpd (void *cls)
{
httpd_task = NULL;
MHD_run (httpd);
* @param tc the scheduler context
*/
static void
-do_accept (void *cls,
- const struct GNUNET_SCHEDULER_TaskContext *tc)
+do_accept (void *cls)
{
struct GNUNET_NETWORK_Handle *lsock = cls;
+ const struct GNUNET_SCHEDULER_TaskContext *tc;
struct GNUNET_NETWORK_Handle *s;
int fd;
const struct sockaddr *addr;
ltask4 = NULL;
else
ltask6 = NULL;
+ tc = GNUNET_SCHEDULER_get_task_context ();
if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
- return;
+ return;
if (lsock == lsock4)
ltask4 = GNUNET_SCHEDULER_add_read_net (GNUNET_TIME_UNIT_FOREVER_REL,
lsock,
* Task run on shutdown
*
* @param cls closure
- * @param tc task context
*/
static void
-do_shutdown (void *cls,
- const struct GNUNET_SCHEDULER_TaskContext *tc)
+do_shutdown (void *cls)
{
GNUNET_log (GNUNET_ERROR_TYPE_INFO,
"Shutting down...\n");
sa4.sin_port = htons (port);
#if HAVE_SOCKADDR_IN_SIN_LEN
sa4.sin_len = sizeof (sa4);
-#endif
+#endif
ls = GNUNET_NETWORK_socket_create (AF_INET,
SOCK_STREAM,
0);
sa6.sin6_port = htons (port);
#if HAVE_SOCKADDR_IN_SIN_LEN
sa6.sin6_len = sizeof (sa6);
-#endif
+#endif
ls = GNUNET_NETWORK_socket_create (AF_INET6,
SOCK_STREAM,
0);
* @param c configuration
*/
static void
-run (void *cls,
- char *const *args,
+run (void *cls,
+ char *const *args,
const char *cfgfile,
const struct GNUNET_CONFIGURATION_Handle *c)
{
{
GNUNET_SCHEDULER_shutdown ();
return;
- }
+ }
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"Service listens on port %u\n",
port);