MCPcopy Create free account
hub / github.com/git/git / read_request_fixed_len

Function read_request_fixed_len

http-backend.c:345–364  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

343}
344
345static ssize_t read_request_fixed_len(int fd, ssize_t req_len, unsigned char **out)
346{
347 unsigned char *buf = NULL;
348 ssize_t cnt = 0;
349
350 if (max_request_buffer < req_len) {
351 die("request was larger than our maximum size (%lu): "
352 "%" PRIuMAX "; try setting GIT_HTTP_MAX_REQUEST_BUFFER",
353 max_request_buffer, (uintmax_t)req_len);
354 }
355
356 buf = xmalloc(req_len);
357 cnt = read_in_full(fd, buf, req_len);
358 if (cnt < 0) {
359 free(buf);
360 return -1;
361 }
362 *out = buf;
363 return cnt;
364}
365
366static ssize_t get_content_length(void)
367{

Callers 1

read_requestFunction · 0.85

Calls 3

read_in_fullFunction · 0.85
dieFunction · 0.70
xmallocFunction · 0.70

Tested by

no test coverage detected