FTP: call opensocket callback properly

When the new socket is created for an active connection, it is now done
using the open socket callback.

Test case 596 was modified to run fine, although it hides the fact that
the close callback is still called too many times, as it also gets
called for closing sockets that were created with accept().
This commit is contained in:
Daniel Stenberg
2011-12-05 11:42:10 +01:00
parent 9109cdec11
commit 088ba97a24
4 changed files with 23 additions and 20 deletions

View File

@@ -901,14 +901,8 @@ static CURLcode ftp_state_use_port(struct connectdata *conn,
portsock = CURL_SOCKET_BAD;
error = 0;
for(ai = res; ai; ai = ai->ai_next) {
/*
* Workaround for AIX5 getaddrinfo() problem (it doesn't set ai_socktype):
*/
if(ai->ai_socktype == 0)
ai->ai_socktype = conn->socktype;
portsock = socket(ai->ai_family, ai->ai_socktype, ai->ai_protocol);
if(portsock == CURL_SOCKET_BAD) {
result = Curl_socket(conn, ai, NULL, &portsock);
if(result) {
error = SOCKERRNO;
continue;
}