summaryrefslogtreecommitdiff
path: root/lib/http.c
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2005-02-09 13:06:40 +0000
committerDaniel Stenberg <daniel@haxx.se>2005-02-09 13:06:40 +0000
commit6a2e21ec8cbaf7c719902e06953d9dbec629ad4f (patch)
treec09552b516d0d6dadc999ef446843ba32db4f1e1 /lib/http.c
parent120f17ce04794f55603a1edcd8ec8f89a09fe4ca (diff)
downloadcurl-6a2e21ec8cbaf7c719902e06953d9dbec629ad4f.tar.gz
FTP code turned into state machine. Not completely yet, but a good start.
The tag 'before_ftp_statemachine' was set just before this commit in case of future need.
Diffstat (limited to 'lib/http.c')
-rw-r--r--lib/http.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/lib/http.c b/lib/http.c
index 3a7af8f6e..051643126 100644
--- a/lib/http.c
+++ b/lib/http.c
@@ -5,7 +5,7 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
- * Copyright (C) 1998 - 2004, Daniel Stenberg, <daniel@haxx.se>, et al.
+ * Copyright (C) 1998 - 2005, Daniel Stenberg, <daniel@haxx.se>, et al.
*
* This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms
@@ -1222,7 +1222,7 @@ CURLcode Curl_ConnectHTTPProxyTunnel(struct connectdata *conn,
* Curl_http_connect() performs HTTP stuff to do at connect-time, called from
* the generic Curl_connect().
*/
-CURLcode Curl_http_connect(struct connectdata *conn)
+CURLcode Curl_http_connect(struct connectdata *conn, bool *done)
{
struct SessionHandle *data;
CURLcode result;
@@ -1261,6 +1261,8 @@ CURLcode Curl_http_connect(struct connectdata *conn)
data->state.first_host = strdup(conn->host.name);
}
+ *done = TRUE;
+
return CURLE_OK;
}
@@ -1328,7 +1330,7 @@ CURLcode Curl_http_done(struct connectdata *conn,
* request is to be performed. This creates and sends a properly constructed
* HTTP request.
*/
-CURLcode Curl_http(struct connectdata *conn)
+CURLcode Curl_http(struct connectdata *conn, bool *done)
{
struct SessionHandle *data=conn->data;
char *buf = data->state.buffer; /* this is a short cut to the buffer */
@@ -1342,6 +1344,11 @@ CURLcode Curl_http(struct connectdata *conn)
Curl_HttpReq httpreq = data->set.httpreq;
char *addcookies = NULL;
+ /* Always consider the DO phase done after this function call, even if there
+ may be parts of the request that is not yet sent, since we can deal with
+ the rest of the request in the PERFORM phase. */
+ *done = TRUE;
+
if(!conn->proto.http) {
/* Only allocate this struct if we don't already have it! */