Merge remote-tracking branch 'origin/jetty-8'

Conflicts:
	jetty-io/src/main/java/org/eclipse/jetty/io/nio/SelectChannelEndPoint.java
	jetty-servlet/src/main/java/org/eclipse/jetty/servlet/DefaultServlet.java
This commit is contained in:
Greg Wilkins 2013-04-05 08:31:31 +11:00
commit 1191142c97
5 changed files with 25 additions and 39 deletions

View File

@ -142,14 +142,11 @@ public abstract class AbstractEndPoint extends IdleTimeout implements EndPoint
@Override
protected void onIdleExpired(TimeoutException timeout)
{
if (isOutputShutdown() || _fillInterest.isInterested() || _writeFlusher.isInProgress())
{
boolean output_shutdown=isOutputShutdown();
_fillInterest.onFail(timeout);
_writeFlusher.onFail(timeout);
if (output_shutdown)
close();
}
boolean output_shutdown=isOutputShutdown();
_fillInterest.onFail(timeout);
_writeFlusher.onFail(timeout);
if (output_shutdown)
close();
}
@Override

View File

@ -157,7 +157,8 @@ public class ShutdownMonitor
{
return;
}
System.err.println("Starting ShutdownMonitorThread");
if (DEBUG)
System.err.println("Starting ShutdownMonitorThread");
super.start();
}

View File

@ -434,7 +434,7 @@ public class DefaultServlet extends HttpServlet implements ResourceFactory
if (resource!=null && resource.exists() && !resource.isDirectory())
{
// Tell caches that response may vary by accept-encoding
response.setHeader(HttpHeader.VARY.asString(),HttpHeader.ACCEPT_ENCODING.asString());
response.addHeader(HttpHeader.VARY.asString(),HttpHeader.ACCEPT_ENCODING.asString());
// Does the client accept gzip?
String accept=request.getHeader(HttpHeader.ACCEPT_ENCODING.asString());

View File

@ -84,15 +84,6 @@ public class IncludableGzipFilter extends GzipFilter
{
return null;
}
@Override
protected void setHeader(String name, String value)
{
super.setHeader(name, value);
HttpServletResponse response = (HttpServletResponse)getResponse();
if (!response.containsHeader(name))
response.setHeader("org.eclipse.jetty.server.include." + name, value);
}
};
}
};
@ -111,15 +102,6 @@ public class IncludableGzipFilter extends GzipFilter
{
return new GZIPOutputStream(_response.getOutputStream(),_bufferSize);
}
@Override
protected void setHeader(String name, String value)
{
super.setHeader(name, value);
HttpServletResponse response = (HttpServletResponse)getResponse();
if (!response.containsHeader(name))
response.setHeader("org.eclipse.jetty.server.include." + name, value);
}
};
}
};
@ -138,15 +120,6 @@ public class IncludableGzipFilter extends GzipFilter
{
return new DeflaterOutputStream(_response.getOutputStream(),new Deflater(_deflateCompressionLevel, _deflateNoWrap));
}
@Override
protected void setHeader(String name, String value)
{
super.setHeader(name, value);
HttpServletResponse response = (HttpServletResponse)getResponse();
if (!response.containsHeader(name))
response.setHeader("org.eclipse.jetty.server.include." + name, value);
}
};
}
};
@ -176,6 +149,16 @@ public class IncludableGzipFilter extends GzipFilter
if (!response.containsHeader(name))
response.setHeader("org.eclipse.jetty.server.include."+name,value);
}
@Override
public void addHeader(String name, String value)
{
super.addHeader(name, value);
HttpServletResponse response = (HttpServletResponse)getResponse();
if (!response.containsHeader(name))
setHeader(name,value);
}
@Override
protected PrintWriter newWriter(OutputStream out, String encoding) throws UnsupportedEncodingException
{

View File

@ -234,7 +234,7 @@ public abstract class AbstractCompressedStream extends ServletOutputStream
setHeader("Content-Encoding", _encoding);
if (_response.containsHeader("Content-Encoding"))
{
setHeader("Vary",_vary);
addHeader("Vary",_vary);
_out=_compressedOutputStream=createStream();
if (_out!=null)
{
@ -269,7 +269,7 @@ public abstract class AbstractCompressedStream extends ServletOutputStream
if (_out == null || _bOut != null)
{
if (sendVary)
setHeader("Vary",_vary);
addHeader("Vary",_vary);
if (_wrapper.getETag()!=null)
setHeader("ETag",_wrapper.getETag());
@ -341,6 +341,11 @@ public abstract class AbstractCompressedStream extends ServletOutputStream
return encoding == null?new PrintWriter(out):new PrintWriter(new OutputStreamWriter(out,encoding));
}
protected void addHeader(String name,String value)
{
_response.addHeader(name, value);
}
protected void setHeader(String name,String value)
{
_response.setHeader(name, value);