Change the confusing two variables for the expect 100 continue stuff into

a single state variable to make the code easier to follow and understand.
This commit is contained in:
Daniel Stenberg
2008-03-13 20:56:13 +00:00
parent b74cdee6ab
commit 553ed99e3b
2 changed files with 29 additions and 24 deletions

View File

@@ -672,6 +672,14 @@ typedef CURLcode (*Curl_do_more_func)(struct connectdata *);
typedef CURLcode (*Curl_done_func)(struct connectdata *, CURLcode, bool);
enum expect100 {
EXP100_SEND_DATA, /* enough waiting, just send the body now */
EXP100_AWAITING_CONTINUE, /* waiting for the 100 Continue header */
EXP100_SENDING_REQUEST, /* still sending the request but will wait for
the 100 header once done with the request */
EXP100_FAILED /* used on 417 Expectation Failed */
};
/*
* Request specific data in the easy handle (SessionHandle). Previously,
* these members were on the connectdata struct but since a conn struct may
@@ -721,12 +729,8 @@ struct SingleRequest {
int httpcode; /* error code from the 'HTTP/1.? XXX' line */
int httpversion; /* the HTTP version*10 */
struct timeval start100; /* time stamp to wait for the 100 code from */
bool write_after_100_header; /* TRUE = we enable the write after we
received a 100-continue/timeout or
FALSE = directly */
bool wait100_after_headers; /* TRUE = after the request-headers have been
sent off properly, we go into the wait100
state, FALSE = don't */
enum expect100 exp100; /* expect 100 continue state */
int content_encoding; /* What content encoding. sec 3.5, RFC2616. */
#define IDENTITY 0 /* No encoding */