[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Issue #74 from release 0.7 roadmap.


On Monday 30 June 2014 19:38:03 Andreas Schneider wrote:
> On Thursday 26 June 2014 17:18:50 Joseph Southwell wrote:
> > I need this feature myself so would like to contribute it.
> 
> Sorry for the late response, I was on vacation.
> 
> This is really great. We should rewrite the async sftp read too so it
> matches the write function. The current API isn't really nice.
> 
> > Before I begin
> > working on it. I want to make sure that I am doing it in a way that will
> > fit with your grand design.
> > 
> > I was planning on adding a channel write callback that gets passed how
> > many
> > bytes were written and an error indicator. I would also add an associated
> > ssh_channel_write_nonblocking function.
> > 
> > Then using that underlying functionality I will add the following 2
> > functions. sftp_async_write_begin .. initiate a non blocking write. Retuns
> > a request id sftp_async_write_end .. takes a request id and returns
> > ssize_t, number of byes written < 0 on error
> 
> I think I would prefer to have.
> 
> ssize_t sftp_async_write_send(sftp_file file, void *data, size_t len)
> 
> sftp_async_write_recv()
> 
> and also
> 
> sftp_async_read_send()
> sftp_async_read_recv()
> 
> 
> I think a
> 
> ssh_channel_async_writev(ssh_channel c, const struct iovec *iov, size_t
> count)
> 
> would be nice for this. See 'man writev'. We have async writev function in
> Samba and use this function most of the time.
> 

As a reference maybe look at the tsocket header. It is a very good interface.


https://git.samba.org/samba.git/?p=samba.git;a=blob;f=lib/tsocket/tsocket.h;h=6b0eef6d7999f7f454db256598ec27eddca70201;hb=refs/heads/master

There is a tstream_writev_send() and tstream_writev_recv()

One of the consumers is here:

https://git.samba.org/samba.git/?p=samba.git;a=blob;f=libcli/named_pipe_auth/npa_tstream.c;h=3d3f55edd3553576c983a4a47447d26040be21de;hb=refs/heads/master



	-- andreas

-- 
Andreas Schneider                   GPG-ID: CC014E3D
www.cryptomilk.org                asn@xxxxxxxxxxxxxx


Archive administrator: postmaster@lists.cynapses.org