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

Method BeforeInit

src/engine/shared/http.cpp:117–144  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

115}
116
117bool CHttpRequest::BeforeInit()
118{
119 if(m_WriteToFile)
120 {
121 if(m_SkipByFileTime)
122 {
123 time_t FileCreatedTime, FileModifiedTime;
124 if(fs_file_time(m_aDestAbsolute, &FileCreatedTime, &FileModifiedTime) == 0)
125 {
126 m_IfModifiedSince = FileModifiedTime;
127 }
128 }
129
130 if(fs_makedir_rec_for(m_aDestAbsoluteTmp) < 0)
131 {
132 log_error("http", "i/o error, cannot create folder for: %s", m_aDest);
133 return false;
134 }
135
136 m_File = io_open(m_aDestAbsoluteTmp, IOFLAG_WRITE);
137 if(!m_File)
138 {
139 log_error("http", "i/o error, cannot open file: %s", m_aDest);
140 return false;
141 }
142 }
143 return true;
144}
145
146bool CHttpRequest::ConfigureHandle(void *pHandle)
147{

Callers

nothing calls this directly

Calls 3

fs_file_timeFunction · 0.85
fs_makedir_rec_forFunction · 0.85
io_openFunction · 0.85

Tested by

no test coverage detected