Merge pull request #464 from chme/mpd_noidle

[mpd] Fix 'noidle' command handling
This commit is contained in:
ejurgensen 2017-12-16 17:39:30 +01:00 committed by GitHub
commit 387b79496d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -694,7 +694,12 @@ mpd_command_noidle(struct evbuffer *evbuf, int argc, char **argv, char **errmsg,
* will then leave idle mode and print results immediately; might be
* empty at this time."
*/
mpd_notify_idle_client(ctx, 0);
if (ctx->events)
mpd_notify_idle_client(ctx, ctx->events);
else
evbuffer_add(ctx->evbuffer, "OK\n", 3);
ctx->is_idle = false;
return 0;
}
@ -4822,7 +4827,7 @@ mpd_read_cb(struct bufferevent *bev, void *ctx)
else if (0 == strcmp(argv[0], "idle"))
idle_cmd = 1;
else if (0 == strcmp(argv[0], "noidle"))
idle_cmd = 0;
idle_cmd = 1;
else if (0 == strcmp(argv[0], "close"))
close_cmd = 1;