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

Function http_get_line

libavformat/http.c:163–185  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

161}
162
163static int http_get_line(HTTPContext *s, char *line, int line_size)
164{
165 int ch;
166 char *q;
167
168 q = line;
169 for(;;) {
170 ch = http_getc(s);
171 if (ch < 0)
172 return AVERROR(EIO);
173 if (ch == '\n') {
174 /* process line */
175 if (q > line && q[-1] == '\r')
176 q--;
177 *q = '\0';
178
179 return 0;
180 } else {
181 if ((q - line) < line_size - 1)
182 *q++ = ch;
183 }
184 }
185}
186
187static int process_line(URLContext *h, char *line, int line_count,
188 int *new_location)

Callers 2

http_connectFunction · 0.85
http_readFunction · 0.85

Calls 1

http_getcFunction · 0.85

Tested by

no test coverage detected