GNUnet 0.27.0
 
Loading...
Searching...
No Matches
helper.c
Go to the documentation of this file.
1/*
2 This file is part of GNUnet.
3 Copyright (C) 2011, 2012 Christian Grothoff
4
5 GNUnet is free software: you can redistribute it and/or modify it
6 under the terms of the GNU Affero General Public License as published
7 by the Free Software Foundation, either version 3 of the License,
8 or (at your option) any later version.
9
10 GNUnet is distributed in the hope that it will be useful, but
11 WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Affero General Public License for more details.
14
15 You should have received a copy of the GNU Affero General Public License
16 along with this program. If not, see <http://www.gnu.org/licenses/>.
17
18 SPDX-License-Identifier: AGPL3.0-or-later
19 */
20
28#include "platform.h"
29#include "gnunet_util_lib.h"
30
71
72
163
164
167{
169 int ret;
170
171 while (NULL != (sh = h->sh_head))
172 {
173 GNUNET_CONTAINER_DLL_remove (h->sh_head, h->sh_tail, sh);
174 if (NULL != sh->cont)
175 sh->cont (sh->cont_cls, GNUNET_NO);
176 GNUNET_free (sh);
177 }
178 if (NULL != h->restart_task)
179 {
180 GNUNET_SCHEDULER_cancel (h->restart_task);
181 h->restart_task = NULL;
182 }
183 if (NULL != h->read_task)
184 {
185 GNUNET_SCHEDULER_cancel (h->read_task);
186 h->read_task = NULL;
187 }
188 if (NULL == h->helper_proc)
189 return GNUNET_SYSERR;
190 if (GNUNET_YES == soft_kill)
191 {
192 /* soft-kill only possible with pipes */
193 GNUNET_assert (NULL != h->helper_in);
194 ret = GNUNET_DISK_pipe_close (h->helper_in);
195 h->helper_in = NULL;
196 h->fh_to_helper = NULL;
197 return ret;
198 }
199 if (GNUNET_OK !=
200 GNUNET_process_kill (h->helper_proc,
202 return GNUNET_SYSERR;
203 return GNUNET_OK;
204}
205
206
209{
212
214 if (NULL != h->helper_proc)
215 {
216 ret = GNUNET_process_wait (h->helper_proc,
217 true,
218 NULL,
219 NULL);
220 GNUNET_process_destroy (h->helper_proc);
221 h->helper_proc = NULL;
222 }
223 if (NULL != h->read_task)
224 {
225 GNUNET_SCHEDULER_cancel (h->read_task);
226 h->read_task = NULL;
227 }
228 if (NULL != h->write_task)
229 {
230 GNUNET_SCHEDULER_cancel (h->write_task);
231 h->write_task = NULL;
232 }
233 if (NULL != h->helper_in)
234 {
235 GNUNET_DISK_pipe_close (h->helper_in);
236 h->helper_in = NULL;
237 h->fh_to_helper = NULL;
238 }
239 if (NULL != h->helper_out)
240 {
241 GNUNET_DISK_pipe_close (h->helper_out);
242 h->helper_out = NULL;
243 h->fh_from_helper = NULL;
244 }
245 while (NULL != (sh = h->sh_head))
246 {
248 h->sh_tail,
249 sh);
250 if (NULL != sh->cont)
251 sh->cont (sh->cont_cls,
252 GNUNET_NO);
253 GNUNET_free (sh);
254 }
255 /* purge MST buffer */
256 if (NULL != h->mst)
257 (void) GNUNET_MST_from_buffer (h->mst,
258 NULL,
259 0,
261 GNUNET_NO);
262 return ret;
263}
264
265
273static void
275 int soft_kill)
276{
277 if (NULL != h->restart_task)
278 {
279 GNUNET_SCHEDULER_cancel (h->restart_task);
280 h->restart_task = NULL;
281 }
282 else
283 {
286 soft_kill));
289 }
290}
291
292
298static void
299restart_task (void *cls);
300
301
307static void
308helper_read (void *cls)
309{
310 struct GNUNET_HELPER_Handle *h = cls;
312 ssize_t t;
313
314 h->read_task = NULL;
315 t = GNUNET_DISK_file_read (h->fh_from_helper, &buf, sizeof(buf));
316 if (t < 0)
317 {
318 /* On read-error, restart the helper */
320 _ ("Error reading from `%s': %s\n"),
321 h->binary_name,
322 strerror (errno));
323 if (NULL != h->exp_cb)
324 {
325 h->exp_cb (h->cb_cls);
327 return;
328 }
330 /* Restart the helper */
331 h->restart_task = GNUNET_SCHEDULER_add_delayed (
333 h->retry_back_off),
335 h);
336 return;
337 }
338 if (0 == t)
339 {
340 /* this happens if the helper is shut down via a
341 signal, so it is not a "hard" error */
343 "Got 0 bytes from helper `%s' (EOF)\n",
344 h->binary_name);
345 if (NULL != h->exp_cb)
346 {
347 h->exp_cb (h->cb_cls);
349 return;
350 }
352 /* Restart the helper */
353 h->restart_task = GNUNET_SCHEDULER_add_delayed (
355 h->retry_back_off),
357 h);
358 return;
359 }
361 "Got %u bytes from helper `%s'\n",
362 (unsigned int) t,
363 h->binary_name);
365 h->fh_from_helper,
367 h);
368 if (GNUNET_SYSERR ==
370 {
372 _ ("Failed to parse inbound message from helper `%s'\n"),
373 h->binary_name);
374 if (NULL != h->exp_cb)
375 {
376 h->exp_cb (h->cb_cls);
378 return;
379 }
381 /* Restart the helper */
382 h->restart_task = GNUNET_SCHEDULER_add_delayed (
384 h->retry_back_off),
386 h);
387 return;
388 }
389}
390
391
397static void
399{
400 h->helper_in =
402 h->helper_out =
404 if ((h->helper_in == NULL) || (h->helper_out == NULL))
405 {
406 /* out of file descriptors? try again later... */
408 "out of file descriptors? try again later\n");
410 h->restart_task = GNUNET_SCHEDULER_add_delayed (
412 h->retry_back_off),
414 h);
415 return;
416 }
418 "Starting HELPER process `%s'\n",
419 h->binary_name);
420 h->fh_from_helper =
422 h->fh_to_helper =
424 h->helper_proc = GNUNET_process_create (h->with_control_pipe
430 h->helper_proc,
432 STDIN_FILENO),
434 STDOUT_FILENO)));
435 if (GNUNET_OK !=
437 h->binary_name,
438 (const char **) h->binary_argv))
439 {
440 /* failed to start process? try again later... */
442 "failed to start process? try again later\n");
443 stop_helper (h,
444 GNUNET_NO);
445 h->restart_task = GNUNET_SCHEDULER_add_delayed (
447 h->retry_back_off),
449 h);
450 return;
451 }
452 GNUNET_DISK_pipe_close_end (h->helper_out,
454 GNUNET_DISK_pipe_close_end (h->helper_in,
456 if (NULL != h->mst)
458 h->fh_from_helper,
460 h);
461}
462
463
469static void
470restart_task (void *cls)
471{
472 struct GNUNET_HELPER_Handle *h = cls;
473
474 h->restart_task = NULL;
475 h->retry_back_off++;
477 "Restarting helper with back-off %u\n",
478 h->retry_back_off);
479 start_helper (h);
480}
481
482
486 const char *binary_name,
487 char *const binary_argv[],
490 void *cb_cls)
491{
492 struct GNUNET_HELPER_Handle *h;
493 unsigned int c;
494
496 h->with_control_pipe = with_control_pipe;
497 /* Lookup in libexec path only if we are starting gnunet helpers */
498 if (NULL != strstr (binary_name, "gnunet"))
499 h->binary_name = GNUNET_OS_get_libexec_binary_path (pd,
501 else
502 h->binary_name = GNUNET_strdup (binary_name);
503 for (c = 0; NULL != binary_argv[c]; c++)
504 ;
505 h->binary_argv = GNUNET_malloc (sizeof(char *) * (c + 1));
506 for (c = 0; NULL != binary_argv[c]; c++)
507 h->binary_argv[c] = GNUNET_strdup (binary_argv[c]);
508 h->binary_argv[c] = NULL;
509 h->cb_cls = cb_cls;
510 if (NULL != cb)
511 h->mst = GNUNET_MST_create (cb, h->cb_cls);
512 h->exp_cb = exp_cb;
513 h->retry_back_off = 0;
514 start_helper (h);
515 return h;
516}
517
518
524void
526{
527 unsigned int c;
529
530 if (NULL != h->write_task)
531 {
532 GNUNET_SCHEDULER_cancel (h->write_task);
533 h->write_task = NULL;
534 }
535 GNUNET_assert (NULL == h->read_task);
536 GNUNET_assert (NULL == h->restart_task);
537 while (NULL != (sh = h->sh_head))
538 {
539 GNUNET_CONTAINER_DLL_remove (h->sh_head, h->sh_tail, sh);
540 if (NULL != sh->cont)
541 sh->cont (sh->cont_cls, GNUNET_SYSERR);
542 GNUNET_free (sh);
543 }
544 if (NULL != h->mst)
545 GNUNET_MST_destroy (h->mst);
546 GNUNET_free (h->binary_name);
547 for (c = 0; h->binary_argv[c] != NULL; c++)
548 GNUNET_free (h->binary_argv[c]);
549 GNUNET_free (h->binary_argv);
550 GNUNET_free (h);
551}
552
553
561void
563{
564 h->exp_cb = NULL;
565 stop_helper (h, soft_kill);
567}
568
569
575static void
576helper_write (void *cls)
577{
578 struct GNUNET_HELPER_Handle *h = cls;
580 const char *buf;
581 ssize_t t;
582
583 h->write_task = NULL;
584 if (NULL == (sh = h->sh_head))
585 {
586 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Helper write had no work!\n");
587 return; /* how did this happen? */
588 }
589 buf = (const char *) sh->msg;
590 t = GNUNET_DISK_file_write (h->fh_to_helper,
591 &buf[sh->wpos],
592 ntohs (sh->msg->size) - sh->wpos);
593 if (-1 == t)
594 {
595 /* On write-error, restart the helper */
597 _ ("Error writing to `%s': %s\n"),
598 h->binary_name,
599 strerror (errno));
600 if (NULL != h->exp_cb)
601 {
602 h->exp_cb (h->cb_cls);
604 return;
605 }
607 "Stopping and restarting helper task!\n");
609 /* Restart the helper */
610 h->restart_task = GNUNET_SCHEDULER_add_delayed (
612 h->retry_back_off),
614 h);
615 return;
616 }
618 "Transmitted %u bytes to %s\n",
619 (unsigned int) t,
620 h->binary_name);
621 sh->wpos += t;
622 if (sh->wpos == ntohs (sh->msg->size))
623 {
624 GNUNET_CONTAINER_DLL_remove (h->sh_head, h->sh_tail, sh);
625 if (NULL != sh->cont)
626 sh->cont (sh->cont_cls, GNUNET_YES);
627 GNUNET_free (sh);
628 }
629 if (NULL != h->sh_head)
630 h->write_task =
632 h->fh_to_helper,
634 h);
635}
636
637
640 const struct GNUNET_MessageHeader *msg,
641 bool can_drop,
643 void *cont_cls)
644{
646 uint16_t mlen;
647
648 if (NULL == h->fh_to_helper)
649 return NULL;
650 if (can_drop && (NULL != h->sh_head))
651 return NULL;
652 mlen = ntohs (msg->size);
653 sh = GNUNET_malloc (sizeof(struct GNUNET_HELPER_SendHandle) + mlen);
654 sh->msg = (const struct GNUNET_MessageHeader *) &sh[1];
655 GNUNET_memcpy (&sh[1], msg, mlen);
656 sh->h = h;
657 sh->cont = cont;
658 sh->cont_cls = cont_cls;
659 GNUNET_CONTAINER_DLL_insert_tail (h->sh_head, h->sh_tail, sh);
660 if (NULL == h->write_task)
661 h->write_task =
663 h->fh_to_helper,
665 h);
666
667 return sh;
668}
669
670
678void
680{
681 struct GNUNET_HELPER_Handle *h = sh->h;
682
683 sh->cont = NULL;
684 sh->cont_cls = NULL;
685 if (0 == sh->wpos)
686 {
687 GNUNET_CONTAINER_DLL_remove (h->sh_head, h->sh_tail, sh);
688 GNUNET_free (sh);
689 if (NULL == h->sh_head)
690 {
691 GNUNET_SCHEDULER_cancel (h->write_task);
692 h->write_task = NULL;
693 }
694 }
695}
696
697
698/* end of helper.c */
struct GNUNET_MessageHeader * msg
Definition 005.c:2
static struct GNUNET_ARM_Handle * h
Connection with ARM.
Definition gnunet-arm.c:98
static int ret
Final status code.
Definition gnunet-arm.c:93
static struct GNUNET_IDENTITY_Handle * sh
Handle to IDENTITY service.
static struct GNUNET_SCHEDULER_Task * t
Main task.
#define GNUNET_MAX_MESSAGE_SIZE
Largest supported message (to be precise, one byte more than the largest possible message,...
const struct GNUNET_DISK_FileHandle * GNUNET_DISK_pipe_handle(const struct GNUNET_DISK_PipeHandle *p, enum GNUNET_DISK_PipeEnd n)
Get the handle to a particular pipe end.
Definition disk.c:1703
ssize_t GNUNET_DISK_file_write(const struct GNUNET_DISK_FileHandle *h, const void *buffer, size_t n)
Write a buffer to a file.
Definition disk.c:745
struct GNUNET_DISK_PipeHandle * GNUNET_DISK_pipe(enum GNUNET_DISK_PipeFlags pf)
Creates an interprocess channel.
Definition disk.c:1524
enum GNUNET_GenericReturnValue GNUNET_DISK_pipe_close(struct GNUNET_DISK_PipeHandle *p)
Closes an interprocess channel.
Definition disk.c:1671
ssize_t GNUNET_DISK_file_read(const struct GNUNET_DISK_FileHandle *h, void *result, size_t len)
Read the contents of a binary file into a buffer.
Definition disk.c:704
enum GNUNET_GenericReturnValue GNUNET_DISK_pipe_close_end(struct GNUNET_DISK_PipeHandle *p, enum GNUNET_DISK_PipeEnd end)
Closes one half of an interprocess channel.
Definition disk.c:1618
@ GNUNET_DISK_PF_BLOCKING_RW
Configure both pipe ends for blocking operations if set.
@ GNUNET_DISK_PIPE_END_WRITE
The writing-end of a pipe.
@ GNUNET_DISK_PIPE_END_READ
The reading-end of a pipe.
#define GNUNET_CONTAINER_DLL_remove(head, tail, element)
Remove an element from a DLL.
#define GNUNET_CONTAINER_DLL_insert_tail(head, tail, element)
Insert an element at the tail of a DLL.
void GNUNET_HELPER_send_cancel(struct GNUNET_HELPER_SendHandle *sh)
Cancel a GNUNET_HELPER_send operation.
Definition helper.c:679
struct GNUNET_HELPER_SendHandle * GNUNET_HELPER_send(struct GNUNET_HELPER_Handle *h, const struct GNUNET_MessageHeader *msg, bool can_drop, GNUNET_HELPER_Continuation cont, void *cont_cls)
Send an message to the helper.
Definition helper.c:639
enum GNUNET_GenericReturnValue GNUNET_HELPER_wait(struct GNUNET_HELPER_Handle *h)
Reap the helper process.
Definition helper.c:208
struct GNUNET_HELPER_Handle * GNUNET_HELPER_start(const struct GNUNET_OS_ProjectData *pd, int with_control_pipe, const char *binary_name, char *const binary_argv[], GNUNET_MessageTokenizerCallback cb, GNUNET_HELPER_ExceptionCallback exp_cb, void *cb_cls)
Starts a helper and begins reading from it.
Definition helper.c:484
void(* GNUNET_HELPER_ExceptionCallback)(void *cls)
Callback that will be called when the helper process dies.
enum GNUNET_GenericReturnValue GNUNET_HELPER_kill(struct GNUNET_HELPER_Handle *h, int soft_kill)
Sends termination signal to the helper process.
Definition helper.c:166
void GNUNET_HELPER_stop(struct GNUNET_HELPER_Handle *h, int soft_kill)
Kills the helper, closes the pipe and frees the handle.
Definition helper.c:562
void(* GNUNET_HELPER_Continuation)(void *cls, enum GNUNET_GenericReturnValue result)
Continuation function.
void GNUNET_HELPER_destroy(struct GNUNET_HELPER_Handle *h)
Free's the resources occupied by the helper handle.
Definition helper.c:525
#define GNUNET_log(kind,...)
#define GNUNET_ALIGN
gcc-ism to force alignment; we use this to align char-arrays that may then be cast to 'struct's.
#define GNUNET_memcpy(dst, src, n)
Call memcpy() but check for n being 0 first.
GNUNET_GenericReturnValue
Named constants for return values.
uint16_t size
The length of the struct (in bytes, including the length field itself), in big-endian format.
@ GNUNET_OK
@ GNUNET_YES
@ GNUNET_NO
@ GNUNET_SYSERR
#define GNUNET_assert(cond)
Use this for fatal errors that cannot be handled.
#define GNUNET_break(cond)
Use this for internal assertion violations that are not fatal (can be handled) but should not occur.
@ GNUNET_ERROR_TYPE_WARNING
@ GNUNET_ERROR_TYPE_DEBUG
@ GNUNET_ERROR_TYPE_INFO
#define GNUNET_strdup(a)
Wrapper around GNUNET_xstrdup_.
#define GNUNET_new(type)
Allocate a struct or union of the given type.
#define GNUNET_malloc(size)
Wrapper around malloc.
#define GNUNET_free(ptr)
Wrapper around free.
enum GNUNET_GenericReturnValue GNUNET_process_run_command_argv(struct GNUNET_Process *p, const char *filename, const char **argv)
Set the command and start a process.
Definition os_process.c:840
enum GNUNET_GenericReturnValue GNUNET_process_wait(struct GNUNET_Process *proc, bool blocking, enum GNUNET_OS_ProcessStatusType *type, unsigned long *code)
Wait for a process to terminate.
void GNUNET_process_destroy(struct GNUNET_Process *proc)
Cleans up process structure contents (OS-dependent) and deallocates it.
Definition os_process.c:363
#define GNUNET_process_set_options(proc,...)
Set the requested options for the process.
#define GNUNET_process_option_inherit_rpipe(rpipe, child_fd)
Have child process inherit a pipe for reading.
#define GNUNET_process_option_inherit_wpipe(wpipe, child_fd)
Have child process inherit a pipe for writing.
enum GNUNET_GenericReturnValue GNUNET_process_kill(struct GNUNET_Process *proc, int sig)
Sends a signal to the process.
Definition os_process.c:307
struct GNUNET_Process * GNUNET_process_create(enum GNUNET_OS_InheritStdioFlags std_inheritance)
Create a process handle.
Definition os_process.c:462
char * GNUNET_OS_get_libexec_binary_path(const struct GNUNET_OS_ProjectData *pd, const char *progname)
Given the name of a gnunet-helper, gnunet-service or gnunet-daemon binary, try to prefix it with the ...
@ GNUNET_OS_INHERIT_STD_ERR
When this flag is set, the child process will inherit stderr of the parent.
@ GNUNET_OS_USE_PIPE_CONTROL
Should a pipe be used to send signals to the child?
struct GNUNET_SCHEDULER_Task * GNUNET_SCHEDULER_add_write_file(struct GNUNET_TIME_Relative delay, const struct GNUNET_DISK_FileHandle *wfd, GNUNET_SCHEDULER_TaskCallback task, void *task_cls)
Schedule a new task to be run with a specified delay or when the specified file descriptor is ready f...
Definition scheduler.c:1700
struct GNUNET_SCHEDULER_Task * GNUNET_SCHEDULER_add_read_file(struct GNUNET_TIME_Relative delay, const struct GNUNET_DISK_FileHandle *rfd, GNUNET_SCHEDULER_TaskCallback task, void *task_cls)
Schedule a new task to be run with a specified delay or when the specified file descriptor is ready f...
Definition scheduler.c:1667
void * GNUNET_SCHEDULER_cancel(struct GNUNET_SCHEDULER_Task *task)
Cancel the task with the specified identifier.
Definition scheduler.c:986
struct GNUNET_SCHEDULER_Task * GNUNET_SCHEDULER_add_delayed(struct GNUNET_TIME_Relative delay, GNUNET_SCHEDULER_TaskCallback task, void *task_cls)
Schedule a new task to be run with a specified delay.
Definition scheduler.c:1283
int(* GNUNET_MessageTokenizerCallback)(void *cls, const struct GNUNET_MessageHeader *message)
Functions with this signature are called whenever a complete message is received by the tokenizer.
enum GNUNET_GenericReturnValue GNUNET_MST_from_buffer(struct GNUNET_MessageStreamTokenizer *mst, const char *buf, size_t size, int purge, int one_shot)
Add incoming data to the receive buffer and call the callback for all complete messages.
Definition mst.c:101
struct GNUNET_MessageStreamTokenizer * GNUNET_MST_create(GNUNET_MessageTokenizerCallback cb, void *cb_cls)
Create a message stream tokenizer.
Definition mst.c:86
void GNUNET_MST_destroy(struct GNUNET_MessageStreamTokenizer *mst)
Destroys a tokenizer.
Definition mst.c:404
#define GNUNET_TIME_UNIT_FOREVER_REL
Constant used to specify "forever".
#define GNUNET_TIME_UNIT_SECONDS
One second.
struct GNUNET_TIME_Relative GNUNET_TIME_relative_multiply(struct GNUNET_TIME_Relative rel, unsigned long long factor)
Multiply relative time by a given factor.
Definition time.c:486
static void helper_write(void *cls)
Write to the helper-process.
Definition helper.c:576
static void start_helper(struct GNUNET_HELPER_Handle *h)
Start the helper process.
Definition helper.c:398
static void restart_task(void *cls)
Restart the helper process.
Definition helper.c:470
static void helper_read(void *cls)
Read from the helper-process.
Definition helper.c:308
static void stop_helper(struct GNUNET_HELPER_Handle *h, int soft_kill)
Stop the helper process, we're closing down or had an error.
Definition helper.c:274
#define _(String)
GNU gettext support macro.
Definition platform.h:179
#define GNUNET_TERM_SIG
The termination signal.
Definition platform.h:235
Handle used to access files (and pipes).
Handle used to manage a pipe.
Definition disk.c:69
The handle to a helper process.
Definition helper.c:77
GNUNET_HELPER_ExceptionCallback exp_cb
The exception callback.
Definition helper.c:111
unsigned int retry_back_off
Count start attempts to increase linear back off.
Definition helper.c:161
struct GNUNET_HELPER_SendHandle * sh_head
First message queued for transmission to helper.
Definition helper.c:121
int with_control_pipe
Does the helper support the use of a control pipe for signalling?
Definition helper.c:156
void * cb_cls
The closure for callbacks.
Definition helper.c:116
struct GNUNET_HELPER_SendHandle * sh_tail
Last message queued for transmission to helper.
Definition helper.c:126
struct GNUNET_DISK_PipeHandle * helper_in
PipeHandle to receive data from the helper.
Definition helper.c:81
const struct GNUNET_DISK_FileHandle * fh_from_helper
FileHandle to receive data from the helper.
Definition helper.c:91
const struct GNUNET_DISK_FileHandle * fh_to_helper
FileHandle to send data to the helper.
Definition helper.c:96
struct GNUNET_SCHEDULER_Task * write_task
Task to read from the helper.
Definition helper.c:146
struct GNUNET_DISK_PipeHandle * helper_out
PipeHandle to send data to the helper.
Definition helper.c:86
struct GNUNET_SCHEDULER_Task * restart_task
Restart task.
Definition helper.c:151
struct GNUNET_Process * helper_proc
The process id of the helper.
Definition helper.c:101
char ** binary_argv
NULL-terminated list of command-line arguments.
Definition helper.c:136
struct GNUNET_MessageStreamTokenizer * mst
The Message-Tokenizer that tokenizes the messages coming from the helper.
Definition helper.c:106
struct GNUNET_SCHEDULER_Task * read_task
Task to read from the helper.
Definition helper.c:141
char * binary_name
Binary to run.
Definition helper.c:131
Entry in the queue of messages we need to transmit to the helper.
Definition helper.c:35
struct GNUNET_HELPER_SendHandle * prev
This is an entry in a DLL.
Definition helper.c:44
struct GNUNET_HELPER_SendHandle * next
This is an entry in a DLL.
Definition helper.c:39
struct GNUNET_HELPER_Handle * h
The handle to a helper process.
Definition helper.c:54
GNUNET_HELPER_Continuation cont
Function to call upon completion.
Definition helper.c:59
const struct GNUNET_MessageHeader * msg
Message to transmit (allocated at the end of this struct)
Definition helper.c:49
void * cont_cls
Closure to 'cont'.
Definition helper.c:64
unsigned int wpos
Current write position.
Definition helper.c:69
Header for all communications.
Handle to a message stream tokenizer.
Definition mst.c:45
Project-specific data used to help the OS subsystem find installation paths.
Entry in list of pending tasks.
Definition scheduler.c:141
static void exp_cb(void *cls)
Callback called if there was an exception during execution of the helper.