410 |
va_end (ap); |
va_end (ap); |
411 |
free (buf); |
free (buf); |
412 |
/* Reset the state. */ |
/* Reset the state. */ |
413 |
new_state = (rc == RESP_OK) ? command->success : command->failure; |
if (rc == RESP_OK) |
414 |
|
new_state = command->success; |
415 |
|
else if (command->failure <= state) |
416 |
|
new_state = command->failure; |
417 |
|
else |
418 |
|
new_state = STATE_NONE; |
419 |
|
|
420 |
if (new_state != STATE_NONE) |
if (new_state != STATE_NONE) |
421 |
state = new_state; |
state = new_state; |
422 |
return status; |
return status; |
559 |
nullcommand.tag = tag; |
nullcommand.tag = tag; |
560 |
return util_finish (&nullcommand, RESP_BAD, "Invalid command"); |
return util_finish (&nullcommand, RESP_BAD, "Invalid command"); |
561 |
} |
} |
562 |
|
|
563 |
command->tag = tag; |
command->tag = tag; |
564 |
|
|
565 |
|
if (command->states && (command->states & state) == 0) |
566 |
|
return util_finish (command, RESP_BAD, "Wrong state"); |
567 |
|
|
568 |
len = strlen (sp); |
len = strlen (sp); |
569 |
if (len && sp[len - 1] == '\n') |
if (len && sp[len - 1] == '\n') |
570 |
sp[len - 1] = '\0'; |
sp[len - 1] = '\0'; |