| 1701 | #define URL_GET_BUF_SIZE 4096 |
| 1702 | |
| 1703 | static 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 | |
| 1725 | static int http_get_status(const char *buf) |
| 1726 | { |
no test coverage detected