From 6a2e21ec8cbaf7c719902e06953d9dbec629ad4f Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Wed, 9 Feb 2005 13:06:40 +0000 Subject: 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. --- lib/transfer.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'lib/transfer.c') diff --git a/lib/transfer.c b/lib/transfer.c index ea7c5dbe3..9b37988de 100644 --- a/lib/transfer.c +++ b/lib/transfer.c @@ -5,7 +5,7 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2004, Daniel Stenberg, , et al. + * Copyright (C) 1998 - 2005, Daniel Stenberg, , et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms @@ -2027,9 +2027,11 @@ Curl_connect_host(struct SessionHandle *data, do { bool async; + bool protocol_done=TRUE; /* will be TRUE always since this is only used + within the easy interface */ Curl_pgrsTime(data, TIMER_STARTSINGLE); data->change.url_changed = FALSE; - res = Curl_connect(data, conn, &async); + res = Curl_connect(data, conn, &async, &protocol_done); if((CURLE_OK == res) && async) { /* Now, if async is TRUE here, we need to wait for the name @@ -2037,8 +2039,9 @@ Curl_connect_host(struct SessionHandle *data, res = Curl_wait_for_resolv(*conn, NULL); if(CURLE_OK == res) /* Resolved, continue with the connection */ - res = Curl_async_resolved(*conn); + res = Curl_async_resolved(*conn, &protocol_done); else + /* if we can't resolve, we kill this "connection" now */ (void)Curl_disconnect(*conn); } if(res) @@ -2126,8 +2129,8 @@ CURLcode Curl_perform(struct SessionHandle *data) } if(res == CURLE_OK) { - - res = Curl_do(&conn); + bool do_done; + res = Curl_do(&conn, &do_done); /* for non 3rd party transfer only */ if(res == CURLE_OK && !data->set.source_url) { -- cgit v1.2.3