]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
* gnu/java/net/protocol/http/Connection.java (userAgent): New static
authormark <mark@138bc75d-0d04-0410-961f-82ee72b054a4>
Sun, 27 Jun 2004 19:36:01 +0000 (19:36 +0000)
committermark <mark@138bc75d-0d04-0410-961f-82ee72b054a4>
Sun, 27 Jun 2004 19:36:01 +0000 (19:36 +0000)
       final field.
       (sendRequest): Use new field in user-agent http agent.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@83741 138bc75d-0d04-0410-961f-82ee72b054a4

libjava/ChangeLog
libjava/gnu/java/net/protocol/http/Connection.java

index 71ab0bfc1af691e94d0870243818fd5f6487fc8e..ae95f7b034a34065d60c75c0a1a7418a83bf4f3c 100644 (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>
 
        * java/awt/EventQueue.java (postEvent): Throw NullPointerException
index ac369f4ee6e60ddd3713f51be555db6757754e7d..44239e1721a3a19c8a37a0f77091c5a1acacb2ae 100644 (file)
@@ -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", "*/*");