You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by GOMEZ Henri <hg...@slib.fr> on 2002/01/11 09:41:27 UTC
RE: cvs commit: jakarta-tomcat-connectors/http11/src/java/org/apa
che/coyote/http11 Constants.java Http11Connector.java InternalOutputBuffe
r.java
Hi Remy,
What's the final goal for Coyote ?
;)
-
Henri Gomez ___[_]____
EMAIL : hgomez@slib.fr (. .)
PGP KEY : 697ECEDD ...oOOo..(_)..oOOo...
PGP Fingerprint : 9DF8 1EA8 ED53 2F39 DC9B 904A 364F 80E6
>-----Original Message-----
>From: remm@apache.org [mailto:remm@apache.org]
>Sent: Thursday, January 10, 2002 5:58 PM
>To: jakarta-tomcat-connectors-cvs@apache.org
>Subject: cvs commit:
>jakarta-tomcat-connectors/http11/src/java/org/apache/coyote/http11
>Constants.java Http11Connector.java InternalOutputBuffer.java
>
>
>remm 02/01/10 08:58:17
>
> Modified: http11/src/java/org/apache/coyote/http11 Constants.java
> Http11Connector.java InternalOutputBuffer.java
> Log:
> - Add support for sending acknoledgments.
> - Implement reset.
>
> Revision Changes Path
> 1.6 +8 -1
>jakarta-tomcat-connectors/http11/src/java/org/apache/coyote/htt
>p11/Constants.java
>
> Index: Constants.java
> ===================================================================
> RCS file:
>/home/cvs/jakarta-tomcat-connectors/http11/src/java/org/apache/
>coyote/http11/Constants.java,v
> retrieving revision 1.5
> retrieving revision 1.6
> diff -u -r1.5 -r1.6
> --- Constants.java 9 Jan 2002 23:29:29 -0000 1.5
> +++ Constants.java 10 Jan 2002 16:58:17 -0000 1.6
> @@ -141,7 +141,7 @@
> /**
> * Default HTTP header buffer size.
> */
> - public static final int DEFAULT_HTTP_HEADER_BUFFER_SIZE
>= 128 * 1024;
> + public static final int DEFAULT_HTTP_HEADER_BUFFER_SIZE
>= 128 * 1000;
>
>
> /**
> @@ -178,6 +178,13 @@
> * HTTP/1.1.
> */
> public static final String HTTP_11 = "HTTP/1.1";
> +
> +
> + /**
> + * Ack string when pipelining HTTP requests.
> + */
> + public static final byte[] ACK =
> + (new String("HTTP/1.1 100 Continue\r\n\r\n")).getBytes();
>
>
> }
>
>
>
> 1.11 +17 -3
>jakarta-tomcat-connectors/http11/src/java/org/apache/coyote/htt
>p11/Http11Connector.java
>
> Index: Http11Connector.java
> ===================================================================
> RCS file:
>/home/cvs/jakarta-tomcat-connectors/http11/src/java/org/apache/
>coyote/http11/Http11Connector.java,v
> retrieving revision 1.10
> retrieving revision 1.11
> diff -u -r1.10 -r1.11
> --- Http11Connector.java 10 Jan 2002 15:23:23 -0000 1.10
> +++ Http11Connector.java 10 Jan 2002 16:58:17 -0000 1.11
> @@ -163,6 +163,12 @@
>
>
> /**
> + * HTTP/1.1 flag.
> + */
> + protected boolean http11 = true;
> +
> +
> + /**
> * Content delimitator for the request (if false, the
>connection will
> * be closed at the end of the request).
> */
> @@ -360,7 +366,13 @@
> // Send a 100 status back if it makes sense
>(response not committed
> // yet, and client specified an expectation for
>100-continue)
>
> - // FIXME
> + try {
> + outputBuffer.sendAck();
> + } catch (IOException e) {
> + // Log the error, and set error flag
> + e.printStackTrace();
> + error = true;
> + }
>
> } else if (actionCode == ActionCode.ACTION_CLOSE) {
>
> @@ -383,6 +395,8 @@
>
> // Note: This must be called before the
>response is committed
>
> + outputBuffer.reset();
> +
> } else if (actionCode == ActionCode.ACTION_CUSTOM) {
>
> // Do nothing
> @@ -423,7 +437,7 @@
> */
> protected void prepareRequest() {
>
> - boolean http11 = true;
> + http11 = true;
> contentDelimitation = false;
>
> MessageBytes protocolMB = request.protocol();
> @@ -434,6 +448,7 @@
> keepAlive = false;
> } else {
> // Unsupported protocol
> + http11 = false;
> error = true;
> // Send 505; Unsupported HTTP version
> response.setStatus(505);
> @@ -541,7 +556,6 @@
> */
> protected void prepareResponse() {
>
> - boolean http11 = true;
> boolean http09 = false;
> contentDelimitation = false;
>
>
>
>
> 1.9 +28 -5
>jakarta-tomcat-connectors/http11/src/java/org/apache/coyote/htt
>p11/InternalOutputBuffer.java
>
> Index: InternalOutputBuffer.java
> ===================================================================
> RCS file:
>/home/cvs/jakarta-tomcat-connectors/http11/src/java/org/apache/
>coyote/http11/InternalOutputBuffer.java,v
> retrieving revision 1.8
> retrieving revision 1.9
> diff -u -r1.8 -r1.9
> --- InternalOutputBuffer.java 10 Jan 2002 12:53:50
>-0000 1.8
> +++ InternalOutputBuffer.java 10 Jan 2002 16:58:17
>-0000 1.9
> @@ -226,8 +226,6 @@
> */
> public void addFilter(OutputFilter filter) {
>
> - // FIXME: Check for null ?
> -
> OutputFilter[] newFilterLibrary =
> new OutputFilter[filterLibrary.length + 1];
> for (int i = 0; i < filterLibrary.length; i++) {
> @@ -267,9 +265,6 @@
> */
> public void addActiveFilter(OutputFilter filter) {
>
> - // FIXME: Check for null ?
> - // FIXME: Check index ?
> -
> if (lastActiveFilter == -1) {
> filter.setBuffer(outputStreamOutputBuffer);
> } else {
> @@ -287,6 +282,22 @@
>
>
> /**
> + * Reset current response.
> + *
> + * @throws IllegalStateException if the response has
>already been committed
> + */
> + public void reset() {
> +
> + if (committed)
> + throw new IllegalStateException(/*FIXME:Put an
>error message*/);
> +
> + // Recycle Request object
> + response.recycle();
> +
> + }
> +
> +
> + /**
> * Recycle the output buffer. This should be called
>when closing the
> * connection.
> */
> @@ -355,6 +366,18 @@
>
>
> // ------------------------------------------------
>HTTP/1.1 Output Methods
> +
> +
> + /**
> + * Send an acknoledgement.
> + */
> + public void sendAck()
> + throws IOException {
> +
> + if (!committed)
> + outputStream.write(Constants.ACK);
> +
> + }
>
>
> /**
>
>
>
>
>--
>To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
Re: cvs commit: jakarta-tomcat-connectors/http11/src/java/org/apache/coyote/http11 Constants.java Http11Connector.java InternalOutputBuffer.java
Posted by Remy Maucherat <re...@apache.org>.
> Hi Remy,
>
> What's the final goal for Coyote ?
>
> ;)
- It should be faster than the current HTTP/1.1 processor
- It should address the HTTP/1.1 items marked as later in bugzilla
- It should be maintainable
- It should be easily testable
- It uses j-t-c/util and should be GC friendly, at least when used
standalone (without any adapter)
- It should work with 4.0 and 4.1; I'll make it available as a module for
4.0.x to get some testing
At the moment, I need to add:
- support for input chunking (that's the hardest filter to write)
- HTTP/0.9 support
- some tweaks to the response processing (I think there are a few cases
missing)
- write more tests
- and of course, the adapter for Catalina
Remy
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>