err = opkg_cmd_exec (cmd, &opkg_conf, argc - optind, (const char **) (argv + optind), NULL);
+#ifdef HAVE_CURL
+ opkg_curl_cleanup();
+#endif
opkg_conf_deinit (&opkg_conf);
return err;
{
opkg_assert (opkg != NULL);
+#ifdef HAVE_CURL
+ opkg_curl_cleanup();
+#endif
opkg_conf_deinit (opkg->conf);
args_deinit (opkg->args);
free (opkg->options);
* each time
*/
static CURL *curl = NULL;
-static void opkg_curl_cleanup(void);
static CURL *opkg_curl_init(opkg_conf_t *conf, curl_progress_func cb, void *data);
#endif
#endif
#ifdef HAVE_CURL
-static void opkg_curl_cleanup(void){
+void opkg_curl_cleanup(void){
if(curl != NULL){
curl_easy_cleanup (curl);
curl = NULL;
curl_easy_setopt(curl, CURLOPT_PROXYUSERPWD, userpwd);
free (userpwd);
}
-
- /* add curl cleanup callback */
- if(!atexit(opkg_curl_cleanup)){
- opkg_message(conf,OPKG_DEBUG, "Failed to register atexit curl cleanup function\n");
- }
-
}
curl_easy_setopt (curl, CURLOPT_NOPROGRESS, (cb == NULL));
int opkg_prepare_url_for_install(opkg_conf_t *conf, const char *url, char **namep);
int opkg_verify_file (opkg_conf_t *conf, char *text_file, char *sig_file);
+#ifdef HAVE_CURL
+void opkg_curl_cleanup(void);
+#endif
#endif