| 1090 | } |
| 1091 | |
| 1092 | void ClientNetworkContentSocketHandler::OnDownloadComplete(ContentID cid) |
| 1093 | { |
| 1094 | ContentInfo *ci = this->GetContent(cid); |
| 1095 | if (ci != nullptr) { |
| 1096 | ci->state = ContentInfo::State::AlreadyHere; |
| 1097 | } |
| 1098 | |
| 1099 | for (size_t i = 0; i < this->callbacks.size(); /* nothing */) { |
| 1100 | ContentCallback *cb = this->callbacks[i]; |
| 1101 | /* the callback may remove itself from this->callbacks */ |
| 1102 | cb->OnDownloadComplete(cid); |
| 1103 | if (i != this->callbacks.size() && this->callbacks[i] == cb) i++; |
| 1104 | } |
| 1105 | } |
no test coverage detected