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

Function HttpHeader

engine/script/src/http_service.cpp:92–106  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

90 };
91
92 void HttpHeader(dmHttpClient::HResponse response, void* user_data, int status_code, const char* key, const char* value)
93 {
94 Worker* worker = (Worker*) user_data;
95 worker->m_Status = status_code;
96 dmArray<char>& h = worker->m_Headers;
97 uint32_t len = strlen(key) + strlen(value) + 2;
98 uint32_t left = h.Capacity() - h.Size();
99 if (left < len) {
100 h.OffsetCapacity((int32_t) dmMath::Max(len - left, 8U * 1024U));
101 }
102 h.PushArray(key, strlen(key));
103 h.Push(':');
104 h.PushArray(value, strlen(value));
105 h.Push('\n');
106 }
107
108 // Called from the http thread(s)
109 void HttpContent(dmHttpClient::HResponse response, void* user_data, int status_code,

Callers

nothing calls this directly

Calls 6

PushArrayMethod · 0.80
MaxFunction · 0.50
CapacityMethod · 0.45
SizeMethod · 0.45
OffsetCapacityMethod · 0.45
PushMethod · 0.45

Tested by

no test coverage detected