… | |
… | |
8 | use IO::Socket::INET; |
8 | use IO::Socket::INET; |
9 | |
9 | |
10 | our $LISTEN = new IO::Socket::INET |
10 | our $LISTEN = new IO::Socket::INET |
11 | LocalPort => cf::settings->csport, |
11 | LocalPort => cf::settings->csport, |
12 | Listen => 1, |
12 | Listen => 1, |
13 | Blocking => 0, # bugfix workaround for Event calling handler twice :( |
13 | Blocking => 0, |
14 | ReuseAddr => 1; |
14 | ReuseAddr => 1; |
15 | |
15 | |
16 | if (!$LISTEN) { |
16 | if (!$LISTEN) { |
17 | # extension yes, completely stupid, not yet |
17 | # extension yes, completely stupid, not yet |
18 | warn "unable to establish listen socket, exiting.\n"; |
18 | warn "unable to establish listen socket, exiting.\n"; |
… | |
… | |
26 | my $fd = fileno $fh; |
26 | my $fd = fileno $fh; |
27 | my $host = inet_ntoa +(sockaddr_in $peername)[1]; |
27 | my $host = inet_ntoa +(sockaddr_in $peername)[1]; |
28 | |
28 | |
29 | warn "new connection from $host\n"; |
29 | warn "new connection from $host\n"; |
30 | |
30 | |
|
|
31 | # HACK to avoid blocking on common files on log-in. |
|
|
32 | # remove once async |
|
|
33 | cf::async {#d# |
|
|
34 | warn "HACK: $cf::CONFDIR/$_", Coro::AIO::aio_load "$cf::CONFDIR/$_", my $dummy for qw(rules news motd);#d# |
|
|
35 | warn "HACK: $cf::VARDIR/crossfiremail", Coro::AIO::aio_load "$cf::VARDIR/crossfiremail", my $dummy;#d# |
31 | cf::client::create $fd, $host; |
36 | cf::client::create $fd, $host; |
|
|
37 | undef $fh;#d# |
|
|
38 | };#d#d |
32 | }; |
39 | }; |
33 | |
40 | |