Re-establish closecb only when no requests are in flight

This commit is contained in:
Julien BLACHE 2011-03-11 20:02:29 +01:00
parent ef52e922b2
commit 961b2484b8
1 changed files with 6 additions and 3 deletions

View File

@ -1785,7 +1785,8 @@ raop_cb_set_volume(struct evrtsp_request *req, void *arg)
rs->status_cb = NULL;
status_cb(rs->dev, rs, rs->state);
evrtsp_connection_set_closecb(rs->ctrl, raop_rtsp_close_cb, rs);
if (!rs->reqs_in_flight)
evrtsp_connection_set_closecb(rs->ctrl, raop_rtsp_close_cb, rs);
return;
@ -1847,7 +1848,8 @@ raop_cb_flush(struct evrtsp_request *req, void *arg)
rs->status_cb = NULL;
status_cb(rs->dev, rs, rs->state);
evrtsp_connection_set_closecb(rs->ctrl, raop_rtsp_close_cb, rs);
if (!rs->reqs_in_flight)
evrtsp_connection_set_closecb(rs->ctrl, raop_rtsp_close_cb, rs);
return;
@ -2892,7 +2894,8 @@ raop_cb_startup_volume(struct evrtsp_request *req, void *arg)
status_cb(rs->dev, rs, rs->state);
evrtsp_connection_set_closecb(rs->ctrl, raop_rtsp_close_cb, rs);
if (!rs->reqs_in_flight)
evrtsp_connection_set_closecb(rs->ctrl, raop_rtsp_close_cb, rs);
return;