remm 02/03/15 11:12:49 Modified: catalina/src/share/org/apache/catalina Response.java catalina/src/share/org/apache/catalina/connector HttpResponseBase.java catalina/src/share/org/apache/catalina/core StandardWrapperValve.java Log: - Add support for expectations. - Note: This means adding a new method in the HttpResponse interface. Unfortunately, I forgot to include it in my last proposal; hopefully, it is ok to make the method addition. - At the beginning of the processing of the filter pipeline, the connector will have the opportunity to ack the request with the client. - This is extremely useful in the case of doing a HTTP PUT in a protected area. The client will send the PUT header, wait for the sever ack. If it gets the 100, it will proceed with sending the body; it it gets some other status (like 401), it will be able to handle it gracefully, without breaking the connection. The commons HTTP client supports this (at least, it did last time I checked). Revision Changes Path 1.7 +13 -4 jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/Response.java Index: Response.java =================================================================== RCS file: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/Response.java,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- Response.java 28 Sep 2001 16:52:07 -0000 1.6 +++ Response.java 15 Mar 2002 19:12:48 -0000 1.7 @@ -1,7 +1,7 @@ /* - * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/Response.java,v 1.6 2001/09/28 16:52:07 remm Exp $ - * $Revision: 1.6 $ - * $Date: 2001/09/28 16:52:07 $ + * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/Response.java,v 1.7 2002/03/15 19:12:48 remm Exp $ + * $Revision: 1.7 $ + * $Date: 2002/03/15 19:12:48 $ * * ==================================================================== * @@ -79,7 +79,7 @@ * based on the processing of a corresponding <code>Request</code>. * * @author Craig R. McClanahan - * @version $Revision: 1.6 $ $Date: 2001/09/28 16:52:07 $ + * @version $Revision: 1.7 $ $Date: 2002/03/15 19:12:48 $ */ public interface Response { @@ -279,6 +279,15 @@ * Reset the data buffer but not any status or header information. */ public void resetBuffer(); + + + /** + * Send an acknowledgment of a request. + * + * @exception IOException if an input/output error occurs + */ + public void sendAcknowledgement() + throws IOException; } 1.51 +14 -4 jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/HttpResponseBase.java Index: HttpResponseBase.java =================================================================== RCS file: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/HttpResponseBase.java,v retrieving revision 1.50 retrieving revision 1.51 diff -u -r1.50 -r1.51 --- HttpResponseBase.java 12 Mar 2002 20:20:49 -0000 1.50 +++ HttpResponseBase.java 15 Mar 2002 19:12:48 -0000 1.51 @@ -1,7 +1,7 @@ /* - * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/HttpResponseBase.java,v 1.50 2002/03/12 20:20:49 remm Exp $ - * $Revision: 1.50 $ - * $Date: 2002/03/12 20:20:49 $ + * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/HttpResponseBase.java,v 1.51 2002/03/15 19:12:48 remm Exp $ + * $Revision: 1.51 $ + * $Date: 2002/03/15 19:12:48 $ * * ==================================================================== * @@ -104,7 +104,7 @@ * * @author Craig R. McClanahan * @author Remy Maucherat - * @version $Revision: 1.50 $ $Date: 2002/03/12 20:20:49 $ + * @version $Revision: 1.51 $ $Date: 2002/03/15 19:12:48 $ */ public class HttpResponseBase @@ -1049,6 +1049,16 @@ return (encodeURL(url)); + } + + + /** + * Send an acknowledgment of a request. + * + * @exception IOException if an input/output error occurs + */ + public void sendAcknowledgement() + throws IOException { } 1.34 +21 -4 jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/core/StandardWrapperValve.java Index: StandardWrapperValve.java =================================================================== RCS file: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/core/StandardWrapperValve.java,v retrieving revision 1.33 retrieving revision 1.34 diff -u -r1.33 -r1.34 --- StandardWrapperValve.java 14 Mar 2002 20:58:24 -0000 1.33 +++ StandardWrapperValve.java 15 Mar 2002 19:12:49 -0000 1.34 @@ -1,7 +1,7 @@ /* - * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/core/StandardWrapperValve.java,v 1.33 2002/03/14 20:58:24 remm Exp $ - * $Revision: 1.33 $ - * $Date: 2002/03/14 20:58:24 $ + * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/core/StandardWrapperValve.java,v 1.34 2002/03/15 19:12:49 remm Exp $ + * $Revision: 1.34 $ + * $Date: 2002/03/15 19:12:49 $ * * ==================================================================== * @@ -103,7 +103,7 @@ * <code>StandardWrapper</code> container implementation. * * @author Craig R. McClanahan - * @version $Revision: 1.33 $ $Date: 2002/03/14 20:58:24 $ + * @version $Revision: 1.34 $ $Date: 2002/03/15 19:12:49 $ */ final class StandardWrapperValve @@ -221,6 +221,23 @@ servlet = null; } catch (Throwable e) { log(sm.getString("standardWrapper.allocateException", + wrapper.getName()), e); + throwable = e; + exception(request, response, e); + servlet = null; + } + + // Acknowlege the request + try { + response.sendAcknowledgement(); + } catch (IOException e) { + sreq.removeAttribute(Globals.JSP_FILE_ATTR); + log(sm.getString("standardWrapper.acknowledgeException", + wrapper.getName()), e); + throwable = e; + exception(request, response, e); + } catch (Throwable e) { + log(sm.getString("standardWrapper.acknowledgeException", wrapper.getName()), e); throwable = e; exception(request, response, e);
-- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>