Index: axel.h
===================================================================
--- axel.h	(Revision 31)
+++ axel.h	(Arbeitskopie)
@@ -68,7 +68,7 @@
 #define MAX_ADD_HEADERS	10
 #define MAX_REDIR		5
 #define AXEL_VERSION_STRING	"1.1"
-#define USER_AGENT		"Axel " AXEL_VERSION_STRING " (" ARCH ")"
+#define DEFAULT_USER_AGENT	"Axel " AXEL_VERSION_STRING " (" ARCH ")"
 
 typedef struct
 {
Index: axel.1
===================================================================
--- axel.1	(Revision 31)
+++ axel.1	(Arbeitskopie)
@@ -79,6 +79,18 @@
 estimate for the remaining download time.
 
 .TP
+\fB\-\-header=x\fP, \fB\-H\ x\fP
+Add an additional HTTP header. This option should be in the form "Header:
+Value". See RFC 2616 section 4.2 and 14 for details on the format and
+standardized headers.
+
+.TP
+\fB\-\-user-agent=x\fP, \fB\-U\ x\fP
+Set the HTTP user agent to use. Some websites serve different content based upon
+this parameter. The default value will include "Axel", its version and the
+platform.
+
+.TP
 \fB\-\-help\fP, \fB\-h\fP
 A brief summary of all the options.
 
@@ -98,7 +110,8 @@
 
 .SH EXAMPLES
 .nf
-axel ftp://ftp.{be,nl,uk,de}.kernel.org/pub/linux/kernel/v2.4/linux-2.4.17.tar.bz2
+axel
+ftp://ftp.{be,nl,uk,de}.kernel.org/pub/linux/kernel/v2.4/linux-2.4.17.tar.bz2
 .fi
 
 This will use the Belgian, Dutch, English and German kernel.org mirrors to
Index: http.c
===================================================================
--- http.c	(Revision 31)
+++ http.c	(Arbeitskopie)
@@ -103,7 +103,6 @@
 		http_addheader( conn, "GET %s HTTP/1.0", lurl );
 		http_addheader( conn, "Host: %s", conn->host );
 	}
-	http_addheader( conn, "User-Agent: %s", USER_AGENT );
 	if( *conn->auth )
 		http_addheader( conn, "Authorization: Basic %s", conn->auth );
 	if( conn->firstbyte )
Index: text.c
===================================================================
--- text.c	(Revision 31)
+++ text.c	(Arbeitskopie)
@@ -53,6 +53,7 @@
 	{ "version",		0,	NULL,	'V' },
 	{ "alternate",		0,	NULL,	'a' },
 	{ "header",		1,	NULL,	'H' },
+	{ "user-agent",		1,	NULL,	'U' },
 	{ NULL,			0,	NULL,	0 }
 };
 #endif
@@ -89,12 +90,15 @@
 	{
 		int option;
 		
-		option = getopt_long( argc, argv, "s:n:o:S::NqvhHVaH:", axel_options, NULL );
+		option = getopt_long( argc, argv, "s:n:o:S::NqvhVaH:U:", axel_options, NULL );
 		if( option == -1 )
 			break;
 		
 		switch( option )
 		{
+		case 'U':
+			strncpy( conf->user_agent, optarg, MAX_STRING);
+			break;
 		case 'H':
 			strncpy( conf->add_header[cur_head++], optarg, MAX_STRING );
 			break;
@@ -523,6 +527,7 @@
 		"-o f\tSpecify local output file\n"
 		"-S [x]\tSearch for mirrors and download from x servers\n"
 		"-H x\tAdd header string\n"
+		"-U x\tSet user agent\n"
 		"-N\tJust don't use any proxy server\n"
 		"-q\tLeave stdout alone\n"
 		"-v\tMore status information\n"
@@ -539,6 +544,7 @@
 		"--output=f\t\t-o f\tSpecify local output file\n"
 		"--search[=x]\t\t-S [x]\tSearch for mirrors and download from x servers\n"
 		"--header=x\t\t-H x\tAdd header string\n"
+		"--user-agent=x\t\t-U x\tSet user agent\n"
 		"--no-proxy\t\t-N\tJust don't use any proxy server\n"
 		"--quiet\t\t\t-q\tLeave stdout alone\n"
 		"--verbose\t\t-v\tMore status information\n"
Index: conf.c
===================================================================
--- conf.c	(Revision 31)
+++ conf.c	(Arbeitskopie)
@@ -110,6 +110,7 @@
 		get_config_number( add_header_count );
 		for(i=0;i<conf->add_header_count;i++)
 			get_config_string( add_header[i] );
+		get_config_string( user_agent );
 	}
 	
 	fclose( fp );
@@ -140,7 +141,8 @@
 	conf->search_threads		= 3;
 	conf->search_amount		= 15;
 	conf->search_top		= 3;
-	conf->add_header_count	= 0;
+	conf->add_header_count		= 0;
+	strncpy( conf->user_agent, DEFAULT_USER_AGENT, MAX_STRING );
 	
 	conf->interfaces = malloc( sizeof( if_t ) );
 	memset( conf->interfaces, 0, sizeof( if_t ) );
Index: conf.h
===================================================================
--- conf.h	(Revision 31)
+++ conf.h	(Arbeitskopie)
@@ -47,6 +47,8 @@
 
 	int add_header_count;
 	char add_header[MAX_ADD_HEADERS][MAX_STRING];
+	
+	char user_agent[MAX_STRING];
 } conf_t;
 
 int conf_loadfile( conf_t *conf, char *file );
Index: conn.c
===================================================================
--- conn.c	(Revision 31)
+++ conn.c	(Arbeitskopie)
@@ -257,6 +257,7 @@
 		conn->http->firstbyte = conn->currentbyte;
 		conn->http->lastbyte = conn->lastbyte;
 		http_get( conn->http, s );
+		http_addheader( conn->http, "User-Agent: %s", conn->conf->user_agent );
 		for( i = 0; i < conn->conf->add_header_count; i++)
 			http_addheader( conn->http, "%s", conn->conf->add_header[i] );
 	}
