Subject: Re: [patch] fix X11 forwarding example reuse after free

Re: [patch] fix X11 forwarding example reuse after free

From: Henrik Nordström <henrik_at_henriknordstrom.net>
Date: Tue, 16 Aug 2011 15:23:28 +0200

tis 2011-08-16 klockan 10:36 +0200 skrev Daniel Stenberg:

> + /* Skip sending keep-alive if already blocking trying to send something
> */
> + if ((dir & LIBSSH2_SESSION_BLOCK_OUTBOUND)) {
> + rc = libssh2_keepalive_send (session, &seconds_to_next);
>
> Isn't the comment saying the exact opposite of what the code does?

Right.. sorry about that, and thanks for the peer review. Fixed.

Ideally Id' like to replace that condition with a check if there is ANY
data in the transmit window, and to bump the timer each time something
is transmitted. There should also be some randomization of the interval.
Plus checking that there is some form of return traffic if response is
requested.. but needs some more study before coming up with a solid
proposal.

> > Add FIXME markers where _libssh2_transport_send is used badly
> > https://github.com/hno/libssh2/commit/b64b1813158c16e0506ec96fbc89d134d82d330e
>
> This patch seems to rely on the previous keepalive change so I didn't merge it
> yet.

Correct. It was the keep-alive patch that made me aware of the problem.

> I did however also merge your document fixes as you will see!

Thanks!

Regards
Henrik

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