* Copyright (c) 1995-2002, Index Data
* See the file LICENSE for details.
*
- * $Id: tcpip.c,v 1.45 2002-01-21 21:50:32 adam Exp $
+ * $Id: tcpip.c,v 1.46 2002-02-19 20:02:40 adam Exp $
*/
#include <stdio.h>
#endif
#include <errno.h>
#include <fcntl.h>
+#include <signal.h>
#if HAVE_OPENSSL_SSL_H
#include <openssl/ssl.h>
#include <openssl/err.h>
#ifdef WIN32
if (!(p->blocking = blocking) && ioctlsocket(s, FIONBIO, &tru) < 0)
+ return 0;
#else
- if (!(p->blocking = blocking) && fcntl(s, F_SETFL, O_NONBLOCK) < 0)
+ if (!(p->blocking = blocking))
+ {
+ if (fcntl(s, F_SETFL, O_NONBLOCK) < 0)
+ return 0;
+#ifndef MSG_NOSIGNAL
+ signal (SIGPIPE, SIG_IGN);
+#endif
+ }
#endif
- return 0;
p->io_pending = 0;
p->iofile = s;