More API documentation in Doxygen format (block ciphers, PEM).
[BearSSL] / samples / client_basic.c
index d4f79fb..1609f43 100644 (file)
@@ -27,6 +27,7 @@
 #include <string.h>
 #include <stdint.h>
 #include <errno.h>
+#include <signal.h>
 
 #include <sys/types.h>
 #include <sys/socket.h>
@@ -260,6 +261,11 @@ main(int argc, char *argv[])
                path = "/";
        }
 
+       /*
+        * Ignore SIGPIPE to avoid crashing in case of abrupt socket close.
+        */
+       signal(SIGPIPE, SIG_IGN);
+
        /*
         * Open the socket to the target server.
         */