@@ -141,12 +141,7 @@ static char *onbegin(void *stream, void *clientdata, cmd_t *cmd) {
141141 xmax [node ] = xid ;
142142 }
143143 }
144- if (global_transaction_mark (clg , gt , DOUBT )) {
145- shout (
146- "[%d] BEGIN: global transaction marked as DOUBT" ,
147- CLIENT_ID (clientdata )
148- );
149- } else {
144+ if (!global_transaction_mark (clg , gt , DOUBT )) {
150145 shout (
151146 "[%d] BEGIN: global transaction failed"
152147 " to initialize clog bits O_o\n" ,
@@ -208,17 +203,17 @@ static char *onvote(void *stream, void *clientdata, cmd_t *cmd, int vote) {
208203 switch (global_transaction_status (transactions + i )) {
209204 case NEGATIVE :
210205 if (global_transaction_mark (clg , transactions + i , NEGATIVE )) {
211- shout (
212- "[%d] VOTE: global transaction aborted\n" ,
213- CLIENT_ID (clientdata )
214- );
206+ // shout(
207+ // "[%d] VOTE: global transaction aborted\n",
208+ // CLIENT_ID(clientdata)
209+ // );
215210
216211 void * listener ;
217212 while ((listener = global_transaction_pop_listener (transactions + i ))) {
218- shout (
219- "[%d] VOTE: notifying a listener\n" ,
220- CLIENT_ID (clientdata )
221- );
213+ // shout(
214+ // "[%d] VOTE: notifying a listener\n",
215+ // CLIENT_ID(clientdata)
216+ // );
222217 write_to_stream (listener , strdup ("+a" ));
223218 }
224219
@@ -234,21 +229,21 @@ static char *onvote(void *stream, void *clientdata, cmd_t *cmd, int vote) {
234229 return strdup ("-" );
235230 }
236231 case DOUBT :
237- shout ("[%d] VOTE: vote counted\n" , CLIENT_ID (clientdata ));
232+ // shout("[%d] VOTE: vote counted\n", CLIENT_ID(clientdata));
238233 return strdup ("+" );
239234 case POSITIVE :
240235 if (global_transaction_mark (clg , transactions + i , POSITIVE )) {
241- shout (
242- "[%d] VOTE: global transaction committed\n" ,
243- CLIENT_ID (clientdata )
244- );
236+ // shout(
237+ // "[%d] VOTE: global transaction committed\n",
238+ // CLIENT_ID(clientdata)
239+ // );
245240
246241 void * listener ;
247242 while ((listener = global_transaction_pop_listener (transactions + i ))) {
248- shout (
249- "[%d] VOTE: notifying a listener\n" ,
250- CLIENT_ID (clientdata )
251- );
243+ // shout(
244+ // "[%d] VOTE: notifying a listener\n",
245+ // CLIENT_ID(clientdata)
246+ // );
252247 write_to_stream (listener , strdup ("+c" ));
253248 }
254249
@@ -390,26 +385,20 @@ static char *onstatus(void *stream, void *clientdata, cmd_t *cmd) {
390385 int status = clog_read (clg , MUX_XID (node , xid ));
391386 switch (status ) {
392387 case BLANK :
393- shout ("[%d] STATUS(%llu): BLANK\n" , CLIENT_ID (clientdata ), MUX_XID (node , xid ));
394388 return strdup ("+0" );
395389 case POSITIVE :
396- shout ("[%d] STATUS(%llu): POSITIVE\n" , CLIENT_ID (clientdata ), MUX_XID (node , xid ));
397390 return strdup ("+c" );
398391 case NEGATIVE :
399- shout ("[%d] STATUS(%llu): NEGATIVE\n" , CLIENT_ID (clientdata ), MUX_XID (node , xid ));
400392 return strdup ("+a" );
401393 case DOUBT :
402- shout ("[%d] STATUS(%llu): DOUBT\n" , CLIENT_ID (clientdata ), MUX_XID (node , xid ));
403394 if (wait ) {
404- shout ("[%d] STATUS: adding self to the wait queue\n" , CLIENT_ID (clientdata ));
405395 if (!queue_for_transaction_finish (stream , clientdata , node , xid )) {
406396 shout (
407397 "[%d] STATUS: couldn't queue for transaction finish\n" ,
408398 CLIENT_ID (clientdata )
409399 );
410400 return strdup ("-" );
411401 }
412- shout ("[%d] STATUS: returning NULL\n" , CLIENT_ID (clientdata ));
413402 return NULL ;
414403 } else {
415404 return strdup ("+?" );
@@ -531,7 +520,7 @@ char *ondata(void *stream, void *clientdata, size_t len, char *data) {
531520}
532521
533522void usage (char * prog ) {
534- shout ("Usage: %s [-d DATADIR] [-a HOST] [-p PORT]\n" , prog );
523+ printf ("Usage: %s [-d DATADIR] [-a HOST] [-p PORT]\n" , prog );
535524}
536525
537526int main (int argc , char * * argv ) {
0 commit comments