MCPcopy Create free account
hub / github.com/FFmpeg/FFmpeg / http_get_line

Function http_get_line

libavformat/http.c:864–886  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

862}
863
864static int http_get_line(HTTPContext *s, char *line, int line_size)
865{
866 int ch;
867 char *q;
868
869 q = line;
870 for (;;) {
871 ch = http_getc(s);
872 if (ch < 0)
873 return ch;
874 if (ch == '\n') {
875 /* process line */
876 if (q > line && q[-1] == '\r')
877 q--;
878 *q = '\0';
879
880 return 0;
881 } else {
882 if ((q - line) < line_size - 1)
883 *q++ = ch;
884 }
885 }
886}
887
888static int check_http_code(URLContext *h, int http_code, const char *end)
889{

Callers 2

http_read_headerFunction · 0.85
http_buf_readFunction · 0.85

Calls 1

http_getcFunction · 0.85

Tested by

no test coverage detected