tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bill Barker" <wbar...@wilshire.com>
Subject Re: AJP/Java connector issues
Date Fri, 20 May 2005 18:58:50 GMT

----- Original Message -----
From: "jean-frederic clere" <jfrederic.clere@fujitsu-siemens.com>
To: "Tomcat Developers List" <tomcat-dev@jakarta.apache.org>
Sent: Friday, May 20, 2005 9:02 AM
Subject: Re: AJP/Java connector issues


> Mladen Turk wrote:
> > Hi,
> >
> > Just noticed a strange behavior in the Java part of the
> > JK dealing with large (over 8184 bytes) data transfers.
> >
> > Since with 8192 bytes AJP packet size, the maximum
> > transferred size per each packet is 8184 bytes one
> > would expect that for 20000 bytes file the packets
> > would be in a form of:
> > 1:8184,2:8184,3:3632 thus total of 20000 bytes.
> >
> > But in fact the behavior is rely weird:
> > 1:8184,2:8,3:8184,4:8,5:3616.
> >
> > Instead only three, the five! packets are transferred.
> >
> > Seems that algorithm is breaking 8192 bytes of data to
> > two packets (8184 and 8 bytes).
>
> I have an ugly patch for that. Find it attached (that just for gettting
comments).
>

If we move the protocol check into Response.setConnector, the patch isn't
even that ugly ;-).

> Cheers
>
> Jean-Frederic
>
> >
> > Bill,
> > Any idea how to solve this, because it's way too
> > inefficient.
> > What's makes the things even worse is that for each
> > packet Apache2 creates a transient bucket thus
> > rising the memory usage.
> >
> >
> > Regards,
> > Mladen.
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org
> >
> >
>
>


----------------------------------------------------------------------------
----


> Index: Response.java
> ===================================================================
> RCS file:
/home/cvspublic/jakarta-tomcat-catalina/catalina/src/share/org/apache/catali
na/connector/Response.java,v
> retrieving revision 1.12
> diff -u -r1.12 Response.java
> --- Response.java 25 Apr 2005 22:06:30 -0000 1.12
> +++ Response.java 20 May 2005 15:56:25 -0000
> @@ -68,6 +68,16 @@
>
>
>      public Response() {
> +        outputBuffer = new OutputBuffer();
> +        outputStream = new CoyoteOutputStream(outputBuffer);
> +        writer = new CoyoteWriter(outputBuffer);
> +        urlEncoder.addSafeCharacter('/');
> +    }
> +
> +    public Response(int size) {
> +        outputBuffer = new OutputBuffer(size);
> +        outputStream = new CoyoteOutputStream(outputBuffer);
> +        writer = new CoyoteWriter(outputBuffer);
>          urlEncoder.addSafeCharacter('/');
>      }
>
> @@ -174,20 +184,19 @@
>      /**
>       * The associated output buffer.
>       */
> -    protected OutputBuffer outputBuffer = new OutputBuffer();
> +    protected OutputBuffer outputBuffer;
>
>
>      /**
>       * The associated output stream.
>       */
> -    protected CoyoteOutputStream outputStream =
> -        new CoyoteOutputStream(outputBuffer);
> +    protected CoyoteOutputStream outputStream;
>
>
>      /**
>       * The associated writer.
>       */
> -    protected CoyoteWriter writer = new CoyoteWriter(outputBuffer);
> +    protected CoyoteWriter writer;
>
>
>      /**
> Index: Connector.java
> ===================================================================
> RCS file:
/home/cvspublic/jakarta-tomcat-catalina/catalina/src/share/org/apache/catali
na/connector/Connector.java,v
> retrieving revision 1.18
> diff -u -r1.18 Connector.java
> --- Connector.java 30 Apr 2005 03:32:43 -0000 1.18
> +++ Connector.java 20 May 2005 15:56:42 -0000
> @@ -897,7 +897,12 @@
>       */
>      public Response createResponse() {
>
> -        Response response = new Response();
> +        System.out.println("Connector: createResponse: getProtocol: " +
getProtocol());
> +        Response response = null;
> +        if ("AJP/1.3".equals(getProtocol()))
> +            response = new Response(8184);
> +        else
> +            response = new Response();
>          response.setConnector(this);
>          return (response);
>
>
>


----------------------------------------------------------------------------
----


> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org



This message is intended only for the use of the person(s) listed above as the intended recipient(s),
and may contain information that is PRIVILEGED and CONFIDENTIAL.  If you are not an intended
recipient, you may not read, copy, or distribute this message or any attachment. If you received
this communication in error, please notify us immediately by e-mail and then delete all copies
of this message and any attachments.

In addition you should be aware that ordinary (unencrypted) e-mail sent through the Internet
is not secure. Do not send confidential or sensitive information, such as social security
numbers, account numbers, personal identification numbers and passwords, to us via ordinary
(unencrypted) e-mail.



Mime
View raw message