Subject: Re: send/recv callbacks (was Re: writing to channel limited to 2 Mb?)

Re: send/recv callbacks (was Re: writing to channel limited to 2 Mb?)

From: Henrik Nordström <henrik_at_henriknordstrom.net>
Date: Thu, 11 Aug 2011 22:40:59 +0200

tor 2011-08-11 klockan 11:43 +0200 skrev Daniel Stenberg:

> I can see how we can add support for user-provided send/recv functions and I
> believe we've discussed that before and I'm for it. I would however prefer to
> better hide that within the _libssh2_recv() and _libssh2_send() functions to
> make the existing code (basically) unmodified and easier to read, make it
> easier to have future code use the same concept and make it affect _all_
> reads/writes.

I think a simpler way is to make all SSH send/recv go via
session->send/recv set by default to _libssh2_send/recv

Additionally agent.c is also using _libssh2_send/recv with a slightly
different usage pattern, doing I/O on the agent fd and not the libssh2
session fd.

Reworked patch attached. Can also be found in my github repository where
various other small changes also resides while I am reading the code.

  github.com/hno/libssh2

Regards
Henrik

_______________________________________________
libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel

Received on 2011-08-11