mirror of
https://github.com/curl/curl.git
synced 2026-08-24 23:43:40 +03:00
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.
This commit is contained in:
parent
120f17ce04
commit
6a2e21ec8c
34 changed files with 2970 additions and 1755 deletions
13
lib/http.c
13
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! */
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue