fixed Date handling for 1xx responses

git-svn-id: svn+ssh://dev.eclipse.org/svnroot/rt/org.eclipse.jetty/jetty/trunk@1094 7e9141cc-0065-0410-87d8-b60c137991c4
This commit is contained in:
Greg Wilkins 2009-11-25 01:49:42 +00:00
parent ef96101e68
commit 61e8a2bf2a
7 changed files with 25 additions and 8 deletions

View File

@ -1,4 +1,4 @@
jetty-7.0.1.v20091123 23 November 2009
jetty-7.0.1.v20091125 25 November 2009
+ 274251 DefaultServlet supports exact match mode.
+ 288401 HttpExchange.cancel() Method Unimplemented
+ 289027 deobfuscate HttpClient SSL passwords

View File

@ -69,6 +69,8 @@ public abstract class AbstractGenerator implements Generator
protected Buffer _buffer; // Buffer for copy of passed _content
protected Buffer _content; // Buffer passed to addContent
protected Buffer _date;
private boolean _sendServerVersion;
@ -105,6 +107,7 @@ public abstract class AbstractGenerator implements Generator
_close = false;
_contentWritten = 0;
_contentLength = HttpTokens.UNKNOWN_CONTENT;
_date = null;
// always return the buffer
if (_buffer!=null)
@ -278,6 +281,15 @@ public abstract class AbstractGenerator implements Generator
return _version;
}
/* ------------------------------------------------------------ */
/**
* @see org.eclipse.jetty.http.Generator#setDate(org.eclipse.jetty.io.Buffer)
*/
public void setDate(Buffer timeStampBuffer)
{
_date=timeStampBuffer;
}
/* ------------------------------------------------------------ */
/**
*/

View File

@ -91,5 +91,7 @@ public interface Generator
void setPersistent(boolean persistent);
void setDate(Buffer timeStampBuffer);
}

View File

@ -469,6 +469,14 @@ public class HttpGenerator extends AbstractGenerator
}
// Add headers
if (_status>=200 && _date!=null)
{
_header.put(HttpHeaders.DATE_BUFFER);
_header.put((byte)':');
_header.put((byte)' ');
_header.put(_date);
_header.put(CRLF);
}
// key field values
HttpFields.Field content_length = null;

View File

@ -963,7 +963,7 @@ public class HttpConnection implements Connection
_generator.setHead(_head);
if (_server.getSendDateHeader())
_responseFields.put(HttpHeaders.DATE_BUFFER, _request.getTimeStampBuffer(),_request.getTimeStamp());
_generator.setDate(_request.getTimeStampBuffer());
if (!_host)
{

View File

@ -1018,12 +1018,6 @@ public class Response implements HttpServletResponse
}
}
}
if (_connection.getConnector().getServer().getSendDateHeader())
{
Request request=_connection.getRequest();
response_fields.put(HttpHeaders.DATE_BUFFER, request.getTimeStampBuffer(),request.getTimeStamp());
}
}
/* ------------------------------------------------------------ */

View File

@ -39,6 +39,7 @@ public class TestServer
System.setProperty("jetty.home",jetty_home);
Server server = new Server();
server.setSendDateHeader(true);
// Setup JMX
MBeanContainer mbContainer=new MBeanContainer(ManagementFactory.getPlatformMBeanServer());