--- deliantra/server/ext/tcp.ext 2012/10/30 17:32:47 1.22 +++ deliantra/server/ext/tcp.ext 2012/11/05 23:24:02 1.24 @@ -9,10 +9,23 @@ CONF BIND_ADDRESSES = [[undef, 13327]]; -our $MAX_DETECT = 16; # how many bytes to raed to identify the protocol +our $MAX_DETECT = 32; # how many bytes to read to identify the protocol our @LISTENERS; +sub flash_policy_server { + my ($fh) = @_; + + # socket policy file, just write answer and hope the kernel accepts it in one go + syswrite $fh, < + + + + +EOF +} + for (@$BIND_ADDRESSES) { my ($host, $port) = @$_; cf::info "listening on ", (format_hostport $host, $port), "\n"; @@ -45,6 +58,11 @@ &ext::http::server ($id, $fh, $buf); + } elsif ($buf =~ /^\x00/) { + undef $w; + + flash_policy_server $fh; + } elsif (length $buf >= $MAX_DETECT) { # unable to detect protocol undef $w;