| 476 | } |
| 477 | |
| 478 | void CHttpRequest::OnValidation(bool Success) |
| 479 | { |
| 480 | dbg_assert(m_ValidateBeforeOverwrite, "this function is illegal to call without having set ValidateBeforeOverwrite"); |
| 481 | m_ValidateBeforeOverwrite = false; |
| 482 | if(Success) |
| 483 | { |
| 484 | if(m_IfModifiedSince >= 0 && m_StatusCode == 304) // 304 Not Modified |
| 485 | { |
| 486 | fs_remove(m_aDestAbsoluteTmp); |
| 487 | return; |
| 488 | } |
| 489 | if(fs_rename(m_aDestAbsoluteTmp, m_aDestAbsolute)) |
| 490 | { |
| 491 | log_error("http", "i/o error, cannot move file: %s", m_aDest); |
| 492 | m_State = EHttpState::ERROR; |
| 493 | fs_remove(m_aDestAbsoluteTmp); |
| 494 | } |
| 495 | } |
| 496 | else |
| 497 | { |
| 498 | m_State = EHttpState::ERROR; |
| 499 | fs_remove(m_aDestAbsoluteTmp); |
| 500 | } |
| 501 | } |
| 502 | |
| 503 | void CHttpRequest::WriteToFile(IStorage *pStorage, const char *pDest, int StorageType) |
| 504 | { |