MCPcopy Create free account
hub / github.com/ddnet/ddnet / OnValidation

Method OnValidation

src/engine/shared/http.cpp:478–501  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

476}
477
478void 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
503void CHttpRequest::WriteToFile(IStorage *pStorage, const char *pDest, int StorageType)
504{

Callers 1

RunMethod · 0.80

Calls 2

fs_removeFunction · 0.85
fs_renameFunction · 0.85

Tested by

no test coverage detected