Re: cvs commit: jakarta-tomcat-connectors/http11/src/java/org/apache/coyote/http11 Constants.java Http11Connector.java InternalOutputBuffer.java

2002-01-15 Thread Remy Maucherat

> Hi Remy,
>
> A little late reply but :
>
> >> 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
>
> Do you think we could use coyote as a module for Tomcat 3.3 ?

Yes you can, but it's not as interesting as having it work with 4.0.
Overall, it should be a bit faster than the HTTP/1.0 connector, while
supporting HTTP/1.1, but it uses the same j-t-c/util buffers and helpers TC
3.3 already has (so no new benefit here).

Remy


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




RE: cvs commit: jakarta-tomcat-connectors/http11/src/java/org/apache/coyote/http11 Constants.java Http11Connector.java InternalOutputBuffer.java

2002-01-15 Thread GOMEZ Henri

Hi Remy,

A little late reply but :

>> 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

Do you think we could use coyote as a module for Tomcat 3.3 ?

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: cvs commit: jakarta-tomcat-connectors/http11/src/java/org/apache/coyote/http11 Constants.java Http11Connector.java InternalOutputBuffer.java

2002-01-11 Thread Remy Maucherat

> 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:   
For additional commands, e-mail: 




RE: cvs commit: jakarta-tomcat-connectors/http11/src/java/org/apache/coyote/http11 Constants.java Http11Connector.java InternalOutputBuffer.java

2002-01-11 Thread GOMEZ Henri

Hi Remy,

What's the final goal for Coyote ?

;)

-
Henri Gomez ___[_]
EMAIL : [EMAIL PROTECTED](. .) 
PGP KEY : 697ECEDD...oOOo..(_)..oOOo...
PGP Fingerprint : 9DF8 1EA8 ED53 2F39 DC9B 904A 364F 80E6 



>-Original Message-
>From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
>Sent: Thursday, January 10, 2002 5:58 PM
>To: [EMAIL PROTECTED]
>Subject: cvs commit:
>jakarta-tomcat-connectors/http11/src/java/org/apache/coyote/http11
>Constants.java Http11Connector.java InternalOutputBuffer.java
>
>
>remm02/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  ChangesPath
>  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 -   1.5
>  +++ Constants.java   10 Jan 2002 16:58:17 -  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 -  1.10
>  +++ Http11Connector.java 10 Jan 2002 16:58:17 -  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.jav

cvs commit: jakarta-tomcat-connectors/http11/src/java/org/apache/coyote/http11 Constants.java Http11Connector.java InternalOutputBuffer.java

2002-01-10 Thread remm

remm02/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  ChangesPath
  1.6   +8 -1  
jakarta-tomcat-connectors/http11/src/java/org/apache/coyote/http11/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.java9 Jan 2002 23:29:29 -   1.5
  +++ Constants.java10 Jan 2002 16:58:17 -  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/http11/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 -  1.10
  +++ Http11Connector.java  10 Jan 2002 16:58:17 -  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/http11/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 -  1.8
  +++ InternalOutputBuffer.java 10 Jan 2002 16:58:17 -  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
  + */
  +pub

cvs commit: jakarta-tomcat-connectors/http11/src/java/org/apache/coyote/http11 Constants.java Http11Connector.java InternalOutputBuffer.java

2001-09-30 Thread remm

remm01/09/30 18:20:42

  Modified:http11   .cvsignore
   http11/src/java/org/apache/coyote/http11 Constants.java
Http11Connector.java InternalOutputBuffer.java
  Log:
  - Implement the output.
  - The last parts to be written are the request processing itself, as well as some
utility components (like the chunking filters).
  
  Revision  ChangesPath
  1.2   +2 -3  jakarta-tomcat-connectors/http11/.cvsignore
  
  Index: .cvsignore
  ===
  RCS file: /home/cvs/jakarta-tomcat-connectors/http11/.cvsignore,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- .cvsignore2001/09/17 06:04:00 1.1
  +++ .cvsignore2001/10/01 01:20:42 1.2
  @@ -1,3 +1,2 @@
  -dist
  -build.properties
  -target
  \ No newline at end of file
  +build
  +build.properties
  \ No newline at end of file
  
  
  
  1.2   +6 -0  
jakarta-tomcat-connectors/http11/src/java/org/apache/coyote/http11/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.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- Constants.java2001/09/17 06:04:00 1.1
  +++ Constants.java2001/10/01 01:20:42 1.2
  @@ -137,4 +137,10 @@
   public static final int DEFAULT_HTTP_HEADER_BUFFER_SIZE = 128 * 1024;
   
   
  +/**
  + * CRLF.
  + */
  +public static final String CRLF = "\r\n";
  +
  +
   }
  
  
  
  1.2   +157 -1
jakarta-tomcat-connectors/http11/src/java/org/apache/coyote/http11/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.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- Http11Connector.java  2001/09/17 06:04:00 1.1
  +++ Http11Connector.java  2001/10/01 01:20:42 1.2
  @@ -84,6 +84,93 @@
   public class Http11Connector implements Connector, ActionHook {
   
   
  +// --- Constructors
  +
  +
  +/**
  + * Default constructor.
  + */
  +public Http11Connector() {
  +
  +request = new Request();
  +inputBuffer = new InternalInputBuffer(request);
  +request.setInputBuffer(inputBuffer);
  +
  +response = new Response();
  +response.setHook(this);
  +outputBuffer = new InternalOutputBuffer(response);
  +response.setOutputBuffer(outputBuffer);
  +
  +}
  +
  +
  +// - Instance Variables
  +
  +
  +/**
  + * Associated adapter.
  + */
  +protected Adapter adapter = null;
  +
  +
  +/**
  + * Request object.
  + */
  +protected Request request = null;
  +
  +
  +/**
  + * Response object.
  + */
  +protected Response response = null;
  +
  +
  +/**
  + * Input.
  + */
  +protected InternalInputBuffer inputBuffer = null;
  +
  +
  +/**
  + * Output.
  + */
  +protected InternalOutputBuffer outputBuffer = null;
  +
  +
  +// - Public Methods
  +
  +
  +/**
  + * Process pipelined HTTP requests using the specified input and output
  + * streams.
  + * 
  + * @param inputStream stream from which the HTTP requests will be read
  + * @param outputStream stream which will be used to output the HTTP 
  + * responses
  + * @throws IOException error during an I/O operation
  + */
  +public void process(InputStream input, OutputStream output)
  +throws IOException {
  +
  +// Setting up the I/O
  +inputBuffer.setInputStream(input);
  +outputBuffer.setOutputStream(output);
  +
  +
  +
  +
  +try {
  +adapter.service(request, response);
  +} catch (Exception e) {
  +;
  +}
  +
  +
  +
  +
  +}
  +
  +
   // - ActionHook Methods
   
   
  @@ -94,18 +181,87 @@
* @param param Action parameter
*/
   public void action(ActionCode actionCode, Object param) {
  +
  +if (actionCode == ActionCode.ACTION_COMMIT) {
  +
  +// Commit current response
  +
  +// Validate and write response headers
  +prepareResponse();
  +
  +} else if (actionCode == ActionCode.ACTION_ACK) {
  +
  +// Acknowlege request
  +
  +// Send a 100 status back if it makes sense (response not committed
  +// yet, and client specified an expectation for 100-continue)
  +