Skip to content

Commit

Permalink
ftp: clear the do_more bit when the server has connected
Browse files Browse the repository at this point in the history
The multi state machine would otherwise go into the DO_MORE state after
DO, even for the case when the FTP state machine had already performed
those duties, which caused libcurl to get stuck in that state and fail
miserably. This occured for for active ftp uploads.

Reported-by: Patricia Muscalu
  • Loading branch information
bagder committed Aug 21, 2015
1 parent 1d89fd9 commit 38ef1b3
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/ftp.c
Expand Up @@ -340,6 +340,9 @@ static CURLcode AcceptServerConnect(struct connectdata *conn)
return CURLE_FTP_PORT_FAILED;
}
infof(data, "Connection accepted from server\n");
/* when this happens within the DO state it is important that we mark us as
not needing DO_MORE anymore */
conn->bits.do_more = FALSE;

conn->sock[SECONDARYSOCKET] = s;
(void)curlx_nonblock(s, TRUE); /* enable non-blocking */
Expand Down

0 comments on commit 38ef1b3

Please sign in to comment.