Do call the callback even if it fails

This commit is contained in:
Learath Lea 2015-03-29 00:46:43 +02:00
parent 0024a4370c
commit 1839025732

View file

@ -85,6 +85,8 @@ void CFetcher::FetcherThread(void *pUser)
{ {
dbg_msg("fetcher", "Task got %s:%s", pTask->m_pUrl, pTask->m_pDest); dbg_msg("fetcher", "Task got %s:%s", pTask->m_pUrl, pTask->m_pDest);
pFetcher->FetchFile(pTask); pFetcher->FetchFile(pTask);
if(pTask->m_pfnCompCallback)
pTask->m_pfnCompCallback(pTask, pTask->m_pUser);
} }
else else
thread_sleep(10); thread_sleep(10);
@ -137,10 +139,7 @@ void CFetcher::FetchFile(CFetchTask *pTask)
{ {
dbg_msg("fetcher", "Task done %s", pTask->m_pDest); dbg_msg("fetcher", "Task done %s", pTask->m_pDest);
pTask->m_State = CFetchTask::STATE_DONE; pTask->m_State = CFetchTask::STATE_DONE;
} }
if(pTask->m_pfnCompCallback)
pTask->m_pfnCompCallback(pTask, pTask->m_pUser);
} }
void CFetcher::WriteToFile(char *pData, size_t size, size_t nmemb, void *pFile) void CFetcher::WriteToFile(char *pData, size_t size, size_t nmemb, void *pFile)