Revision d4551293 monitor.c
b/monitor.c | ||
---|---|---|
656 | 656 |
|
657 | 657 |
if (monitor_handler_is_async(cmd)) { |
658 | 658 |
user_async_info_handler(mon, cmd); |
659 |
/* |
|
660 |
* Indicate that this command is asynchronous and will not return any |
|
661 |
* data (not even empty). Instead, the data will be returned via a |
|
662 |
* completion callback. |
|
663 |
*/ |
|
664 |
*ret_data = qobject_from_jsonf("{ '__mon_async': 'return' }"); |
|
665 | 659 |
} else if (monitor_handler_ported(cmd)) { |
666 | 660 |
QObject *info_data = NULL; |
667 | 661 |
|
... | ... | |
3720 | 3714 |
} |
3721 | 3715 |
} |
3722 | 3716 |
|
3723 |
static int is_async_return(const QObject *data) |
|
3724 |
{ |
|
3725 |
if (data && qobject_type(data) == QTYPE_QDICT) { |
|
3726 |
return qdict_haskey(qobject_to_qdict(data), "__mon_async"); |
|
3727 |
} |
|
3728 |
|
|
3729 |
return 0; |
|
3730 |
} |
|
3731 |
|
|
3732 | 3717 |
static void handler_audit(Monitor *mon, const mon_cmd_t *cmd, int ret) |
3733 | 3718 |
{ |
3734 | 3719 |
if (monitor_ctrl_mode(mon)) { |
... | ... | |
3787 | 3772 |
ret = cmd->mhandler.cmd_new(mon, params, &data); |
3788 | 3773 |
handler_audit(mon, cmd, ret); |
3789 | 3774 |
|
3790 |
if (is_async_return(data)) { |
|
3791 |
/* |
|
3792 |
* Asynchronous commands have no initial return data but they can |
|
3793 |
* generate errors. Data is returned via the async completion handler. |
|
3794 |
*/ |
|
3795 |
if (monitor_ctrl_mode(mon) && monitor_has_error(mon)) { |
|
3796 |
monitor_protocol_emitter(mon, NULL); |
|
3797 |
} |
|
3798 |
} else if (monitor_ctrl_mode(mon)) { |
|
3775 |
if (monitor_ctrl_mode(mon)) { |
|
3799 | 3776 |
/* Monitor Protocol */ |
3800 | 3777 |
monitor_protocol_emitter(mon, data); |
3801 | 3778 |
} else { |
Also available in: Unified diff