diff options
Diffstat (limited to 'src/util/helper.c')
-rw-r--r-- | src/util/helper.c | 25 |
1 files changed, 15 insertions, 10 deletions
diff --git a/src/util/helper.c b/src/util/helper.c index cdb1b01d4..a84b06e66 100644 --- a/src/util/helper.c +++ b/src/util/helper.c | |||
@@ -27,6 +27,7 @@ | |||
27 | */ | 27 | */ |
28 | #include "platform.h" | 28 | #include "platform.h" |
29 | #include "gnunet_util_lib.h" | 29 | #include "gnunet_util_lib.h" |
30 | #include "gnunet_mst_lib.h" | ||
30 | 31 | ||
31 | 32 | ||
32 | /** | 33 | /** |
@@ -107,7 +108,7 @@ struct GNUNET_HELPER_Handle | |||
107 | /** | 108 | /** |
108 | * The Message-Tokenizer that tokenizes the messages comming from the helper | 109 | * The Message-Tokenizer that tokenizes the messages comming from the helper |
109 | */ | 110 | */ |
110 | struct GNUNET_SERVER_MessageStreamTokenizer *mst; | 111 | struct GNUNET_MessageStreamTokenizer *mst; |
111 | 112 | ||
112 | /** | 113 | /** |
113 | * The exception callback | 114 | * The exception callback |
@@ -272,7 +273,10 @@ GNUNET_HELPER_wait (struct GNUNET_HELPER_Handle *h) | |||
272 | } | 273 | } |
273 | /* purge MST buffer */ | 274 | /* purge MST buffer */ |
274 | if (NULL != h->mst) | 275 | if (NULL != h->mst) |
275 | (void) GNUNET_SERVER_mst_receive (h->mst, NULL, NULL, 0, GNUNET_YES, GNUNET_NO); | 276 | (void) GNUNET_MST_from_buffer (h->mst, |
277 | NULL, 0, | ||
278 | GNUNET_YES, | ||
279 | GNUNET_NO); | ||
276 | return ret; | 280 | return ret; |
277 | } | 281 | } |
278 | 282 | ||
@@ -319,7 +323,7 @@ static void | |||
319 | helper_read (void *cls) | 323 | helper_read (void *cls) |
320 | { | 324 | { |
321 | struct GNUNET_HELPER_Handle *h = cls; | 325 | struct GNUNET_HELPER_Handle *h = cls; |
322 | char buf[GNUNET_SERVER_MAX_MESSAGE_SIZE] GNUNET_ALIGN; | 326 | char buf[GNUNET_MAX_MESSAGE_SIZE] GNUNET_ALIGN; |
323 | ssize_t t; | 327 | ssize_t t; |
324 | 328 | ||
325 | h->read_task = NULL; | 329 | h->read_task = NULL; |
@@ -373,10 +377,10 @@ helper_read (void *cls) | |||
373 | h->fh_from_helper, | 377 | h->fh_from_helper, |
374 | &helper_read, h); | 378 | &helper_read, h); |
375 | if (GNUNET_SYSERR == | 379 | if (GNUNET_SYSERR == |
376 | GNUNET_SERVER_mst_receive (h->mst, | 380 | GNUNET_MST_from_buffer (h->mst, |
377 | NULL, | 381 | buf, t, |
378 | buf, t, | 382 | GNUNET_NO, |
379 | GNUNET_NO, GNUNET_NO)) | 383 | GNUNET_NO)) |
380 | { | 384 | { |
381 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, | 385 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, |
382 | _("Failed to parse inbound message from helper `%s'\n"), | 386 | _("Failed to parse inbound message from helper `%s'\n"), |
@@ -487,7 +491,7 @@ struct GNUNET_HELPER_Handle * | |||
487 | GNUNET_HELPER_start (int with_control_pipe, | 491 | GNUNET_HELPER_start (int with_control_pipe, |
488 | const char *binary_name, | 492 | const char *binary_name, |
489 | char *const binary_argv[], | 493 | char *const binary_argv[], |
490 | GNUNET_SERVER_MessageTokenizerCallback cb, | 494 | GNUNET_MessageTokenizerCallback cb, |
491 | GNUNET_HELPER_ExceptionCallback exp_cb, | 495 | GNUNET_HELPER_ExceptionCallback exp_cb, |
492 | void *cb_cls) | 496 | void *cb_cls) |
493 | { | 497 | { |
@@ -508,7 +512,8 @@ GNUNET_HELPER_start (int with_control_pipe, | |||
508 | h->binary_argv[c] = NULL; | 512 | h->binary_argv[c] = NULL; |
509 | h->cb_cls = cb_cls; | 513 | h->cb_cls = cb_cls; |
510 | if (NULL != cb) | 514 | if (NULL != cb) |
511 | h->mst = GNUNET_SERVER_mst_create (cb, h->cb_cls); | 515 | h->mst = GNUNET_MST_create (cb, |
516 | h->cb_cls); | ||
512 | h->exp_cb = exp_cb; | 517 | h->exp_cb = exp_cb; |
513 | h->retry_back_off = 0; | 518 | h->retry_back_off = 0; |
514 | start_helper (h); | 519 | start_helper (h); |
@@ -544,7 +549,7 @@ GNUNET_HELPER_destroy (struct GNUNET_HELPER_Handle *h) | |||
544 | GNUNET_free (sh); | 549 | GNUNET_free (sh); |
545 | } | 550 | } |
546 | if (NULL != h->mst) | 551 | if (NULL != h->mst) |
547 | GNUNET_SERVER_mst_destroy (h->mst); | 552 | GNUNET_MST_destroy (h->mst); |
548 | GNUNET_free (h->binary_name); | 553 | GNUNET_free (h->binary_name); |
549 | for (c = 0; h->binary_argv[c] != NULL; c++) | 554 | for (c = 0; h->binary_argv[c] != NULL; c++) |
550 | GNUNET_free (h->binary_argv[c]); | 555 | GNUNET_free (h->binary_argv[c]); |