| 438 | |
| 439 | |
| 440 | void CHTTPDownloadThread::Stop() |
| 441 | { |
| 442 | if (m_request.IsOk() && !m_finishPosted) { |
| 443 | // Fire-and-forget: wxWebRequest will schedule a State_Cancelled |
| 444 | // event on the main loop. Our OnStateEvent will run |
| 445 | // FinishAndDestroy at that point. |
| 446 | m_request.Cancel(); |
| 447 | } else if (!m_finishPosted) { |
| 448 | // Request never got off the ground (e.g. invalid URL, or Stop() |
| 449 | // called before Start() had a chance). Finish synchronously. |
| 450 | FinishAndDestroy(HTTP_Error); |
| 451 | } |
| 452 | } |
| 453 | |
| 454 | |
| 455 | void CHTTPDownloadThread::StopAll() |
no test coverage detected