diff options
author | Daniel Stenberg <daniel@haxx.se> | 2006-04-10 15:00:53 +0000 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2006-04-10 15:00:53 +0000 |
commit | 686d90745be4417127050ad4b36d0a5403def200 (patch) | |
tree | 786a63b7554065aa0514440adf35fd7b639ae94c /lib/ftp.c | |
parent | 5dc02d53c3edebab7597cd4ada446273e3a6daa8 (diff) | |
download | curl-686d90745be4417127050ad4b36d0a5403def200.tar.gz |
First curl_multi_socket() commit. Should primarily be considered as an internal
code rearrange to fit the future better.
Diffstat (limited to 'lib/ftp.c')
-rw-r--r-- | lib/ftp.c | 26 |
1 files changed, 12 insertions, 14 deletions
@@ -96,6 +96,7 @@ #include "select.h" #include "parsedate.h" /* for the week day and month names */ #include "sockaddr.h" /* required for Curl_sockaddr_storage */ +#include "multiif.h" #if defined(HAVE_INET_NTOA_R) && !defined(HAVE_INET_NTOA_R_DECL) #include "inet_ntoa_r.h" @@ -718,27 +719,24 @@ static CURLcode ftp_state_pwd(struct connectdata *conn) } /* For the FTP "protocol connect" and "doing" phases only */ -CURLcode Curl_ftp_fdset(struct connectdata *conn, - fd_set *read_fd_set, - fd_set *write_fd_set, - int *max_fdp) +int Curl_ftp_getsock(struct connectdata *conn, + curl_socket_t *socks, + int numsocks) { struct FTP *ftp = conn->proto.ftp; - curl_socket_t sockfd = conn->sock[FIRSTSOCKET]; + + if(!numsocks) + return GETSOCK_BLANK; + + socks[0] = conn->sock[FIRSTSOCKET]; if(ftp->sendleft) { /* write mode */ - FD_SET(sockfd, write_fd_set); + return GETSOCK_WRITESOCK(0); } - else { - /* read mode */ - FD_SET(sockfd, read_fd_set); - } - - if((int)sockfd > *max_fdp) - *max_fdp = (int)sockfd; - return CURLE_OK; + /* read mode */ + return GETSOCK_READSOCK(0); } /* This is called after the FTP_QUOTE state is passed. |