fixed a bug of sending http/1.0 taken from the peer while chunking.

enhanced proxy handling in general
This commit is contained in:
2012-04-09 15:29:33 +00:00
parent e360d3396c
commit 654003e06d
6 changed files with 206 additions and 86 deletions

View File

@ -74,6 +74,8 @@ struct qse_htrd_t
{
struct
{
int flags;
int crlf; /* crlf status */
qse_size_t plen; /* raw request length excluding crlf */
qse_size_t need; /* number of octets needed for contents */
@ -86,8 +88,7 @@ struct qse_htrd_t
} chunk;
} s; /* state */
/* buffers needed to for processing a request */
/* buffers needed for processing a request */
struct
{
qse_htob_t raw; /* buffer to hold raw octets */
@ -163,8 +164,13 @@ int qse_htrd_feed (
qse_size_t len /**< number of octets */
);
int qse_htrd_read (
qse_htrd_t* htrd /**< htrd */
/**
* The qse_htrd_halt() function indicates the end of feeeding
* if the current response should be processed until the
* connection is closed.
*/
int qse_htrd_halt (
qse_htrd_t* htrd
);
int qse_htrd_scanqparam (

View File

@ -81,10 +81,11 @@ struct qse_htre_t
/* special attributes derived from the header */
struct
{
int chunked;
int content_length_set;
#define QSE_HTRE_ATTR_CHUNKED (1 << 0)
#define QSE_HTRE_ATTR_LENGTH (1 << 1)
#define QSE_HTRE_ATTR_KEEPALIVE (1 << 2)
int flags;
qse_size_t content_length;
int keepalive;
const qse_mchar_t* expect;
const qse_mchar_t* status;
} attr;