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

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

From: Henrik Nordström <>
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
> */
> + 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

> > Add FIXME markers where _libssh2_transport_send is used badly
> >
> 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!



Received on 2011-08-16