X-Git-Url: https://git.street.me.uk/andy/viking.git/blobdiff_plain/932f8f225c72899fd379cb59d7ade3aa55e2c3e0..46e4fa54e7da3e4d0c0ba448a3ab9b16b5077664:/src/http.c diff --git a/src/http.c b/src/http.c index d9e935bb..56bd1647 100644 --- a/src/http.c +++ b/src/http.c @@ -88,8 +88,7 @@ int http_get_line(int sock, char *buf, int len) return 1; } -/* makes directory if neccessary */ -int http_download_get_url ( const char *hostname, const char *uri, FILE *f, int already_redirected, int sendhostname ) +int http_download_get_url ( const char *hostname, const char *uri, FILE *f, int already_redirected, DownloadOptions *options ) { static char input_buffer[1024]; int sock; @@ -109,7 +108,7 @@ int http_download_get_url ( const char *hostname, const char *uri, FILE *f, int } - if ( sendhostname ) { + if ( options != NULL && options->sendhostname ) { send ( sock, "GET http://", 11, 0); send ( sock, hostname, strlen(hostname), 0 ); send ( sock, uri, strlen ( uri ), 0 ); @@ -150,7 +149,10 @@ int http_download_get_url ( const char *hostname, const char *uri, FILE *f, int char *newuri = strdup ( uri_start ); close ( sock ); - rv = http_download_get_url ( newhost, newuri, f, 1, sendhostname ); + if ( options != NULL ) + rv = http_download_get_url ( newhost, newuri, f, 1, options->sendhostname ); + else + rv = http_download_get_url ( newhost, newuri, f, 1, 0 ); free ( newhost ); free ( newuri );