trickle_handler: fix wrong sense of retval; add error option

Add global variable handler_error; if handle_trickle() returns error,
set message_from_host.handled to this.  Default 1.
This commit is contained in:
David Anderson 2018-08-04 21:17:43 -07:00
parent 3e365013fb
commit 5edddd5766
1 changed files with 8 additions and 3 deletions

View File

@ -48,10 +48,15 @@
char variety[256];
// can change the following in handle_trickle_init()
// values of mhf.handled.
// Can change the following in handle_trickle_init()
//
int handled_enum = 0;
// enumerate messages with this
int handled_set = 1;
// if successful, set to this
int handled_error = 1;
// if handling error, set to this
// make one pass through trickle_ups with handled == handled_enum
// return true if there were any
@ -73,12 +78,12 @@ bool do_trickle_scan() {
break;
}
retval = handle_trickle(mfh);
if (!retval) {
if (retval) {
log_messages.printf(MSG_CRITICAL,
"handle_trickle(): %s", boincerror(retval)
);
}
mfh.handled = handled_set;
mfh.handled = retval?handled_error:handled_set;
mfh.update();
found = true;
}