[mpd] Close connection for close command (#444)

This commit is contained in:
Wolfgang Scherer 2017-11-21 19:29:17 +01:00 committed by ejurgensen
parent 4800f9943b
commit dcc6fcf206

View File

@ -4542,6 +4542,17 @@ mpd_read_cb(struct bufferevent *bev, void *ctx)
{
evbuffer_add(output, "OK\n", 3);
}
if (close_cmd)
{
/*
* Freeing the bufferevent closes the connection, if it was
* opened with BEV_OPT_CLOSE_ON_FREE.
* Since bufferevent is reference-counted, it will happen as
* soon as possible, not necessarily immediately.
*/
bufferevent_free(bev);
}
}
/*