diff options
author | Gabor X Toth <*@tg-x.net> | 2015-09-05 23:44:03 +0000 |
---|---|---|
committer | Gabor X Toth <*@tg-x.net> | 2015-09-05 23:44:03 +0000 |
commit | 5e4dfeb7fb48a506f25af0c206ee65a5f7de7f58 (patch) | |
tree | 72bf05c5466e71b718cdca97c6692c47481fd781 /src/psycstore | |
parent | 931280988092f1b79dad9ad09ac67d2e7ee8bc54 (diff) | |
download | gnunet-5e4dfeb7fb48a506f25af0c206ee65a5f7de7f58.tar.gz gnunet-5e4dfeb7fb48a506f25af0c206ee65a5f7de7f58.zip |
psyc: add STATE_MODIFY flag during transmit
Diffstat (limited to 'src/psycstore')
-rw-r--r-- | src/psycstore/psyc_util_lib.c | 27 |
1 files changed, 17 insertions, 10 deletions
diff --git a/src/psycstore/psyc_util_lib.c b/src/psycstore/psyc_util_lib.c index 54ae626c5..7b13ac57f 100644 --- a/src/psycstore/psyc_util_lib.c +++ b/src/psycstore/psyc_util_lib.c | |||
@@ -677,16 +677,6 @@ GNUNET_PSYC_transmit_message (struct GNUNET_PSYC_TransmitHandle *tmit, | |||
677 | tmit->msg = GNUNET_malloc (sizeof (*tmit->msg) + sizeof (*pmeth) + size); | 677 | tmit->msg = GNUNET_malloc (sizeof (*tmit->msg) + sizeof (*pmeth) + size); |
678 | tmit->msg->size = sizeof (*tmit->msg) + sizeof (*pmeth) + size; | 678 | tmit->msg->size = sizeof (*tmit->msg) + sizeof (*pmeth) + size; |
679 | 679 | ||
680 | pmeth = (struct GNUNET_PSYC_MessageMethod *) &tmit->msg[1]; | ||
681 | pmeth->header.type = htons (GNUNET_MESSAGE_TYPE_PSYC_MESSAGE_METHOD); | ||
682 | pmeth->header.size = htons (sizeof (*pmeth) + size); | ||
683 | pmeth->flags = htonl (flags); | ||
684 | memcpy (&pmeth[1], method_name, size); | ||
685 | |||
686 | tmit->state = GNUNET_PSYC_MESSAGE_STATE_MODIFIER; | ||
687 | tmit->notify_data = notify_data; | ||
688 | tmit->notify_data_cls = notify_cls; | ||
689 | |||
690 | if (NULL != notify_mod) | 680 | if (NULL != notify_mod) |
691 | { | 681 | { |
692 | tmit->notify_mod = notify_mod; | 682 | tmit->notify_mod = notify_mod; |
@@ -701,6 +691,13 @@ GNUNET_PSYC_transmit_message (struct GNUNET_PSYC_TransmitHandle *tmit, | |||
701 | struct GNUNET_ENV_Modifier mod = {}; | 691 | struct GNUNET_ENV_Modifier mod = {}; |
702 | mod.next = GNUNET_ENV_environment_head (env); | 692 | mod.next = GNUNET_ENV_environment_head (env); |
703 | tmit->mod = &mod; | 693 | tmit->mod = &mod; |
694 | |||
695 | struct GNUNET_ENV_Modifier *m = tmit->mod; | ||
696 | while (NULL != (m = m->next)) | ||
697 | { | ||
698 | if (m->oper != GNUNET_ENV_OP_SET) | ||
699 | flags |= GNUNET_PSYC_MASTER_TRANSMIT_STATE_MODIFY; | ||
700 | } | ||
704 | } | 701 | } |
705 | else | 702 | else |
706 | { | 703 | { |
@@ -708,6 +705,16 @@ GNUNET_PSYC_transmit_message (struct GNUNET_PSYC_TransmitHandle *tmit, | |||
708 | } | 705 | } |
709 | } | 706 | } |
710 | 707 | ||
708 | pmeth = (struct GNUNET_PSYC_MessageMethod *) &tmit->msg[1]; | ||
709 | pmeth->header.type = htons (GNUNET_MESSAGE_TYPE_PSYC_MESSAGE_METHOD); | ||
710 | pmeth->header.size = htons (sizeof (*pmeth) + size); | ||
711 | pmeth->flags = htonl (flags); | ||
712 | memcpy (&pmeth[1], method_name, size); | ||
713 | |||
714 | tmit->state = GNUNET_PSYC_MESSAGE_STATE_MODIFIER; | ||
715 | tmit->notify_data = notify_data; | ||
716 | tmit->notify_data_cls = notify_cls; | ||
717 | |||
711 | transmit_mod (tmit); | 718 | transmit_mod (tmit); |
712 | return GNUNET_OK; | 719 | return GNUNET_OK; |
713 | } | 720 | } |