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

Method SetUploadFileID

src/UploadClient.cpp:260–288  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

258
259
260void CUpDownClient::SetUploadFileID(CKnownFile* newreqfile)
261{
262 if (m_uploadingfile == newreqfile) {
263 return;
264 } else if (m_uploadingfile) {
265 m_uploadingfile->RemoveUploadingClient(this);
266 m_uploadingfile->UpdateUpPartsFrequency(this, false); // Decrement
267 }
268
269 if (newreqfile) {
270 // This is a new file! update info
271 newreqfile->AddUploadingClient(this);
272
273 if (m_requpfileid != newreqfile->GetFileHash()) {
274 m_requpfileid = newreqfile->GetFileHash();
275 m_upPartStatus.setsize( newreqfile->GetPartCount(), 0 );
276 } else {
277 // this is the same file we already had assigned. Only update data.
278 newreqfile->UpdateUpPartsFrequency(this, true); // Increment
279 }
280
281 m_uploadingfile = newreqfile;
282 } else {
283 m_upPartStatus.clear();
284 m_nUpCompleteSourcesCount = 0;
285 // This clears m_uploadingfile and m_requpfileid
286 ClearUploadFileID();
287 }
288}
289
290
291void CUpDownClient::AddReqBlock(Requested_Block_Struct* reqblock, bool bSignalIOThread)

Callers 3

ProcessPacketMethod · 0.80
ProcessExtPacketMethod · 0.80

Calls 7

setsizeMethod · 0.80
GetPartCountMethod · 0.80
RemoveUploadingClientMethod · 0.45
AddUploadingClientMethod · 0.45
clearMethod · 0.45
GetFileByIDMethod · 0.45

Tested by

no test coverage detected