Commit 8f65643
committed
ignore SIGPIPE so a closed peer can't kill the process
A write to a socket whose peer has closed or reset raises SIGPIPE, which by
default terminates the process rather than returning EPIPE. Ignore it at load
via a constructor in common.h (included by every socket module), so send/write
report the error through the normal return path. The loopback tests don't trip
this, so a test-running CI alone would not catch it; this fixes the bug
directly. (The tls library, which mirrors this code, had the same gap.)1 parent f6db7f1 commit 8f65643
1 file changed
Lines changed: 9 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
10 | 11 | | |
11 | 12 | | |
12 | 13 | | |
13 | 14 | | |
14 | 15 | | |
15 | 16 | | |
16 | 17 | | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
17 | 26 | | |
18 | 27 | | |
19 | 28 | | |
| |||
0 commit comments