| 1019 | |
| 1020 | |
| 1021 | void CAICHHashSet::DropReferencesTo(const CKnownFile* file) |
| 1022 | { |
| 1023 | // Pointer-value strip of any in-flight AICH recovery request that |
| 1024 | // names `file`. Called from MuleNotify::KnownFileBeingDestroyed |
| 1025 | // (GuiEvents.cpp) before the CKnownFile / CPartFile is freed by |
| 1026 | // CPartFile::Delete() or CKnownFileList::PruneDuplicates. Without |
| 1027 | // this, the pending request would deref the dangling partfile |
| 1028 | // when the recovery data eventually arrives (RequestAICHRecovery's |
| 1029 | // existing IsPartFile() guard at line ~990 catches some cases |
| 1030 | // but a freed-then-reused pointer can spoof that check and |
| 1031 | // route recovery to the wrong file). |
| 1032 | // |
| 1033 | // CPartFile inherits from CKnownFile (single inheritance, same |
| 1034 | // address), so the cast in the comparison is no-deref. Same- |
| 1035 | // thread call (main thread) so no synchronisation needed on |
| 1036 | // the static list beyond the normal amule single-threaded GUI |
| 1037 | // contract. |
| 1038 | for (CAICHRequestedDataList::iterator it = m_liRequestedData.begin(); |
| 1039 | it != m_liRequestedData.end(); /* manual ++ */) { |
| 1040 | if (static_cast<const CKnownFile*>(it->m_pPartFile) == file) { |
| 1041 | it = m_liRequestedData.erase(it); |
| 1042 | } else { |
| 1043 | ++it; |
| 1044 | } |
| 1045 | } |
| 1046 | } |
| 1047 | |
| 1048 | CAICHRequestedData CAICHHashSet::GetAICHReqDetails(const CUpDownClient* pClient) |
| 1049 | { |
no test coverage detected