this gets called upon the IO has been executed to call the callbacks
| 432 | |
| 433 | // this gets called upon the IO has been executed to call the callbacks |
| 434 | void CRefReadStreamProxy::FinalizeIO() |
| 435 | { |
| 436 | if (m_pCallback) |
| 437 | { |
| 438 | // be carefull! this object can be deallocated inside the callback! |
| 439 | IStreamCallback* pCallback = m_pCallback; |
| 440 | m_pCallback = NULL; // don't call this callback any more as it may have been deallocated |
| 441 | #if LOG_IO |
| 442 | g_System->GetILog()->LogToFile ("\006io(%s) err %d%s%s%s%s piece(%d:%d) read %d %s userdata %d, pri %d, flags %x, offs %d, size %d", m_strClient.c_str(), m_nIOError, |
| 443 | m_bError?" Error":"", m_bFinished?" Finished":"", m_bFreeBuffer?" FreeBuffer":"", m_bPending?" Pending":"", |
| 444 | m_nPieceOffset, m_nPieceLength, |
| 445 | m_numBytesRead, |
| 446 | m_pStream->GetFileName().c_str(), |
| 447 | m_Params.dwUserData, |
| 448 | m_Params.nPriority, |
| 449 | m_Params.nFlags, |
| 450 | m_Params.nOffset,m_Params.nSize); |
| 451 | #endif |
| 452 | pCallback->StreamOnComplete(this, m_bError?m_nIOError:0); |
| 453 | #if LOG_IO |
| 454 | g_System->GetILog()->LogToFile ("\006io callback %p returned", pCallback); |
| 455 | #endif |
| 456 | } |
| 457 | } |
| 458 | |
| 459 | string CRefReadStreamProxy::Dump() |
| 460 | { |
no test coverage detected