MCPcopy Create free account
hub / github.com/buke/quickjs-go / http_get_header_line

Function http_get_header_line

deps/quickjs/quickjs-libc.c:1703–1723  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1701#define URL_GET_BUF_SIZE 4096
1702
1703static int http_get_header_line(FILE *f, char *buf, size_t buf_size,
1704 DynBuf *dbuf)
1705{
1706 int c;
1707 char *p;
1708
1709 p = buf;
1710 for(;;) {
1711 c = fgetc(f);
1712 if (c < 0)
1713 return -1;
1714 if ((p - buf) < buf_size - 1)
1715 *p++ = c;
1716 if (dbuf)
1717 dbuf_putc(dbuf, c);
1718 if (c == '\n')
1719 break;
1720 }
1721 *p = '\0';
1722 return 0;
1723}
1724
1725static int http_get_status(const char *buf)
1726{

Callers 1

js_std_urlGetFunction · 0.85

Calls 1

dbuf_putcFunction · 0.85

Tested by

no test coverage detected