mirror of
https://github.com/curl/curl.git
synced 2024-12-27 06:59:43 +08:00
ftp: make domore_getsock() return the secondary socket properly
Previously, after PASV and immediately after the data connection has connected, the function would only return the control socket to wait for which then made the data connection simply timeout and not get polled correctly. This become obvious when running test 1631 and 1632 event- based.
This commit is contained in:
parent
9e95ca10b5
commit
449e54b483
@ -816,6 +816,7 @@ static int ftp_domore_getsock(struct connectdata *conn, curl_socket_t *socks)
|
||||
|
||||
if(FTP_STOP == ftpc->state) {
|
||||
int bits = GETSOCK_READSOCK(0);
|
||||
bool any = FALSE;
|
||||
|
||||
/* if stopped and still in this state, then we're also waiting for a
|
||||
connect on the secondary connection */
|
||||
@ -830,10 +831,11 @@ static int ftp_domore_getsock(struct connectdata *conn, curl_socket_t *socks)
|
||||
if(conn->tempsock[i] != CURL_SOCKET_BAD) {
|
||||
socks[s] = conn->tempsock[i];
|
||||
bits |= GETSOCK_WRITESOCK(s++);
|
||||
any = TRUE;
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
if(!any) {
|
||||
socks[1] = conn->sock[SECONDARYSOCKET];
|
||||
bits |= GETSOCK_WRITESOCK(1) | GETSOCK_READSOCK(1);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user