@@ -141,12 +141,7 @@ static char *onbegin(void *stream, void *clientdata, cmd_t *cmd) {
141
141
xmax [node ] = xid ;
142
142
}
143
143
}
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 )) {
150
145
shout (
151
146
"[%d] BEGIN: global transaction failed"
152
147
" to initialize clog bits O_o\n" ,
@@ -208,17 +203,17 @@ static char *onvote(void *stream, void *clientdata, cmd_t *cmd, int vote) {
208
203
switch (global_transaction_status (transactions + i )) {
209
204
case NEGATIVE :
210
205
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
+ // );
215
210
216
211
void * listener ;
217
212
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
+ // );
222
217
write_to_stream (listener , strdup ("+a" ));
223
218
}
224
219
@@ -234,21 +229,21 @@ static char *onvote(void *stream, void *clientdata, cmd_t *cmd, int vote) {
234
229
return strdup ("-" );
235
230
}
236
231
case DOUBT :
237
- shout ("[%d] VOTE: vote counted\n" , CLIENT_ID (clientdata ));
232
+ // shout("[%d] VOTE: vote counted\n", CLIENT_ID(clientdata));
238
233
return strdup ("+" );
239
234
case POSITIVE :
240
235
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
+ // );
245
240
246
241
void * listener ;
247
242
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
+ // );
252
247
write_to_stream (listener , strdup ("+c" ));
253
248
}
254
249
@@ -390,26 +385,20 @@ static char *onstatus(void *stream, void *clientdata, cmd_t *cmd) {
390
385
int status = clog_read (clg , MUX_XID (node , xid ));
391
386
switch (status ) {
392
387
case BLANK :
393
- shout ("[%d] STATUS(%llu): BLANK\n" , CLIENT_ID (clientdata ), MUX_XID (node , xid ));
394
388
return strdup ("+0" );
395
389
case POSITIVE :
396
- shout ("[%d] STATUS(%llu): POSITIVE\n" , CLIENT_ID (clientdata ), MUX_XID (node , xid ));
397
390
return strdup ("+c" );
398
391
case NEGATIVE :
399
- shout ("[%d] STATUS(%llu): NEGATIVE\n" , CLIENT_ID (clientdata ), MUX_XID (node , xid ));
400
392
return strdup ("+a" );
401
393
case DOUBT :
402
- shout ("[%d] STATUS(%llu): DOUBT\n" , CLIENT_ID (clientdata ), MUX_XID (node , xid ));
403
394
if (wait ) {
404
- shout ("[%d] STATUS: adding self to the wait queue\n" , CLIENT_ID (clientdata ));
405
395
if (!queue_for_transaction_finish (stream , clientdata , node , xid )) {
406
396
shout (
407
397
"[%d] STATUS: couldn't queue for transaction finish\n" ,
408
398
CLIENT_ID (clientdata )
409
399
);
410
400
return strdup ("-" );
411
401
}
412
- shout ("[%d] STATUS: returning NULL\n" , CLIENT_ID (clientdata ));
413
402
return NULL ;
414
403
} else {
415
404
return strdup ("+?" );
@@ -531,7 +520,7 @@ char *ondata(void *stream, void *clientdata, size_t len, char *data) {
531
520
}
532
521
533
522
void 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 );
535
524
}
536
525
537
526
int main (int argc , char * * argv ) {
0 commit comments