MCPcopy Create free account
hub / github.com/comaps/comaps / OnWrite

Method OnWrite

libs/platform/http_request.cpp:167–185  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

165 }
166
167 virtual bool OnWrite(int64_t offset, void const * buffer, size_t size)
168 {
169#ifdef DEBUG
170 static threads::ThreadID const id = threads::GetCurrentThreadID();
171 ASSERT_EQUAL(id, threads::GetCurrentThreadID(), ("OnWrite called from different threads"));
172#endif
173
174 try
175 {
176 m_writer->Seek(offset);
177 m_writer->Write(buffer, size);
178 return true;
179 }
180 catch (Writer::Exception const & e)
181 {
182 LOG(LWARNING, ("Can't write buffer for size", size, e.Msg()));
183 return false;
184 }
185 }
186
187 // Saves current chunks' statuses into a resume file.
188 void SaveResumeChunks()

Calls 3

GetCurrentThreadIDFunction · 0.85
SeekMethod · 0.45
WriteMethod · 0.45

Tested by

no test coverage detected