aboutsummaryrefslogtreecommitdiff
path: root/libjava
diff options
context:
space:
mode:
authorMark Wielaard <mark@klomp.org>2004-06-27 19:36:01 +0000
committerMark Wielaard <mark@gcc.gnu.org>2004-06-27 19:36:01 +0000
commitce6230c4060eb099accc315bd3f6ff88813d2e7b (patch)
treeca7be67165f28214b502c7d3e396d7bf5ce2a105 /libjava
parentf84b6c964e3a1747ac27f60576743ef918f482db (diff)
downloadgcc-ce6230c4060eb099accc315bd3f6ff88813d2e7b.zip
gcc-ce6230c4060eb099accc315bd3f6ff88813d2e7b.tar.gz
gcc-ce6230c4060eb099accc315bd3f6ff88813d2e7b.tar.bz2
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
Diffstat (limited to 'libjava')
-rw-r--r--libjava/ChangeLog6
-rw-r--r--libjava/gnu/java/net/protocol/http/Connection.java13
2 files changed, 17 insertions, 2 deletions
diff --git a/libjava/ChangeLog b/libjava/ChangeLog
index 71ab0bf..ae95f7b 100644
--- a/libjava/ChangeLog
+++ b/libjava/ChangeLog
@@ -1,5 +1,11 @@
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
when argument is null.
diff --git a/libjava/gnu/java/net/protocol/http/Connection.java b/libjava/gnu/java/net/protocol/http/Connection.java
index ac369f4..44239e1 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", "*/*");