MCPcopy Create free account
hub / github.com/defold/defold / HttpGetPartial

Method HttpGetPartial

engine/dlib/src/test/test_httpclient.cpp:158–179  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

156 }
157
158 dmHttpClient::Result HttpGetPartial(const char* url, int start, int end)
159 {
160 m_StatusCode = -1;
161 m_RangeStart = 0xFFFFFFFF;
162 m_RangeEnd = 0xFFFFFFFF;
163 m_DocumentSize = 0xFFFFFFFF;
164 m_Content.clear();
165 m_Headers.clear();
166
167 if (start >= 0 && end >= start)
168 {
169 char range[512] = "";
170 dmSnPrintf(range, sizeof(range), "bytes=%d-%d", start, end);
171 m_Headers["Range"] = range;
172
173 char cache_key[1024] = "";
174 dmSnPrintf(cache_key, sizeof(cache_key), "%s=%s", url, range);
175 dmHttpClient::SetCacheKey(m_Client, cache_key);
176 }
177
178 return dmHttpClient::Get(m_Client, url);
179 }
180
181 dmHttpClient::Result HttpPost(const char* url)
182 {

Callers

nothing calls this directly

Calls 4

dmSnPrintfFunction · 0.85
SetCacheKeyFunction · 0.85
GetFunction · 0.50
clearMethod · 0.45

Tested by

no test coverage detected