If we don't do this, we can activate a request twice. The issue here is that we use memory address as the 'key'. So if we destroy a request, another request might take the same memory address, or the same 'key'. The entry at 'pendingRequests' survives the 'cancel()' and is ultimatelly removed at 'activatePendingRequest()'. This is fine unless a request is created using the same 'key' before we call 'activatePendingRequest()'. The check if the request was canceled at 'activatePendingRequest()' will be no longer valid, activating the request. At the same time the request will be activated again by the task scheduled at the constructor of the 'OnlineFileRequestImpl' class.
9.6 KiB
9.6 KiB