Subject: Re: data overload

Re: data overload

From: Dave Hayden <dave_at_panic.com>
Date: Wed, 22 Aug 2012 14:45:35 -0700

On Aug 19, 2012, at 4:36 AM, Daniel Stenberg wrote:

> On Wed, 15 Aug 2012, Dave Hayden wrote:
>
>> I added a "count" property to the list_head struct, incrementing it in _libssh2_list_add() and decrementing in _libssh2_list_remove(). In _libssh2_channel_read() instead of calling _libssh2_transport_read() once if session->packets is empty, I and session->packets->count is below a constant limit. (8 seems reasonable..?) A better solution might be to track the total size of the buffered data and place a limit on that instead.
>
> Thanks for the patch Dave, I can see how this might be necessary. I'm curious though, how is the channel window playing into this? I mean, the window is only grown in libssh2_channel_read_ex() so won't you get a finite amount of data that fills up the window?
>
> Other than so, I really agree that a limit on amount of data would be much better but that's also what we have the window for already so we need to find the middle ground here if windowing isn't enough. Or improve the windowing perhaps.

Uh oh. Now I'm having one of those "was the whole thing a bad dream?" moments. I'm trying to reproduce the original problem (session->packets was filling up faster than I could drain it) and now I can't figure out what was causing it. And I can't find any traces in svn or in our bug tracker. It must have been alien abduction. It's the only sensible conclusion.

I finally stared at the code long enough to sort out how the receive window works, and it certainly looks like that should keep this problem from happening. My best guess is I had something else going wrong and I was misreading the diagnostics.

Many thanks for the help,
-Dave

_______________________________________________
libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel
Received on 2012-08-22