http_server: improve handling of client-triggerable socket errors
commit24b9f66dcdda44378b4053645333ce9ce336b413
authorEric Wong <normalperson@yhbt.net>
Sat, 17 Aug 2013 01:09:46 +0000 (17 01:09 +0000)
committerEric Wong <normalperson@yhbt.net>
Sat, 17 Aug 2013 01:09:46 +0000 (17 01:09 +0000)
tree735325b7b820e9476296016cd8ec3bdfc20db301
parent2f5174d4ca9764313d6be4c092e9e6c2e4f9d1e1
http_server: improve handling of client-triggerable socket errors

We do not attempt to write HTTP responses for socket errors if
clients disconnect from us unexpectedly.

Additionally, we do not hide backtraces EINVAL/EBADF errors, since
they are indicative of real bugs which must be fixed.

We do continue to hide hide EOF, ECONNRESET, ENOTCONN, and EPIPE
because clients (even "friendly") ones will break connections due to
client crashes or network failure (which is common for me :P), and
the backtraces from those will cause excessive logging and even
become a DoS vector.
lib/unicorn/http_server.rb