#include "config.h"
#endif
+#include <glib/gi18n.h>
#include <gtk/gtk.h>
#include <curl/curl.h>
curl_easy_setopt(curl, CURLOPT_COOKIEJAR, cookie_file);
res = curl_easy_perform(curl);
if (res != CURLE_OK) {
- g_warning("%s() Curl perform failed: %s\n", __PRETTY_FUNCTION__,
+ g_warning(_("%s() Curl perform failed: %s"), __PRETTY_FUNCTION__,
curl_easy_strerror(res));
unlink(cookie_file);
}
curl_easy_setopt ( curl, CURLOPT_MAXREDIRS, options->follow_location);
}
}
- curl_easy_setopt ( curl, CURLOPT_USERAGENT, "viking/" VERSION " libcurl/7.15.4" );
+ curl_easy_setopt ( curl, CURLOPT_USERAGENT, PACKAGE "/" VERSION " libcurl/7.15.4" );
if ((cookie_file = get_cookie_file(FALSE)) != NULL)
curl_easy_setopt(curl, CURLOPT_COOKIEFILE, cookie_file);
res = curl_easy_perform ( curl );
return(res);
}
-int curl_download_get_url ( const char *hostname, const char *uri, FILE *f, DownloadOptions *options )
+int curl_download_get_url ( const char *hostname, const char *uri, FILE *f, DownloadOptions *options, gboolean ftp )
{
int ret;
gchar *full = NULL;
/* Compose the full url */
- full = g_strdup_printf ( "http://%s%s", hostname, uri );
+ full = g_strdup_printf ( "%s://%s%s", (ftp?"ftp":"http"), hostname, uri );
ret = curl_download_uri ( full, f, options );
g_free ( full );
full = NULL;