From: Mark Wielaard Date: Sun, 27 Jun 2004 19:36:01 +0000 (+0000) Subject: Connection.java (userAgent): New static final field. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=ce6230c4060eb099accc315bd3f6ff88813d2e7b;p=gcc.git 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 --- diff --git a/libjava/ChangeLog b/libjava/ChangeLog index 71ab0bfc1af..ae95f7b034a 100644 --- a/libjava/ChangeLog +++ b/libjava/ChangeLog @@ -1,3 +1,9 @@ +2004-06-27 Mark Wielaard + + * 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 * java/awt/EventQueue.java (postEvent): Throw NullPointerException diff --git a/libjava/gnu/java/net/protocol/http/Connection.java b/libjava/gnu/java/net/protocol/http/Connection.java index ac369f4ee6e..44239e1721a 100644 --- a/libjava/gnu/java/net/protocol/http/Connection.java +++ b/libjava/gnu/java/net/protocol/http/Connection.java @@ -80,6 +80,8 @@ public final class Connection extends HttpURLConnection private static boolean proxyInUse = false; private static String proxyHost = null; + private static final String userAgent; + static { // 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"); if (getRequestProperty ("user-agent") == null) - setRequestProperty ("user-agent", "gnu-libgcj/" - + System.getProperty ("java.vm.version")); + setRequestProperty ("user-agent", userAgent); if (getRequestProperty ("accept") == null) setRequestProperty ("accept", "*/*");