rs/SDWebImage — pull request #883 by mattjgalloway (2014-09-01 10:16:44+00:00)
Title: Fix multiple requests for same image and then canceling one

SDWebImage helpfully downloads only once if a request for the same image comes in more than once while the image is still being downloaded. However, it doesn't handle canceling correctly. Only the first operation gets a handle to the download operation, and therefore is the only one which can cancel it. Moreover, if it does cancel it, then the other operations waiting on that download never complete either.

This patch changes things slightly so that the downloader gives out a "token" that can be used to cancel the request to download. It then removes callbacks for that one token, leaving the actual download operation running.