Turn req_in_flight into a counter

This commit is contained in:
Julien BLACHE 2011-03-11 19:36:51 +01:00
parent a4f02ed08d
commit ef52e922b2

View File

@ -96,11 +96,11 @@ struct raop_session
struct evrtsp_connection *ctrl;
enum raop_session_state state;
unsigned req_in_flight:1;
unsigned req_has_auth:1;
unsigned encrypt:1;
unsigned auth_quirk_itunes:1;
int reqs_in_flight;
int cseq;
char *session;
char session_url[128];
@ -1080,7 +1080,7 @@ raop_send_req_teardown(struct raop_session *rs, evrtsp_req_cb cb)
return -1;
}
rs->req_in_flight = 1;
rs->reqs_in_flight++;
evrtsp_connection_set_closecb(rs->ctrl, NULL, NULL);
@ -1128,7 +1128,7 @@ raop_send_req_flush(struct raop_session *rs, uint64_t rtptime, evrtsp_req_cb cb)
return -1;
}
rs->req_in_flight = 1;
rs->reqs_in_flight++;
evrtsp_connection_set_closecb(rs->ctrl, NULL, NULL);
@ -1178,7 +1178,7 @@ raop_send_req_set_parameter(struct raop_session *rs, struct evbuffer *evbuf, cha
return -1;
}
rs->req_in_flight = 1;
rs->reqs_in_flight++;
evrtsp_connection_set_closecb(rs->ctrl, NULL, NULL);
@ -1228,7 +1228,7 @@ raop_send_req_record(struct raop_session *rs, evrtsp_req_cb cb)
return -1;
}
rs->req_in_flight = 1;
rs->reqs_in_flight++;
return 0;
}
@ -1276,7 +1276,7 @@ raop_send_req_setup(struct raop_session *rs, evrtsp_req_cb cb)
return -1;
}
rs->req_in_flight = 1;
rs->reqs_in_flight++;
return 0;
}
@ -1382,7 +1382,7 @@ raop_send_req_announce(struct raop_session *rs, evrtsp_req_cb cb)
return -1;
}
rs->req_in_flight = 1;
rs->reqs_in_flight++;
return 0;
@ -1421,7 +1421,7 @@ raop_send_req_options(struct raop_session *rs, evrtsp_req_cb cb)
return -1;
}
rs->req_in_flight = 1;
rs->reqs_in_flight++;
evrtsp_connection_set_closecb(rs->ctrl, NULL, NULL);
@ -1585,6 +1585,7 @@ raop_session_make(struct raop_device *rd, int family, raop_status_cb cb)
memset(rs, 0, sizeof(struct raop_session));
rs->state = RAOP_STOPPED;
rs->reqs_in_flight = 0;
rs->cseq = 1;
rs->dev = rd;
@ -1763,11 +1764,11 @@ raop_cb_set_volume(struct evrtsp_request *req, void *arg)
rs = (struct raop_session *)arg;
rs->reqs_in_flight--;
if (!req)
goto error;
rs->req_in_flight = 0;
if (req->response_code != RTSP_OK)
{
DPRINTF(E_LOG, L_RAOP, "SET_PARAMETER request failed for stream volume: %d %s\n", req->response_code, req->response_code_line);
@ -1823,11 +1824,11 @@ raop_cb_flush(struct evrtsp_request *req, void *arg)
rs = (struct raop_session *)arg;
rs->reqs_in_flight--;
if (!req)
goto error;
rs->req_in_flight = 0;
if (req->response_code != RTSP_OK)
{
DPRINTF(E_LOG, L_RAOP, "FLUSH request failed: %d %s\n", req->response_code, req->response_code_line);
@ -2861,11 +2862,11 @@ raop_cb_startup_volume(struct evrtsp_request *req, void *arg)
rs = (struct raop_session *)arg;
rs->reqs_in_flight--;
if (!req)
goto cleanup;
rs->req_in_flight = 0;
if (req->response_code != RTSP_OK)
{
DPRINTF(E_LOG, L_RAOP, "SET_PARAMETER request failed for startup volume: %d %s\n", req->response_code, req->response_code_line);
@ -2908,11 +2909,11 @@ raop_cb_startup_record(struct evrtsp_request *req, void *arg)
rs = (struct raop_session *)arg;
rs->reqs_in_flight--;
if (!req)
goto cleanup;
rs->req_in_flight = 0;
if (req->response_code != RTSP_OK)
{
DPRINTF(E_LOG, L_RAOP, "RECORD request failed in session startup: %d %s\n", req->response_code, req->response_code_line);
@ -2955,11 +2956,11 @@ raop_cb_startup_setup(struct evrtsp_request *req, void *arg)
rs = (struct raop_session *)arg;
rs->reqs_in_flight--;
if (!req)
goto cleanup;
rs->req_in_flight = 0;
if (req->response_code != RTSP_OK)
{
DPRINTF(E_LOG, L_RAOP, "SETUP request failed in session startup: %d %s\n", req->response_code, req->response_code_line);
@ -3100,11 +3101,11 @@ raop_cb_startup_announce(struct evrtsp_request *req, void *arg)
rs = (struct raop_session *)arg;
rs->reqs_in_flight--;
if (!req)
goto cleanup;
rs->req_in_flight = 0;
if (req->response_code != RTSP_OK)
{
DPRINTF(E_LOG, L_RAOP, "ANNOUNCE request failed in session startup: %d %s\n", req->response_code, req->response_code_line);
@ -3137,11 +3138,11 @@ raop_cb_startup_options(struct evrtsp_request *req, void *arg)
rs = (struct raop_session *)arg;
rs->reqs_in_flight--;
if (!req)
goto cleanup;
rs->req_in_flight = 0;
if ((req->response_code != RTSP_OK) && (req->response_code != RTSP_UNAUTHORIZED))
{
DPRINTF(E_LOG, L_RAOP, "OPTIONS request failed in session startup: %d %s\n", req->response_code, req->response_code_line);
@ -3201,11 +3202,11 @@ raop_cb_shutdown_teardown(struct evrtsp_request *req, void *arg)
rs = (struct raop_session *)arg;
rs->reqs_in_flight--;
if (!req)
goto error;
rs->req_in_flight = 0;
if (req->response_code != RTSP_OK)
{
DPRINTF(E_LOG, L_RAOP, "TEARDOWN request failed in session shutdown: %d %s\n", req->response_code, req->response_code_line);
@ -3242,11 +3243,11 @@ raop_cb_probe_options(struct evrtsp_request *req, void *arg)
rs = (struct raop_session *)arg;
rs->reqs_in_flight--;
if (!req)
goto cleanup;
rs->req_in_flight = 0;
if ((req->response_code != RTSP_OK) && (req->response_code != RTSP_UNAUTHORIZED))
{
DPRINTF(E_LOG, L_RAOP, "OPTIONS request failed in device probe: %d %s\n", req->response_code, req->response_code_line);