From ca8037e28d09ed96448509316a935eb130e6d3db Mon Sep 17 00:00:00 2001 From: Wilmer van der Gaast Date: Sun, 9 Jun 2013 22:17:45 +0100 Subject: Add better handling of HTTP/1.1 and/or keepalive connections. This should let me close #641, and more importantly, prepares the Twitter module for an upcoming API change. https://dev.twitter.com/blog/deprecating-http-1.0-streaming-api --- lib/http_client.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'lib/http_client.h') diff --git a/lib/http_client.h b/lib/http_client.h index ca427118..1b86f228 100644 --- a/lib/http_client.h +++ b/lib/http_client.h @@ -41,6 +41,7 @@ typedef enum http_client_flags { HTTPC_STREAMING = 1, HTTPC_EOF = 2, + HTTPC_CHUNKED = 4, /* Let's reserve 0x1000000+ for lib users. */ } http_client_flags_t; @@ -76,10 +77,15 @@ struct http_request int inpa; int bytes_written; int bytes_read; + int content_length; /* "Content-Length:" header or -1 */ /* Used in streaming mode. Caller should read from reply_body. */ char *sbuf; size_t sblen; + + /* Chunked encoding only. Raw chunked stream is decoded from here. */ + char *cbuf; + size_t cblen; }; /* The _url variant is probably more useful than the raw version. The raw -- cgit v1.2.3