diff options
author | Yorhel <git@yorhel.nl> | 2015-09-08 19:10:25 +0200 |
---|---|---|
committer | Yorhel <git@yorhel.nl> | 2015-09-08 19:10:25 +0200 |
commit | 108c2a8000d1e525c18a4deb3b5412639bda1e3c (patch) | |
tree | ba82091c709510978389e88b1d0b7f726f00ce75 /lib/Multi/API.pm | |
parent | b6dfef70febffc69ab141ae5e16a8a950ac2ed1c (diff) |
Multi::API: Set keepalive on sockets to detect dead TCP connections
Hopefully prevents issues like https://vndb.org/t3599.53
Diffstat (limited to 'lib/Multi/API.pm')
-rw-r--r-- | lib/Multi/API.pm | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/Multi/API.pm b/lib/Multi/API.pm index cce366d1..d6034160 100644 --- a/lib/Multi/API.pm +++ b/lib/Multi/API.pm @@ -93,6 +93,7 @@ sub newconn { rbuf_max => 50*1024, # Commands aren't very huge, a 50k read buffer should suffice. wbuf_max => 5*1024*1024, fh => $c->{fh}, + keepalive=> 1, on_error => sub { writelog $c, 'IO error: %s', $_[2]; $c->{h}->destroy; |