MCPcopy Create free account
hub / github.com/amule-project/amule / ClearDownloadBlockRequests

Method ClearDownloadBlockRequests

src/BaseClient.cpp:1206–1244  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1204
1205
1206void CUpDownClient::ClearDownloadBlockRequests()
1207{
1208 {
1209 std::list<Requested_Block_Struct*>::iterator it = m_DownloadBlocks_list.begin();
1210 for (; it != m_DownloadBlocks_list.end(); ++it) {
1211 Requested_Block_Struct* cur_block = *it;
1212
1213 if (m_reqfile){
1214 m_reqfile->RemoveBlockFromList(cur_block->StartOffset, cur_block->EndOffset);
1215 }
1216
1217 delete cur_block;
1218 }
1219
1220 m_DownloadBlocks_list.clear();
1221 }
1222
1223 {
1224 std::list<Pending_Block_Struct*>::iterator it = m_PendingBlocks_list.begin();
1225 for (; it != m_PendingBlocks_list.end(); ++it) {
1226 Pending_Block_Struct* pending = *it;
1227
1228 if (m_reqfile) {
1229 m_reqfile->RemoveBlockFromList(pending->block->StartOffset, pending->block->EndOffset);
1230 }
1231
1232 delete pending->block;
1233 // Not always allocated
1234 if (pending->zStream){
1235 inflateEnd(pending->zStream);
1236 delete pending->zStream;
1237 }
1238
1239 delete pending;
1240 }
1241
1242 m_PendingBlocks_list.clear();
1243 }
1244}
1245
1246
1247bool CUpDownClient::Disconnected(const wxString& DEBUG_ONLY(strReason), bool bFromSocket)

Callers 1

SendBlockRequestsMethod · 0.80

Calls 4

RemoveBlockFromListMethod · 0.80
beginMethod · 0.45
endMethod · 0.45
clearMethod · 0.45

Tested by

no test coverage detected