Remove leaked callback when CleanUp() from TimeoutCallback().
When CleanUp() is called indirectly from TimeoutCallback(), the
TimeoutCallback() itself is canceled before the new recurrent call is
scheduled. The CancelTask() call will trivially succeed because the
callback already triggered.
Before CL:281197, the g_source_destroy() call to remove the currently
running callback would prevent it from being re-scheduled even if it
returns TRUE from the callback.
This patch re-schedules the callback before calling CurlPerformOnce()
so CancelTask() would cancel the scheduled task.
Bug: chromium:535649
Test: Added unittest. Verified it fails without the change.
Change-Id: Ica742dab0eb8d9d5c5055c8afac9d775ad1e0012
3 files changed