From 3cc4e05c90c0df798726175c5a81776153631806 Mon Sep 17 00:00:00 2001 From: Guilhem Bonnefille Date: Mon, 16 Apr 2007 20:11:23 +0000 Subject: [PATCH] Unused function --- src/http.c | 46 ---------------------------------------------- src/http.h | 1 - 2 files changed, 47 deletions(-) diff --git a/src/http.c b/src/http.c index 311c94f..349d6ec 100644 --- a/src/http.c +++ b/src/http.c @@ -260,49 +260,3 @@ int a_http_download_get_url_nohostname ( const char *hostname, const char *uri, { return http_download_get_url ( hostname, uri, fn, 0, 0 ); } - - -int usgs_hack ( const char *scale_factor, const char *uri, const char *fn ) -{ - static char input_buffer[1024]; - int sock; - /* int hnlen = strlen ( scale_factor ); */ - -#ifdef WINDOWS - WSADATA usadata; - WSAStartup ( MAKEWORD(2,2), &usadata ); -#endif - - sock = http_connect ( scale_factor, 80 ); - if (sock < 0) - return -1; - - send ( sock, "GET /", 5, 0); - send ( sock, uri, strlen ( uri ), 0 ); - send ( sock, " HTTP/1.0\r\n\r\n", 13, 0 ); - - /* next, skip through all headers EXCEPT content length., - that is, if it begins with "Content-Length: " (strncasecmp), - atoi that line from +16 (+17 ?), read that many bytes directly - into file (IF we can open it, else return error) and we're done. - */ - - /* "HTTP/1.x 200 OK" check */ - for (;;) { - if ( http_get_line ( sock, input_buffer, 1024 ) == 0 ) - break; - - if ( strncmp(input_buffer, "\t\t\t 28 ) - { - char *uri = input_buffer + 13; - close(sock); - uri[strlen(uri)-4] = '\0'; - return a_http_download_get_url_nohostname ( scale_factor, uri, fn ); - } - } - close ( sock ); -#ifdef WINDOWS - WSACleanup(); /* they sure make winsock programming easy. */ -#endif - return -10; -} diff --git a/src/http.h b/src/http.h index 212f80f..6544e74 100644 --- a/src/http.h +++ b/src/http.h @@ -24,6 +24,5 @@ /* TODO: convert to Glib */ int a_http_download_get_url ( const char *hostname, const char *uri, const char *fn ); int a_http_download_get_url_nohostname ( const char *hostname, const char *uri, const char *fn ); -int usgs_hack ( const char *scale_factor, const char *uri, const char *fn ); #endif -- 2.11.4.GIT