aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJason Woodward2003-09-29 18:31:23 +0000
committerJason Woodward2003-09-29 18:31:23 +0000
commit1e71442cffa60443213ef455b9a11fe37c28f735 (patch)
tree137918e0ef5d7d49bb2a66d534ca97f6f0a245af
parent8d1657072acb76f57a277cebf64a8d92443e0106 (diff)
downloadslapt-get-1e71442cffa60443213ef455b9a11fe37c28f735.tar.gz
fixed bug with connections not closing when downloading many pkgs
-rw-r--r--ChangeLog2
-rw-r--r--src/curl.c10
-rw-r--r--src/main.c1
3 files changed, 11 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 6df21b9..1198611 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -8,6 +8,8 @@
* more verbose messages during operation
* fixed chdir/mkdir bug in working_dir
* unlink faulty d/l files/pkgs (failed to d/l or checksum is bad)
+ * fixed bug with ftp transfers... connections left open
+ some ftp servers complain and deny access after so many connections
0.9.3 Sep 24, 2003
* default make target doesn't build slack pkg
diff --git a/src/curl.c b/src/curl.c
index 36eb5f5..694ff98 100644
--- a/src/curl.c
+++ b/src/curl.c
@@ -40,8 +40,14 @@ int download_data(FILE *fh,const char *url){
fprintf(stderr,"failed to download: %s\n",curl_err_buff);
return_code = -1;
}
- /* curl_easy_cleanup(ch); */
- curl_free(ch);
+ /*
+ * need to use curl_easy_cleanup() so that we don't
+ * have tons of open connections, getting rejected
+ * by ftp servers for being naughty.
+ */
+ curl_easy_cleanup(ch);
+ /* can't do a curl_free() after curl_easy_cleanup() */
+ /* curl_free(ch); */
return return_code;
}
diff --git a/src/main.c b/src/main.c
index 54fd462..92d010e 100644
--- a/src/main.c
+++ b/src/main.c
@@ -132,6 +132,7 @@ int main( int argc, char *argv[] ){
free(global_config->exclude_list);
free(global_config);
+ curl_global_cleanup();
return 0;
}