Connection.java (userAgent): New static final field.

* gnu/java/net/protocol/http/Connection.java (userAgent): New static
       final field.
       (sendRequest): Use new field in user-agent http agent.

From-SVN: r83741
This commit is contained in:
Mark Wielaard 2004-06-27 19:36:01 +00:00 committed by Mark Wielaard
parent f84b6c964e
commit ce6230c406
2 changed files with 17 additions and 2 deletions

View File

@ -1,3 +1,9 @@
2004-06-27 Mark Wielaard <mark@klomp.org>
* gnu/java/net/protocol/http/Connection.java (userAgent): New static
final field.
(sendRequest): Use new field in user-agent http agent.
2004-06-27 Mark Wielaard <mark@klomp.org> 2004-06-27 Mark Wielaard <mark@klomp.org>
* java/awt/EventQueue.java (postEvent): Throw NullPointerException * java/awt/EventQueue.java (postEvent): Throw NullPointerException

View File

@ -80,6 +80,8 @@ public final class Connection extends HttpURLConnection
private static boolean proxyInUse = false; private static boolean proxyInUse = false;
private static String proxyHost = null; private static String proxyHost = null;
private static final String userAgent;
static static
{ {
// Recognize some networking properties listed at // Recognize some networking properties listed at
@ -101,6 +103,14 @@ public final class Connection extends HttpURLConnection
} }
} }
} }
userAgent = "gnu-classpath/"
+ System.getProperty("gnu.classpath.version")
+ " ("
+ System.getProperty("gnu.classpath.vm.shortname")
+ "/"
+ System.getProperty("java.vm.version")
+ ")";
} }
/** /**
@ -215,8 +225,7 @@ public final class Connection extends HttpURLConnection
setRequestProperty ("Connection", "Close"); setRequestProperty ("Connection", "Close");
if (getRequestProperty ("user-agent") == null) if (getRequestProperty ("user-agent") == null)
setRequestProperty ("user-agent", "gnu-libgcj/" setRequestProperty ("user-agent", userAgent);
+ System.getProperty ("java.vm.version"));
if (getRequestProperty ("accept") == null) if (getRequestProperty ("accept") == null)
setRequestProperty ("accept", "*/*"); setRequestProperty ("accept", "*/*");