diff options
Diffstat (limited to 'src/twister/twister_api.c')
-rw-r--r-- | src/twister/twister_api.c | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/src/twister/twister_api.c b/src/twister/twister_api.c index 978e7d1..4beaff5 100644 --- a/src/twister/twister_api.c +++ b/src/twister/twister_api.c @@ -33,7 +33,6 @@ GNUNET_log_from (kind, "twister-api",__VA_ARGS__) - /** * Opaque handle for asynchronous operation. */ @@ -422,6 +421,7 @@ TALER_TWISTER_delete_path struct TALER_TWISTER_Operation *op; struct GNUNET_MQ_Envelope *env; struct TWISTER_DeletePath *src; //FIXME 'src' right name? + uint16_t stralloc; op = GNUNET_new (struct TALER_TWISTER_Operation); op->h = h; @@ -430,12 +430,20 @@ TALER_TWISTER_delete_path GNUNET_CONTAINER_DLL_insert_tail (h->op_head, h->op_tail, op); - /* Prepare *env*elope. */ - env = GNUNET_MQ_msg - (src, TWISTER_MESSAGE_TYPE_DELETE_PATH); - /* Put data into the envelope. */ - strcpy (src->path, path); - /* Send message. */ + + stralloc = strlen (path) + 1; + + + GNUNET_assert + (stralloc + sizeof (struct TWISTER_DeletePath) < UINT16_MAX); + env = GNUNET_MQ_msg_extra (src, + stralloc, + TWISTER_MESSAGE_TYPE_DELETE_PATH); + GNUNET_assert + (stralloc == GNUNET_STRINGS_buffer_fill ((char *) &src[1], + stralloc, + 1, + path)); GNUNET_MQ_send (h->mq, env); return op; } @@ -470,7 +478,6 @@ TALER_TWISTER_modify_path_dl (struct TALER_TWISTER_Handle *h, GNUNET_CONTAINER_DLL_insert_tail (h->op_head, h->op_tail, op); - /* Prepare *env*elope. */ env = GNUNET_MQ_msg (src, TWISTER_MESSAGE_TYPE_MODIFY_PATH_DL); /* Put data into the envelope. */ |