[cast] Just run empty callback on last request to time out. Running more is unsafe since the first is likely to free the session.

This commit is contained in:
ejurgensen 2016-08-13 00:29:34 +02:00
parent 61457f2a09
commit da8fa6a686
1 changed files with 7 additions and 7 deletions

View File

@ -1205,10 +1205,10 @@ cast_reply_timeout_cb(int fd, short what, void *arg)
int i; int i;
cs = (struct cast_session *)arg; cs = (struct cast_session *)arg;
i = cs->request_id % CALLBACK_REGISTER_SIZE;
DPRINTF(E_WARN, L_CAST, "Request timeout, will run empty callbacks\n"); DPRINTF(E_LOG, L_CAST, "Request %d timed out, will run empty callback\n", i);
for (i = 0; i < CALLBACK_REGISTER_SIZE; i++)
if (cs->callback_register[i]) if (cs->callback_register[i])
{ {
cs->callback_register[i](cs, NULL); cs->callback_register[i](cs, NULL);