X-Git-Url: https://bearssl.org/gitweb//home/git/?p=BearSSL;a=blobdiff_plain;f=samples%2Fclient_basic.c;h=1609f43f2d8d33b3b3d2d9ffc03d9263f05ddf4c;hp=d4f79fb752d5bfdb3dbc168b4d9469db11a91b7c;hb=292f43357850dbadd1f7e8a343415a707af3a800;hpb=3210f38e0491b39aec1ef419cb4114e9483089fb diff --git a/samples/client_basic.c b/samples/client_basic.c index d4f79fb..1609f43 100644 --- a/samples/client_basic.c +++ b/samples/client_basic.c @@ -27,6 +27,7 @@ #include #include #include +#include #include #include @@ -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. */