MCPcopy Create free account
hub / github.com/ClassiCube/ClassiCube / HttpClient_BeginBody

Function HttpClient_BeginBody

src/Http_Worker.c:445–456  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

443}
444
445static int HttpClient_BeginBody(struct HttpRequest* req, struct HttpClientState* state) {
446 if (!HttpClient_HasBody(req))
447 return HTTP_RESPONSE_STATE_DONE;
448
449 if (state->chunked)
450 return HTTP_RESPONSE_STATE_CHUNK_HEADER;
451 if (req->contentLength)
452 return HTTP_RESPONSE_STATE_DATA;
453
454 /* Zero length response */
455 return HTTP_RESPONSE_STATE_DONE;
456}
457
458/* RFC 7230, section 4.1 - Chunked Transfer Coding */
459static int HttpClient_GetChunkLength(const cc_string* line) {

Callers 1

HttpClient_ProcessFunction · 0.85

Calls 1

HttpClient_HasBodyFunction · 0.85

Tested by

no test coverage detected