pculture/miro — pull request #64 by geoffl (2011-11-03 11:51:38+00:00)
Title: bz18416: Fix race with start new download, pause, then resume.

We batch commands to the downloader process nowadays, and an interesting
scenario may occur. A "resume" can either be a new download, or it
can be from an existing resume and the commands make such a distinction.
In addition, in the list of pending commands, a pause and a resume pair
will cancel each other out.

If we start a new download, pause, then resume, and the new
download command does not propagate to the downloader process then we
pause, the downloader will not be notified of the new download job.
If we then resume, the downloader will assume that we are resuming
from an existing job and bail. The problem is a pause cannot perfectly
cancel a resume right now because we don't account for whether it is
existing or new.

Fix this by ensuring that there is no distinction for a resume, and
we take care of this distinction in the downloader process by checking
to see whether the download job is tracked or not. If it is not tracked
we can assume it is a new job.