http.h

simple http library for c99
git clone git://git.kocotian.pl/http.h.git
Log | Files | Refs | README | LICENSE

commit ed91bcde5d976ae58d745b5da31cc53e2cc36543
parent b2734791dccf6c71adea9276a7859bc01c1c28b0
Author: kocotian <54662947+kocotian@users.noreply.github.com>
Date:   Sun, 11 Oct 2020 18:28:49 +0200

version 0.1.2

added getHeaderLength() function that returns header size
Diffstat:
Mhttp.h | 8+++++++-
1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/http.h b/http.h @@ -6,7 +6,7 @@ /* * http.h * simple and small http library for C99 - * version 0.1.1 + * version 0.1.2 * creator: kocotian */ @@ -27,6 +27,7 @@ long long int httpGET(char *hostname, unsigned short port, char *path, char **bu int getResponseStatus(char *response); int parseResponseLine(char *response, char *value, char **buffer); char *truncateHeader(char *response); +int getHeaderLength(char *response); long long int httpGET(char *hostname, unsigned short port, char *path, char **buffer) @@ -135,4 +136,9 @@ char *truncateHeader(char *response) return strstr(response, "\r\n\r\n") + 4; } +int getHeaderLength(char *response) +{ + return strstr(response, "\r\n\r\n") - response; +} + #endif