Problem with HttpTunnel timeout

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Problem with HttpTunnel timeout

Bugzilla from giacof@tiscali.it
Hi, I'm using Jetty classes to implement a proxy server.
I tried to tunnel a ssh session through my proxy with proxytunnel-1.2.2,
but once established, it's always closed and dropped after a 30 seconds
delay.
Then I looked into HttpTunnel.java and I found this:

    private void copydata(InputStream in, OutputStream out)
throws java.io.IOException
    {
        long timestamp= 0;
        while (true)
        {
            try
            {
                IO.copy(in, out);
                timestamp= 0;
                return;
            }
            catch (InterruptedIOException e)
            {
                LogSupport.ignore(log, e);
                if (timestamp == 0)
                    timestamp= System.currentTimeMillis();
                else if (_timeoutMs > 0 && (System.currentTimeMillis()
 - timestamp) > _timeoutMs)
                    throw e;
            }
        }
    }

as _timeoutMs is set statically = 30000 (msec), the underlying socket is
closed when such timeout expires, no matter if it's still active!
Why cannot the timeout be dynamic? Wouldn't make sense to monitor somehow
the socket activity and reset the timestamp when the count of the copied
bytes is >0 ?
Regards,
Jack




-------------------------------------------------------
This SF.Net email is sponsored by: NEC IT Guy Games.  How far can you shotput
a projector? How fast can you ride your desk chair down the office luge track?
If you want to score the big prize, get to know the little guy.  
Play to win an NEC 61" plasma display: http://www.necitguy.com/?r=20
_______________________________________________
jetty-discuss mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jetty-discuss
Reply | Threaded
Open this post in threaded view
|

Re: Problem with HttpTunnel timeout

Greg Wilkins-5

Jack,

I have no problem at all with this timeout being dynamic.
Please feel free to submit a patch for this, as I probably will not have time
to look at this for a few weeks - it should probably get its
value from the idle timeout of the listener involved.

saluti




Jack wrote:

> Hi, I'm using Jetty classes to implement a proxy server.
> I tried to tunnel a ssh session through my proxy with proxytunnel-1.2.2,
> but once established, it's always closed and dropped after a 30 seconds
> delay.
> Then I looked into HttpTunnel.java and I found this:
>
>     private void copydata(InputStream in, OutputStream out)
> throws java.io.IOException
>     {
>         long timestamp= 0;
>         while (true)
>         {
>             try
>             {
>                 IO.copy(in, out);
>                 timestamp= 0;
>                 return;
>             }
>             catch (InterruptedIOException e)
>             {
>                 LogSupport.ignore(log, e);
>                 if (timestamp == 0)
>                     timestamp= System.currentTimeMillis();
>                 else if (_timeoutMs > 0 && (System.currentTimeMillis()
>  - timestamp) > _timeoutMs)
>                     throw e;
>             }
>         }
>     }
>
> as _timeoutMs is set statically = 30000 (msec), the underlying socket is
> closed when such timeout expires, no matter if it's still active!
> Why cannot the timeout be dynamic? Wouldn't make sense to monitor somehow
> the socket activity and reset the timestamp when the count of the copied
> bytes is >0 ?
> Regards,
> Jack
>
>
>
>
> -------------------------------------------------------
> This SF.Net email is sponsored by: NEC IT Guy Games.  How far can you shotput
> a projector? How fast can you ride your desk chair down the office luge track?
> If you want to score the big prize, get to know the little guy.  
> Play to win an NEC 61" plasma display: http://www.necitguy.com/?r=20



-------------------------------------------------------
This SF.Net email is sponsored by: NEC IT Guy Games.  How far can you shotput
a projector? How fast can you ride your desk chair down the office luge track?
If you want to score the big prize, get to know the little guy.  
Play to win an NEC 61" plasma display: http://www.necitguy.com/?r=20
_______________________________________________
jetty-discuss mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jetty-discuss
Reply | Threaded
Open this post in threaded view
|

Re: Problem with HttpTunnel timeout

Bugzilla from giacof@tiscali.it
Greg Wilkins <gregw <at> mortbay.com> writes:

> I have no problem at all with this timeout being dynamic.
> Please feel free to submit a patch for this, as I probably will not have
time to look at this for a few weeks - it should probably get its
> value from the idle timeout of the listener involved.
>
> saluti
 
Ok, I'll try to fix it; hope it will be useful to someone other ;-)
Buone vacanze! :-)))



-------------------------------------------------------
This SF.Net email is sponsored by: NEC IT Guy Games.  How far can you shotput
a projector? How fast can you ride your desk chair down the office luge track?
If you want to score the big prize, get to know the little guy.  
Play to win an NEC 61" plasma display: http://www.necitguy.com/?r=20
_______________________________________________
jetty-discuss mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jetty-discuss