changeset 884:cb78ee27b0e0

remove Server.getVersion()
author Franklin Schmidt <fschmidt@gmail.com>
date Tue, 04 Oct 2016 16:30:02 -0600
parents 8c494fcd3d34
children 150092cebf3e
files src/org/eclipse/jetty/http/HttpGenerator.java src/org/eclipse/jetty/server/Server.java src/org/eclipse/jetty/server/handler/ContextHandler.java
diffstat 3 files changed, 6 insertions(+), 19 deletions(-) [+]
line wrap: on
line diff
--- a/src/org/eclipse/jetty/http/HttpGenerator.java	Tue Oct 04 16:19:54 2016 -0600
+++ b/src/org/eclipse/jetty/http/HttpGenerator.java	Tue Oct 04 16:30:02 2016 -0600
@@ -29,6 +29,7 @@
 import org.eclipse.jetty.io.EndPoint;
 import org.eclipse.jetty.io.EofException;
 import org.eclipse.jetty.util.StringUtil;
+import org.eclipse.jetty.server.Server;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -99,16 +100,11 @@
 	private static final byte[] CONNECTION_ = StringUtil.getBytes("Connection: ");
 	private static final byte[] CRLF = StringUtil.getBytes("\015\012");
 	private static final byte[] TRANSFER_ENCODING_CHUNKED = StringUtil.getBytes("Transfer-Encoding: chunked\015\012");
-	private static byte[] SERVER = StringUtil.getBytes("Server: Jetty(7.0.x)\015\012");
+	private static byte[] SERVER = StringUtil.getBytes("Server: Jetty("+Server.version+")\015\012");
 
 	// other statics
 	private static final int CHUNK_SPACE = 12;
 
-	public static void setServerVersion(String version)
-	{
-		SERVER=StringUtil.getBytes("Server: Jetty("+version+")\015\012");
-	}
-
 	// data
 	protected boolean _bypass = false; // True if _content buffer can be written directly to endp and bypass the content buffer
 	private boolean _needCRLF = false;
--- a/src/org/eclipse/jetty/server/Server.java	Tue Oct 04 16:19:54 2016 -0600
+++ b/src/org/eclipse/jetty/server/Server.java	Tue Oct 04 16:30:02 2016 -0600
@@ -30,7 +30,6 @@
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 
-import org.eclipse.jetty.http.HttpGenerator;
 import org.eclipse.jetty.http.HttpURI;
 import org.eclipse.jetty.server.handler.HandlerWrapper;
 import org.eclipse.jetty.server.nio.SelectChannelConnector;
@@ -58,7 +57,7 @@
 {
 	private static final Logger LOG = LoggerFactory.getLogger(Server.class);
 
-	private static final String __version = "8";
+	public static final String version = "8";
 
 	private final AttributesMap _attributes = new AttributesMap();
 	public final ThreadPoolExecutor threadPool;
@@ -82,18 +81,10 @@
 
 
 	/* ------------------------------------------------------------ */
-	public static String getVersion()
-	{
-		return __version;
-	}
-
-
-	/* ------------------------------------------------------------ */
 	@Override
 	protected void doStart() throws Exception
 	{
-		LOG.info("jetty-"+__version);
-		HttpGenerator.setServerVersion(__version);
+		LOG.info("jetty-"+version);
 		
 		MultiException mex=new MultiException();
 
@@ -308,6 +299,6 @@
 	/* ------------------------------------------------------------ */
 	public static void main(String...args) throws Exception
 	{
-		System.err.println(getVersion());
+		System.err.println(version);
 	}
 }
--- a/src/org/eclipse/jetty/server/handler/ContextHandler.java	Tue Oct 04 16:19:54 2016 -0600
+++ b/src/org/eclipse/jetty/server/handler/ContextHandler.java	Tue Oct 04 16:30:02 2016 -0600
@@ -1924,7 +1924,7 @@
 		@Override
 		public String getServerInfo()
 		{
-			return "jetty/" + Server.getVersion();
+			return "jetty/" + Server.version;
 		}
 
 		/* ------------------------------------------------------------ */