| 258 | |
| 259 | |
| 260 | void 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 | |
| 291 | void CUpDownClient::AddReqBlock(Requested_Block_Struct* reqblock, bool bSignalIOThread) |
no test coverage detected