assuan external loop over socket

Marcus Brinkmann marcus.brinkmann at ruhr-uni-bochum.de
Sat Jan 19 20:00:45 CET 2008


At Sat, 19 Jan 2008 12:52:11 -0500,
Ben Kibbey <bjk at luxsci.net> wrote:
> 
> On Mon, Dec 17, 2007 at 05:00:31PM +0100, Marcus Brinkmann wrote:
> > > I did find another use
> > > in my app for external IO over a socket, so the sooner this feature can
> > > get added, the better. :)
> > 
> > Did you consider not using assuan_transact for asynchronous operations
> > a la GPGME?  Even if this is not the best solution, it would help me
> > if you could say that doing so would address your use case completely,
> > or if you see other interfaces to be affected.
> 
> Basically I don't want a client to wait for a command to complete on the
> server. As it is now, my client uses assuan_transact() to send the
> command and then has to wait for a result. The command is a key
> retrieval via pinentry and may take some time to complete.

Right, assuan_transact is not designed to be used asynchronously.

> Are you recommending using GPGME or just async IO like GPGME?

The latter (assuming that GPGME does not provide what you need).

> If I were
> to select() on the socket FD I would just use assuan_write_line() and
> assuan_read_line() and do the parsing myself?

Yes.  It's only comments, OK, D, and ERR lines you have to parse.
Well, and INQUIRE if you need that.  That's not insubstantial code, so
some support from assuan may be useful.  Maybe a function that parses
a line for status/err/ok/data/inquire?  Ie, only the line parser part
from assuan_transact?  I am not sure assuan can do much more than that
for you without a whole lot of more infrastructure in libassuan.

I am open for suggestions on this one.  I agree it is not suboptimal,
but looking at GPGME, most of the complexity comes from places where
libassuan can't help.

libassuan is then reduced to connection build-up and low-level I/O.
Better than nothing, hu? :)

Thanks,
Marcus




More information about the Gnupg-devel mailing list