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

Function HttpClient_HasBody

src/Http_Worker.c:434–443  ·  view source on GitHub ↗

RFC 7230, section 3.3.3 - Message Body Length */

Source from the content-addressed store, hash-verified

432
433/* RFC 7230, section 3.3.3 - Message Body Length */
434static cc_bool HttpClient_HasBody(struct HttpRequest* req) {
435 /* HEAD responses never have a message body */
436 if (req->requestType == REQUEST_TYPE_HEAD) return false;
437 /* 1XX (Information) responses don't have message body */
438 if (req->statusCode >= 100 && req->statusCode <= 199) return false;
439 /* 204 (No Content) and 304 (Not Modified) also don't */
440 if (req->statusCode == 204 || req->statusCode == 304) return false;
441
442 return true;
443}
444
445static int HttpClient_BeginBody(struct HttpRequest* req, struct HttpClientState* state) {
446 if (!HttpClient_HasBody(req))

Callers 1

HttpClient_BeginBodyFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected