aboutsummaryrefslogtreecommitdiff
path: root/www/http_get
diff options
context:
space:
mode:
authorTilman Keskinoz <arved@FreeBSD.org>2004-12-15 18:17:20 +0000
committerTilman Keskinoz <arved@FreeBSD.org>2004-12-15 18:17:20 +0000
commit2b6c4cf4af1fcc240196b3f58b0cc0497ab43f01 (patch)
tree8c8f2d7c73f23ff2ba61b9061df21ac612847179 /www/http_get
parent6b48323ef56adce14df32b725836f80b647facda (diff)
downloadports-2b6c4cf4af1fcc240196b3f58b0cc0497ab43f01.tar.gz
ports-2b6c4cf4af1fcc240196b3f58b0cc0497ab43f01.zip
Notes
Diffstat (limited to 'www/http_get')
-rw-r--r--www/http_get/Makefile1
-rw-r--r--www/http_get/files/patch-http_get.c69
2 files changed, 70 insertions, 0 deletions
diff --git a/www/http_get/Makefile b/www/http_get/Makefile
index 650686b83153..c609962f0c75 100644
--- a/www/http_get/Makefile
+++ b/www/http_get/Makefile
@@ -7,6 +7,7 @@
PORTNAME= http_get
PORTVERSION= 1.0
+PORTREVISION= 1
CATEGORIES= www
MASTER_SITES= http://www.acme.com/software/http_get/
DISTNAME= ${PORTNAME}_18mar2002
diff --git a/www/http_get/files/patch-http_get.c b/www/http_get/files/patch-http_get.c
new file mode 100644
index 000000000000..219b0874d4ef
--- /dev/null
+++ b/www/http_get/files/patch-http_get.c
@@ -0,0 +1,69 @@
+--- http_get.c.orig Wed Dec 15 19:10:11 2004
++++ http_get.c Wed Dec 15 19:10:30 2004
+@@ -2,7 +2,9 @@
+ **
+ ** Originally based on a simple version by Al Globus <globus@nas.nasa.gov>.
+ ** Debugged and prettified by Jef Poskanzer <jef@acme.com>. Also includes
+-** ifdefs to handle https via OpenSSL.
++** ifdefs to handle https via OpenSSL. -h argument for debugging multihomed
++** URLs added by Jim Salter.
++**
+ */
+
+ #include <unistd.h>
+@@ -35,6 +37,7 @@
+ static int verbose;
+ static int timeout;
+ static char* url;
++static char* force_host;
+
+ /* Protocol symbols. */
+ #define PROTO_HTTP 0
+@@ -72,6 +75,8 @@
+ user_agent = "http_get";
+ auth_token = (char*) 0;
+ cookie = (char*) 0;
++ force_host = (char*) "[NONE]";
++
+ while ( argn < argc && argv[argn][0] == '-' && argv[argn][1] != '\0' )
+ {
+ if ( strcmp( argv[argn], "-v" ) == 0 )
+@@ -81,6 +86,11 @@
+ ++argn;
+ timeout = atoi( argv[argn] );
+ }
++ else if ( strcmp( argv[argn], "-h" ) == 0 && argn + 1 < argc )
++ {
++ ++argn;
++ force_host = argv[argn];
++ }
+ else if ( strcmp( argv[argn], "-r" ) == 0 && argn + 1 < argc )
+ {
+ ++argn;
+@@ -127,7 +137,7 @@
+ static void
+ usage()
+ {
+- (void) fprintf( stderr, "usage: %s [-t timeout] [-r referer] [-u user-agent] [-a username:password] url\n", argv0 );
++ (void) fprintf( stderr, "usage: %s [-t timeout] [-h force host address] [-r referer] [-u user-agent] [-a username:password] url\n", argv0 );
+ exit( 1 );
+ }
+
+@@ -218,7 +228,16 @@
+ int bytes, b, header_state, status;
+
+ (void) alarm( timeout );
+- sockfd = open_client_socket( host, port );
++
++if ( force_host == "[NONE]" )
++ {
++ sockfd = open_client_socket( host, port );
++ }
++else
++ {
++ sockfd = open_client_socket( force_host, port );
++ }
++
+
+ #ifdef USE_SSL
+ if ( protocol == PROTO_HTTPS )