Without this, the server can be crashed by running
para_client nomore # set the nomore flag
# wait for eof
para_client jmp 50 # set the repos flag, clear the next flag
para_client play # boom
The problem is that the command handler of the jmp command checks
afhi.chunks_total to determine if some audio file is currently
open. Since vss_eof() did not reset chunks_total, the command handler
wrongly believes that there is an open audio file, sets the repos
flag and clears the next flag. When streaming is resumed later, the
virtual streaming system attempts to access the chunk table which
was freed earlier in vss_eof().
static void vss_eof(struct vss_task *vsst)
{
-
if (!vsst->map)
return;
if (mmd->new_vss_status_flags & VSS_NOMORE)
para_munmap(vsst->map, vsst->mapsize);
vsst->map = NULL;
mmd->chunks_sent = 0;
- //mmd->offset = 0;
mmd->afd.afhi.seconds_total = 0;
+ mmd->afd.afhi.chunks_total = 0;
mmd->afd.afhi.chunk_tv.tv_sec = 0;
mmd->afd.afhi.chunk_tv.tv_usec = 0;
free(mmd->afd.afhi.chunk_table);