errno
Werner Koch
wk@gnupg.org
Mon Jun 18 15:30:01 2001
|| On Mon, 18 Jun 2001 11:07:47 +0300
|| Nikos Mavroyanopoulos <nmav@hellug.gr> wrote:
nm> 1. Document it and request to install SIG_IGN for the SIGPIPE signal before calling
nm> gnutls_handshake/gnutls_rehandshake.
nm> (that way we detect the error and behave as expected)
That is easy and maybe you should do it for now.
nm> 2. Check for pending alerts between reading two messages.
Argh....
nm> [this will not work if the peer closes the connection
nm> without an alert]
... this will happen.
nm> 3. Install the signal handler while doing handshake(), and restore
nm> it when leaving (I don't really like it)
IMHO, this is the best way and the reason why POSIX has a sound
specificaton of signals. Well, the OS just needs to be POSIX
compliant ;-) MT apps are still a problem but this is the case anyway
with MT.
You might want to provide a flag to disable signal catching so that
the default operation mode works inmost cases.
--
Werner Koch Omnis enim res, quae dando non deficit, dum habetur
g10 Code GmbH et non datur, nondum habetur, quomodo habenda est.
Privacy Solutions -- Augustinus