aboutsummaryrefslogtreecommitdiff
path: root/brandt.c
diff options
context:
space:
mode:
authorMarkus Teich <markus.teich@stusta.mhn.de>2016-09-21 13:50:20 +0200
committerMarkus Teich <markus.teich@stusta.mhn.de>2016-09-21 13:50:20 +0200
commitb31da162a85e993e8bb4287db9b5d8bc6ef2e53f (patch)
treefca58833e5fd19b750ad1aa165661f0bc5200d1b /brandt.c
parent658cb968460233a04e77d37558275a894e9d345c (diff)
downloadlibbrandt-b31da162a85e993e8bb4287db9b5d8bc6ef2e53f.tar.gz
libbrandt-b31da162a85e993e8bb4287db9b5d8bc6ef2e53f.zip
coding style fixes
Diffstat (limited to 'brandt.c')
-rw-r--r--brandt.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/brandt.c b/brandt.c
index 2e6a5ed..dd66e0c 100644
--- a/brandt.c
+++ b/brandt.c
@@ -77,7 +77,6 @@ BRANDT_bidder_start (struct BRANDT_Auction *auction,
77 return; 77 return;
78 } 78 }
79 79
80 weprintf("broadcasting msg_init %p from bidder %d", buf, i);
81 auction->bcast (auction->closure, buf, buflen); 80 auction->bcast (auction->closure, buf, buflen);
82 gcry_mpi_set_bit (auction->round_progress, auction->i); 81 gcry_mpi_set_bit (auction->round_progress, auction->i);
83 free (buf); 82 free (buf);
@@ -88,8 +87,8 @@ static void
88seller_start (void *arg) 87seller_start (void *arg)
89{ 88{
90 struct BRANDT_Auction *ad = (struct BRANDT_Auction *)arg; 89 struct BRANDT_Auction *ad = (struct BRANDT_Auction *)arg;
91 enum auction_type atype; 90 enum auction_type atype;
92 enum outcome_type outcome; 91 enum outcome_type outcome;
93 92
94 ad->task = NULL; 93 ad->task = NULL;
95 94
@@ -302,7 +301,7 @@ report_outcome (struct BRANDT_Auction *ad,
302 uint16_t reslen = 0; 301 uint16_t reslen = 0;
303 302
304 if (!handler_res[atype][outcome] || 303 if (!handler_res[atype][outcome] ||
305 !(res = handler_res[atype][outcome] (ad, &reslen))) 304 !(res = handler_res[atype][outcome] (ad, &reslen)))
306 ad->result (ad->closure, NULL, 0); 305 ad->result (ad->closure, NULL, 0);
307 else 306 else
308 ad->result (ad->closure, res, reslen); 307 ad->result (ad->closure, res, reslen);
@@ -341,7 +340,7 @@ advance_round (struct BRANDT_Auction *ad,
341 { 340 {
342 /* all bidders msg_decrypt received, broadcast combined msg_decrypt */ 341 /* all bidders msg_decrypt received, broadcast combined msg_decrypt */
343 if (!handler_out[atype][outcome][ad->cur_round] || 342 if (!handler_out[atype][outcome][ad->cur_round] ||
344 !(buf = handler_out[atype][outcome][ad->cur_round](ad, &buflen))) 343 !(buf = handler_out[atype][outcome][ad->cur_round](ad, &buflen)))
345 { 344 {
346 weprintf ("failed to create msg %d buffer as seller", 345 weprintf ("failed to create msg %d buffer as seller",
347 ad->cur_round); 346 ad->cur_round);
@@ -371,7 +370,7 @@ advance_round (struct BRANDT_Auction *ad,
371 370
372 /* create next message buffer */ 371 /* create next message buffer */
373 if (!handler_out[atype][outcome][ad->cur_round] || 372 if (!handler_out[atype][outcome][ad->cur_round] ||
374 !(buf = handler_out[atype][outcome][ad->cur_round](ad, &buflen))) 373 !(buf = handler_out[atype][outcome][ad->cur_round](ad, &buflen)))
375 { 374 {
376 weprintf ("failed to create msg %d buffer as bidder", ad->cur_round); 375 weprintf ("failed to create msg %d buffer as bidder", ad->cur_round);
377 return; 376 return;
@@ -404,7 +403,6 @@ BRANDT_got_message (struct BRANDT_Auction *auction,
404 /** \todo: cache out of order messages instead of discarding */ 403 /** \todo: cache out of order messages instead of discarding */
405 if (ntohl (head->msg_type) != round || ntohl (head->prot_version) != 0) 404 if (ntohl (head->msg_type) != round || ntohl (head->prot_version) != 0)
406 { 405 {
407 weprintf ("%d", auction->i);
408 weprintf ("got unexpected message, ignoring..."); 406 weprintf ("got unexpected message, ignoring...");
409 return; 407 return;
410 } 408 }
@@ -427,7 +425,6 @@ BRANDT_got_message (struct BRANDT_Auction *auction,
427 return; 425 return;
428 } 426 }
429 gcry_mpi_set_bit (auction->round_progress, sender); 427 gcry_mpi_set_bit (auction->round_progress, sender);
430 DM(auction->round_progress);
431 428
432 advance_round (auction, atype, outcome); 429 advance_round (auction, atype, outcome);
433} 430}