Subject: Re: libssh2 API brokenness

Re: libssh2 API brokenness

From: Henrik Nordström <henrik_at_henriknordstrom.net>
Date: Thu, 01 Sep 2011 14:54:47 +0200

tor 2011-09-01 klockan 10:04 +0200 skrev Daniel Stenberg:

> Perhaps we need to remake the parts dealing with the channel layer, to always
> have a queue for outgoing packets and always when we get something to send to
> the remote side we convert the entire thing into a complete SSH packet. If
> that blocks, we'll need to keep the unsent part around until libssh2 gets
> called again.

Kind of the same as I proposed, only that I see this done at
libssh2_transport_send, not at the channel level. To me that's the
logical place as it's receiving full SSH messages independent of their
source (channel traffic, key renegotiation, reply messages,
keep-alive, ..)

As far as I am aware messages are never split over multiple
libssh2_transport_send() calls. Each call is always a complete transport
message.

> If then another function wants to send data over the channel, that would just
> add a packet to the outgoing queue and thus not ruin the half-unsent packet
> that's already sitting waiting in the queue.

Exactly. And perhaps a little priority to allow window adjust and other
control messages short-circuit the queue and get sent after the current
packet.

Regards
Henrik

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