assuan_read_from_server() and return value

Ben Kibbey bjk at luxsci.net
Sun Dec 2 19:04:22 CET 2007


On Fri, Nov 23, 2007 at 02:01:04PM -0500, Ben Kibbey wrote:
> I'm using assuan_transact() to process an inquire command. After the
> command is finished, assuan_transact() sends "END" then reads the next
> line from the server via assuan_read_from_server().
> assuan_read_from_server() will parse an ERR line, but won't do anything
> with the error code. Attached is a patch that'll return the server error
> code. Doesn't seem to break anything.

Oops. The patch does break things. The server isn't guaranteed to return
a ASSUAN_N or GPG_ERR_N code. And there isn't a way to tell which type
of error it is. So would it be better to patch the server (pinentry in
this case) to return gpg-error codes, or do something different with my
return codes from the server (which does use gpg-error codes)?

It does make sense to me to consider the ERR response code from a server
command. Any reason not to?

Thanks,

-- 
Benjamin J. Kibbey bjk at luxsci.net/jabber/freenode
3019 F5FC AA33 5BC7 BE9F 09D2 393E DBD2 40D5 FA7E



More information about the Gnupg-devel mailing list