You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by Filip Hanik - Dev Lists <de...@hanik.com> on 2009/08/10 16:22:08 UTC

BIO connector - upload timeout

Http11Processor.java

inputBuffer.parseRequestLine();
                 request.setStartTime(System.currentTimeMillis());
                 keptAlive = true;
                 if (disableUploadTimeout) {
                     socket.setSoTimeout(soTimeout);
                 } else {
                     socket.setSoTimeout(timeout);
                 }
                 inputBuffer.parseHeaders();

Isn't the condition reversed here?
If I set disableUploadTimeout=true, shouldn't we then set the 5min 
timeout (socket.setSoTimeout(timeout). If I read the code correctly, we 
do the opposite.

Filip


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


Re: BIO connector - upload timeout

Posted by jean-frederic clere <jf...@gmail.com>.
On 08/10/2009 11:17 PM, Filip Hanik - Dev Lists wrote:
> On 08/10/2009 12:46 PM, Mark Thomas wrote:
>> Filip Hanik - Dev Lists wrote:
>>> Http11Processor.java
>>>
>>> inputBuffer.parseRequestLine();
>>> request.setStartTime(System.currentTimeMillis());
>>> keptAlive = true;
>>> if (disableUploadTimeout) {
>>> socket.setSoTimeout(soTimeout);
>>> } else {
>>> socket.setSoTimeout(timeout);
>>> }
>>> inputBuffer.parseHeaders();
>>>
>>> Isn't the condition reversed here?
>>> If I set disableUploadTimeout=true, shouldn't we then set the 5min
>>> timeout (socket.setSoTimeout(timeout).
>>
>> No.
>>
>> disableUploadTimeout==true means disable the special upload timeout and
>> use the standard socket timout (soTimeout)
>>
>> disableUploadTimeout==false means use the special upload timeout
>> (timeout)
> I see, I always thought it was the other way. since tomcat by default
> had a "special" upload timeout :)

Couldn't we just have a UploadTimeout parameter, so that if set use it, 
if not defaults to timeout?

Cheers

Jean-Frederic

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


Re: BIO connector - upload timeout

Posted by jean-frederic clere <jf...@gmail.com>.
On 08/10/2009 11:17 PM, Filip Hanik - Dev Lists wrote:
> On 08/10/2009 12:46 PM, Mark Thomas wrote:
>> Filip Hanik - Dev Lists wrote:
>>> Http11Processor.java
>>>
>>> inputBuffer.parseRequestLine();
>>> request.setStartTime(System.currentTimeMillis());
>>> keptAlive = true;
>>> if (disableUploadTimeout) {
>>> socket.setSoTimeout(soTimeout);
>>> } else {
>>> socket.setSoTimeout(timeout);
>>> }
>>> inputBuffer.parseHeaders();
>>>
>>> Isn't the condition reversed here?
>>> If I set disableUploadTimeout=true, shouldn't we then set the 5min
>>> timeout (socket.setSoTimeout(timeout).
>>
>> No.
>>
>> disableUploadTimeout==true means disable the special upload timeout and
>> use the standard socket timout (soTimeout)
>>
>> disableUploadTimeout==false means use the special upload timeout
>> (timeout)
> I see, I always thought it was the other way. since tomcat by default
> had a "special" upload timeout :)

Couldn't we just have a UploadTimeout parameter, so that if set use it, 
if not default to timeout?

Cheers

Jean-Frederic

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


Re: BIO connector - upload timeout

Posted by Filip Hanik - Dev Lists <de...@hanik.com>.
On 08/10/2009 12:46 PM, Mark Thomas wrote:
> Filip Hanik - Dev Lists wrote:
>    
>> Http11Processor.java
>>
>> inputBuffer.parseRequestLine();
>>                  request.setStartTime(System.currentTimeMillis());
>>                  keptAlive = true;
>>                  if (disableUploadTimeout) {
>>                      socket.setSoTimeout(soTimeout);
>>                  } else {
>>                      socket.setSoTimeout(timeout);
>>                  }
>>                  inputBuffer.parseHeaders();
>>
>> Isn't the condition reversed here?
>> If I set disableUploadTimeout=true, shouldn't we then set the 5min
>> timeout (socket.setSoTimeout(timeout).
>>      
>
> No.
>
> disableUploadTimeout==true means disable the special upload timeout and
> use the standard socket timout (soTimeout)
>
> disableUploadTimeout==false means use the special upload timeout (timeout)
>    
I see, I always thought it was the other way. since tomcat by default 
had a "special" upload timeout :)
and we could disable it.
thanks for the clarification.

Filip

>    
>> If I read the code correctly, we
>> do the opposite.
>>      
>
> There are too many negatives in the code which causes confusion but the
> current trunk code is correct. It wasn't right for a long time. See:
> http://svn.apache.org/viewvc?view=rev&revision=744160
> and
> http://svn.apache.org/viewvc?view=rev&revision=763262
>
> Mark
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: dev-help@tomcat.apache.org
>
>
>    


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


Re: BIO connector - upload timeout

Posted by Mark Thomas <ma...@apache.org>.
Filip Hanik - Dev Lists wrote:
> Http11Processor.java
> 
> inputBuffer.parseRequestLine();
>                 request.setStartTime(System.currentTimeMillis());
>                 keptAlive = true;
>                 if (disableUploadTimeout) {
>                     socket.setSoTimeout(soTimeout);
>                 } else {
>                     socket.setSoTimeout(timeout);
>                 }
>                 inputBuffer.parseHeaders();
> 
> Isn't the condition reversed here?
> If I set disableUploadTimeout=true, shouldn't we then set the 5min
> timeout (socket.setSoTimeout(timeout).

No.

disableUploadTimeout==true means disable the special upload timeout and
use the standard socket timout (soTimeout)

disableUploadTimeout==false means use the special upload timeout (timeout)

> If I read the code correctly, we
> do the opposite.

There are too many negatives in the code which causes confusion but the
current trunk code is correct. It wasn't right for a long time. See:
http://svn.apache.org/viewvc?view=rev&revision=744160
and
http://svn.apache.org/viewvc?view=rev&revision=763262

Mark



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