Greetings.

First of all just thanks a lot to all OpenSSL developers for this
library.

And I'd like to discuss about handling of broken pipe signal while
using OpenSSL on linux systems.
It is obvious that this signal is very probable to get and in safe and
user friendly application we must to handle it properly otherwise
application will be terminated by default SIG_PIPE handler.
We have two ways to handle this signal. Install global signal handler
or pass MSG_NOSIGNAL flag to send() function.
Looks like OpenSSL allows us to use only first way - install global
signal handler. But it is not good solution because this handler is
global for process. For instance if we developing some library that
uses OpenSSL deep internally and actually user needn't know anything
about possible broken pipe signals. So our library is forced to
install its global signal handler (or may be just SIG_IGN) to make
user life easily.
Let now user application decided to install SIG_DFL for SIG_PIPE for
some reason. As a result of it user will be very surprised getting
broken pipe signal on our library function call. It is wrong and it is
encapsulation violation.
Good solution for us is to pass MSG_NOSIGNAL flag and broken pipe
signals will be ignored locally. But OpenSSL doesn't support any flag
passing to recv/send functions.

Possible solution is to patch e_os.h and add MSG_NOSIGNAL flag to
appropriate #define.
May be you can suggest more elegant solution?

-- 
Best regards,
Dmitriy Sergeyev
C++ Developer of
ISS Art, Ltd., Omsk, Russia.
http://issart.com
http://issart.com/index/Portfolio/cpp&lang=eng
mailto:[EMAIL PROTECTED]

______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
Development Mailing List                       openssl-dev@openssl.org
Automated List Manager                           [EMAIL PROTECTED]

Reply via email to