diff options
author | Alexander Sulfrian <alex@spline.inf.fu-berlin.de> | 2015-10-28 21:27:16 +0100 |
---|---|---|
committer | Spamd Stats <spamd-stats@vm-mail.spline.inf.fu-berlin.de> | 2015-10-28 21:27:16 +0100 |
commit | 0fa4381419fcc88addbdf2e023c0f136c5fe195b (patch) | |
tree | 04688c37b5d22137d089ef2ebf278aa26fde2154 | |
parent | 1805b2baa46bdbc68717432fdf24594ad7c72ffd (diff) | |
download | spamd-stats-0fa4381419fcc88addbdf2e023c0f136c5fe195b.tar.gz spamd-stats-0fa4381419fcc88addbdf2e023c0f136c5fe195b.tar.bz2 spamd-stats-0fa4381419fcc88addbdf2e023c0f136c5fe195b.zip |
server: Do not close socket before sending
-rwxr-xr-x | server.pl | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -53,8 +53,11 @@ tcp_server 'unix/', $stats_socket, sub { $h->push_write(Storable::freeze($stats) . "\n"); $stats = { ham => 0, spam => 0, block => 0 }; - $h->destroy; - undef $h; + + $h->on_drain (sub { + $h->destroy; + undef $h; + }); }; AnyEvent->condvar->recv; |