Hi Johnny,

Yes, We are using ajax to make the post requests, and the header do include
content-length information that was calculated by ajax automatically, but
the
strange thing is sometime it get stuck at the begin of uploading http body(0
byte
was transfered always in this case) until AJP connector timeout, actually we
have revised a little bit on tomcat source code, below is our finding we
made
the change on org.apache.catalina.connector.Request.java for your reference
:

protected void parseParameters() {

    :      :       :      :
    :      :       :      :

                if (actualLen == len) {
                    parameters.processParameters(formData, 0, len);
                }
                else { // added by me
                    context.getLogger().error("formData Len error len :" +
len + " <> actualLen :" + actualLen);
                }
            } catch (Throwable t) {
                context.getLogger().warn
                    (sm.getString("coyoteRequest.parseParameters"), t);
            }
        }

    }

Following was the Tomcat log, actualLen always return 0,
the first line showing the content-length is 32 but the returned
actual length is 0.

SEVERE: formData Len error len :32 <> actualLen :0
SEVERE: formData Len error len :379 <> actualLen :0
SEVERE: formData Len error len :32 <> actualLen :0
SEVERE: formData Len error len :41 <> actualLen :0
SEVERE: formData Len error len :60 <> actualLen :0
SEVERE: formData Len error len :74 <> actualLen :0
SEVERE: formData Len error len :145 <> actualLen :0
SEVERE: formData Len error len :60 <> actualLen :0

Thanks & Best Regards.
James Wang
On Mon, Oct 13, 2008 at 4:34 PM, Johnny Kewl <[EMAIL PROTECTED]> wrote:

>
> ----- Original Message ----- From: "James Wang" <[EMAIL PROTECTED]>
> To: "Tomcat Users List" <users@tomcat.apache.org>
> Sent: Monday, October 13, 2008 7:11 AM
> Subject: Re: question : encounter java.net.SocketTimeoutException: Read
> timed out occasionally
>
>
> Hi Mark,
>>
>> In order to find out if the problem of Request.getParameter("parm") return
>> null (missing post
>> body part) is related to http keep-alive,  We've tried to reduce
>> the KeepaliveTimeout setting in
>> Apache httpd server from 15 seconds to 5 seconds,  the strange thing
>> happened, We found
>> the null parameter count was raised from 400/per-day (in average) to 900
>> times/per-day.
>> The next step we are going to disable the keep-alive and see what will
>> happen, will let you
>> know the result for reference.
>>
>> If disabling keeplive could resolve this problem, the mysterious part then
>> is why the
>> the browser get stuck on uploading the post body part always.
>>
>
> James, what is actually doing the post?... Ajax?
> Look I dont know, but it smells like a data size problem...
> Something like a header size is saying... you going to get 500 bytes and
> only 499 come in... so now the browser is waiting for the stupid server to
> reply, and the server thinks the stupid browser is just slow... eventually
> TCP sockets say... good bye, you guys are just too slow.
> So socket time out, I think, is not the real issue... some header size is
> wrong... maybe something subtle like its multibyte and the header size is
> calculating bytes.
> If you click twice and then the 1st param comes in... it sounds very much
> like a header size calc is out...
> I dont know... but thats what I'd be looking for...
>
> ---------------------------------------------------------------------------
> HARBOR : http://www.kewlstuff.co.za/index.htm
> The most powerful application server on earth.
> The only real POJO Application Server.
> See it in Action : http://www.kewlstuff.co.za/cd_tut_swf/whatisejb1.htm
> ---------------------------------------------------------------------------
> If you cant pay in gold... get lost...
>
>
>
>
>
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

Reply via email to