]> git.street.me.uk Git - andy/viking.git/blobdiff - src/download.c
Add referer to DownloadOptions
[andy/viking.git] / src / download.c
index e51f9e93aaaae1fa40b3b504e5a7aa41f9c857cb..fcaef0b5db1da8bee67c2cec9bfba69d90a1f274 100644 (file)
@@ -100,7 +100,7 @@ static int check_map_file(FILE* f)
   return(res);
 }
 
-static int download( const char *hostname, const char *uri, const char *fn, int sendhostname)
+static int download( const char *hostname, const char *uri, const char *fn, DownloadOptions *options)
 {
   FILE *f;
   int ret;
@@ -142,9 +142,9 @@ static int download( const char *hostname, const char *uri, const char *fn, int
 
   /* Call the backend function */
 #ifdef HAVE_LIBCURL
-  ret = curl_download_get_url ( hostname, uri, f );
+  ret = curl_download_get_url ( hostname, uri, f, options );
 #else
-  ret = http_download_get_url ( hostname, uri, f, 0, sendhostname );
+  ret = http_download_get_url ( hostname, uri, f, 0, options );
 #endif
 
   if (ret == -1 || ret == 1 || ret == -2 || check_map_file(f))
@@ -166,12 +166,7 @@ static int download( const char *hostname, const char *uri, const char *fn, int
 /* success = 0, -1 = couldn't connect, -2 HTTP error, -3 file exists, -4 couldn't write to file... */
 /* uri: like "/uri.html?whatever" */
 /* only reason for the "wrapper" is so we can do redirects. */
-int a_http_download_get_url ( const char *hostname, const char *uri, const char *fn )
+int a_http_download_get_url ( const char *hostname, const char *uri, const char *fn, DownloadOptions *opt )
 {
-  return download ( hostname, uri, fn, 1 );
-}
-
-int a_http_download_get_url_nohostname ( const char *hostname, const char *uri, const char *fn )
-{
-  return download ( hostname, uri, fn, 0 );
+  return download ( hostname, uri, fn, opt );
 }