libfetch: Avoid SIGPIPE on network connections
authorJohn Marino <draco@marino.st>
Fri, 2 Nov 2012 00:26:34 +0000 (01:26 +0100)
committerJohn Marino <draco@marino.st>
Fri, 2 Nov 2012 00:31:45 +0000 (01:31 +0100)
commit14c24f74315ca3fb26eaf73089bbc97e0c0e50fa
tree0e194d606642a119c468bde1e440d6d9086a8065
parent89233cfd97300c5309bc96594ef1b873b24d60c2
libfetch: Avoid SIGPIPE on network connections

To avoid unexpected process termination from SIGPIPE when writing to a
closed network connection, enable SO_NOSIGPIPE on all network connections.

The POSIX standard MSG_NOSIGNAL is not used since it requires modifying all
send calls to add this flag. This is particularly nasty for SSL connections.

Taken-from: FreeBSD SVN 236193 (28 May 2012)
lib/libfetch/common.c