aboutsummaryrefslogtreecommitdiff
path: root/src/setu/setu_api.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/setu/setu_api.c')
-rw-r--r--src/setu/setu_api.c31
1 files changed, 28 insertions, 3 deletions
diff --git a/src/setu/setu_api.c b/src/setu/setu_api.c
index 48260de55..dd3a4a769 100644
--- a/src/setu/setu_api.c
+++ b/src/setu/setu_api.c
@@ -235,8 +235,7 @@ handle_result (void *cls,
235 switch (result_status) 235 switch (result_status)
236 { 236 {
237 case GNUNET_SETU_STATUS_ADD_LOCAL: 237 case GNUNET_SETU_STATUS_ADD_LOCAL:
238 LOG (GNUNET_ERROR_TYPE_DEBUG, 238 case GNUNET_SETU_STATUS_ADD_REMOTE:
239 "Treating result as element\n");
240 e.data = &msg[1]; 239 e.data = &msg[1];
241 e.size = ntohs (msg->header.size) 240 e.size = ntohs (msg->header.size)
242 - sizeof(struct GNUNET_SETU_ResultMessage); 241 - sizeof(struct GNUNET_SETU_ResultMessage);
@@ -533,7 +532,7 @@ GNUNET_SETU_prepare (const struct GNUNET_PeerIdentity *other_peer,
533 { 532 {
534 case GNUNET_SETU_OPTION_BYZANTINE: 533 case GNUNET_SETU_OPTION_BYZANTINE:
535 msg->byzantine = GNUNET_YES; 534 msg->byzantine = GNUNET_YES;
536 msg->byzantine_lower_bound = opt->v.num; 535 msg->byzantine_lower_bound = htonl (opt->v.num);
537 break; 536 break;
538 case GNUNET_SETU_OPTION_FORCE_FULL: 537 case GNUNET_SETU_OPTION_FORCE_FULL:
539 msg->force_full = GNUNET_YES; 538 msg->force_full = GNUNET_YES;
@@ -541,6 +540,9 @@ GNUNET_SETU_prepare (const struct GNUNET_PeerIdentity *other_peer,
541 case GNUNET_SETU_OPTION_FORCE_DELTA: 540 case GNUNET_SETU_OPTION_FORCE_DELTA:
542 msg->force_delta = GNUNET_YES; 541 msg->force_delta = GNUNET_YES;
543 break; 542 break;
543 case GNUNET_SETU_OPTION_SYMMETRIC:
544 msg->symmetric = GNUNET_YES;
545 break;
544 default: 546 default:
545 LOG (GNUNET_ERROR_TYPE_ERROR, 547 LOG (GNUNET_ERROR_TYPE_ERROR,
546 "Option with type %d not recognized\n", 548 "Option with type %d not recognized\n",
@@ -786,6 +788,29 @@ GNUNET_SETU_accept (struct GNUNET_SETU_Request *request,
786 mqm = GNUNET_MQ_msg (msg, 788 mqm = GNUNET_MQ_msg (msg,
787 GNUNET_MESSAGE_TYPE_SETU_ACCEPT); 789 GNUNET_MESSAGE_TYPE_SETU_ACCEPT);
788 msg->accept_reject_id = htonl (request->accept_id); 790 msg->accept_reject_id = htonl (request->accept_id);
791 for (const struct GNUNET_SETU_Option *opt = options; opt->type != 0; opt++)
792 {
793 switch (opt->type)
794 {
795 case GNUNET_SETU_OPTION_BYZANTINE:
796 msg->byzantine = GNUNET_YES;
797 msg->byzantine_lower_bound = htonl (opt->v.num);
798 break;
799 case GNUNET_SETU_OPTION_FORCE_FULL:
800 msg->force_full = GNUNET_YES;
801 break;
802 case GNUNET_SETU_OPTION_FORCE_DELTA:
803 msg->force_delta = GNUNET_YES;
804 break;
805 case GNUNET_SETU_OPTION_SYMMETRIC:
806 msg->symmetric = GNUNET_YES;
807 break;
808 default:
809 LOG (GNUNET_ERROR_TYPE_ERROR,
810 "Option with type %d not recognized\n",
811 (int) opt->type);
812 }
813 }
789 oh = GNUNET_new (struct GNUNET_SETU_OperationHandle); 814 oh = GNUNET_new (struct GNUNET_SETU_OperationHandle);
790 oh->result_cb = result_cb; 815 oh->result_cb = result_cb;
791 oh->result_cls = result_cls; 816 oh->result_cls = result_cls;