aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2001-02-13 13:34:16 +0000
committerDaniel Stenberg <daniel@haxx.se>2001-02-13 13:34:16 +0000
commita140e5311d4cc2dd72a172443643839723b30bde (patch)
treeb25defb93760d44f40d43169ac4e120be86933fc
parent7686ac3f2c4fcc7ed8720c7ab5392031d73dcc1c (diff)
moved the protocol-specific free to allow easier multiple transfers
-rw-r--r--lib/ftp.c3
-rw-r--r--lib/http.c3
-rw-r--r--lib/url.c12
3 files changed, 11 insertions, 7 deletions
diff --git a/lib/ftp.c b/lib/ftp.c
index c6f8b6191..6ec17c11a 100644
--- a/lib/ftp.c
+++ b/lib/ftp.c
@@ -545,9 +545,6 @@ CURLcode Curl_ftp_done(struct connectdata *conn)
}
}
- free(ftp);
- data->proto.ftp=NULL; /* it is gone */
-
return CURLE_OK;
}
diff --git a/lib/http.c b/lib/http.c
index 54623ec6b..93ae049b1 100644
--- a/lib/http.c
+++ b/lib/http.c
@@ -375,9 +375,6 @@ CURLcode Curl_http_done(struct connectdata *conn)
*bytecount = http->readbytecount + http->writebytecount;
}
- free(http);
- data->proto.http=NULL; /* it is gone */
-
return CURLE_OK;
}
diff --git a/lib/url.c b/lib/url.c
index 2348ac2d6..7fe2fc1e9 100644
--- a/lib/url.c
+++ b/lib/url.c
@@ -561,6 +561,10 @@ CURLcode curl_disconnect(CURLconnect *c_connect)
struct UrlData *data = conn->data;
+ if(data->proto.generic)
+ free(data->proto.generic);
+ data->proto.generic=NULL; /* it is gone */
+
#ifdef ENABLE_IPV6
if(conn->res) /* host name info */
freeaddrinfo(conn->res);
@@ -1644,7 +1648,13 @@ CURLcode curl_do(CURLconnect *in_conn)
if(!conn || (conn->handle!= STRUCT_CONNECT)) {
return CURLE_BAD_FUNCTION_ARGUMENT;
}
- if(conn->state != CONN_INIT) {
+ switch(conn->state) {
+ case CONN_INIT:
+ case CONN_DONE:
+ /* these two states are OK */
+ break;
+ default:
+ /* anything else is bad */
return CURLE_BAD_CALLING_ORDER;
}