diff -a -x Root -x Repository -x Tag -x Entries -x Entries.Log -x .svn -x '*.rej' -x '*.orig' -N -r -u ./src/daemon/driver/driverControlers.ml ./src/daemon/driver/driverControlers.ml
--- ./src/daemon/driver/driverControlers.ml	2006-07-14 15:24:24.000000000 +0200
+++ ./src/daemon/driver/driverControlers.ml	2006-07-18 14:06:08.000000000 +0200
@@ -947,10 +947,18 @@
   CommonInteractive.display_vd := false;
   CommonInteractive.display_bw_stats := false;
   clear_page buf;
+  if !Http_server.verbose && r.get_url.Url.short_file <> "" then
+    lprintf_nl "received URL %s %s"
+      r.get_url.Url.short_file
+      (let b = Buffer.create 100 in
+	 List.iter (fun (arg, value) -> Printf.bprintf b " %s %s" arg value) r.get_url.Url.args;
+	 if Buffer.contents b <> "" then Printf.sprintf "(%s)" (Buffer.contents b) else "");
 
   let user = if r.options.login = "" then admin_user else r.options.login in
   if not (valid_password user r.options.passwd) then begin
       clear_page buf;
+      http_file_type := HTM;
+      Buffer.add_string buf (snd(Http_server.error_page "401" "" "" (Ip.to_string (TcpBufferedSocket.my_ip r.sock)) (string_of_int !!http_port)));
       need_auth r !!http_realm
     end
   else
diff -a -x Root -x Repository -x Tag -x Entries -x Entries.Log -x .svn -x '*.rej' -x '*.orig' -N -r -u ./src/utils/net/http_server.ml ./src/utils/net/http_server.ml
--- ./src/utils/net/http_server.ml	2006-07-17 19:11:55.000000000 +0200
+++ ./src/utils/net/http_server.ml	2006-07-18 14:06:26.000000000 +0200
@@ -223,6 +211,27 @@
   in
   iter 0 []
 
+let error_page code from_ip from_port my_ip my_port =
+  let error_text, error_text_long =
+    match code with
+    | "401" -> "Unauthorized", "<p>Please login using a valid username and password</p>"
+    | "403" -> "Forbidden", Printf.sprintf
+"<p>Connection from %s rejected (see downloads.ini, <a href=\"http://mldonkey.sourceforge.net/Allowed_ips\">allowed_ips</a>)</p>\n"
+        from_ip
+    | _ -> Printf.sprintf "Unknown %s" code, ""
+  in
+  let reject_message = Printf.sprintf
+"<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">\n<html>
+<head><title>%s %s</title></head>\n<h1>%s %s</h1>\n%s
+<hr><address>MLDonkey/%s at %s Port %s</address></html>"
+    code error_text code error_text error_text_long
+    Autoconf.current_version my_ip my_port
+  in
+  Printf.sprintf
+"HTTP/1.1 %s %s\nMLDonkey/%s\nConnection: close
+Content-Type: text/html; charset=iso-8859-1\nContent-length: %d\r\n"
+    code error_text Autoconf.current_version (String.length reject_message), reject_message
+
 let parse_head sock s =
   let h = split_head s in
 (*  List.iter (fun s -> lprintf_http_nl () "LINE: [%s]" (escaped s)) h; *)
@@ -822,18 +408,12 @@
           (Ip.to_string from_ip);
         let token = create_token unlimited_connection_manager in
         let sock = TcpBufferedSocket.create_simple token "http connection" s in
-        let reject_message = Printf.sprintf
-"<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">\n<html>\n
-<head><title>403 Forbidden</title></head>\n<h1>Forbidden</h1>\n
-<p>Connection from %s rejected (see downloads.ini, <a href=\"http://mldonkey.sourceforge.net/Allowed_ips\">allowed_ips</a>)</p>\n
-<hr><address>MLDonkey/%s at %s Port %d</address></html>\n"
-            (Ip.to_string from_ip) Autoconf.current_version
-	    (Ip.to_string (TcpBufferedSocket.my_ip sock)) config.port in
-        TcpBufferedSocket.write_string sock (Printf.sprintf
-"HTTP/1.1 403 Forbidden\nMLDonkey/%s\nConnection: close
-Content-Type: text/html; charset=iso-8859-1\nContent-length: %d\r\n"
-	    Autoconf.current_version (String.length reject_message));
-        TcpBufferedSocket.write_string sock reject_message;
+	let s1,s2 = error_page "403"
+	    (Ip.to_string from_ip)
+	    (string_of_int from_port)
+	    (Ip.to_string (TcpBufferedSocket.my_ip sock))
+	    (string_of_int config.port) in
+	TcpBufferedSocket.write_string sock (Printf.sprintf "%s\n%s" s1 s2);
         shutdown sock Closed_connect_failed;
         Unix.close s
       end
diff -a -x Root -x Repository -x Tag -x Entries -x Entries.Log -x .svn -x '*.rej' -x '*.orig' -N -r -u ./src/utils/net/http_server.mli ./src/utils/net/http_server.mli
--- ./src/utils/net/http_server.mli	2006-02-17 23:24:41.000000000 +0100
+++ ./src/utils/net/http_server.mli	2006-07-18 14:02:34.000000000 +0200
@@ -76,4 +76,5 @@
 val verbose : bool ref 
   
 val request_range : request -> int64 * (int64 option)
-val parse_range : string -> int64 * int64 option * int64 option
\ Kein Zeilenumbruch am Dateiende.
+val parse_range : string -> int64 * int64 option * int64 option
+val error_page : string -> string -> string -> string -> string -> string * string
