From 553ed99e3b5fce75e02167bb291b214576573ea9 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Thu, 13 Mar 2008 20:56:13 +0000 Subject: 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. --- lib/urldata.h | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'lib/urldata.h') diff --git a/lib/urldata.h b/lib/urldata.h index 95ef36b82..ce6287190 100644 --- a/lib/urldata.h +++ b/lib/urldata.h @@ -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 */ -- cgit v1.2.3