From 6c2be548847c911c7db7a97118377909bb9ba404 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Thu, 14 Nov 2019 06:41:12 +0000 Subject: t/common: move unix_server to t/httpd-corner.t unix_server() is not commonly used, only t/httpd-corner.t uses it and most HTTP tests use TCP since most HTTP libraries only support TCP. --- t/common.perl | 10 ---------- t/httpd-corner.t | 10 ++++++++++ 2 files changed, 10 insertions(+), 10 deletions(-) (limited to 't') diff --git a/t/common.perl b/t/common.perl index 053a935a..d4a0fcd2 100644 --- a/t/common.perl +++ b/t/common.perl @@ -18,16 +18,6 @@ sub tcp_server () { ) } -sub unix_server ($) { - my $s = IO::Socket::UNIX->new( - Listen => 1024, - Type => Socket::SOCK_STREAM(), - Local => $_[0], - ); - $s->blocking(0); - $s; -} - sub tcp_connect { my ($dest, %opt) = @_; my $s = IO::Socket::INET->new( diff --git a/t/httpd-corner.t b/t/httpd-corner.t index 75573c3e..b063d9fa 100644 --- a/t/httpd-corner.t +++ b/t/httpd-corner.t @@ -51,6 +51,16 @@ if ($^O eq 'linux') { setsockopt($sock, SOL_SOCKET, $var, $accf_arg) or die "setsockopt: $!"; } +sub unix_server ($) { + my $s = IO::Socket::UNIX->new( + Listen => 1024, + Type => Socket::SOCK_STREAM(), + Local => $_[0], + ); + $s->blocking(0); + $s; +} + my $upath = "$tmpdir/s"; my $unix = unix_server($upath); ok($unix, 'UNIX socket created'); -- cgit v1.2.3-24-ge0c7