about summary refs log tree commit homepage
path: root/t/httpd-corner.t
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2019-11-14 06:41:12 +0000
committerEric Wong <e@80x24.org>2019-11-15 01:09:11 +0000
commit6c2be548847c911c7db7a97118377909bb9ba404 (patch)
tree7308082a256314523fc1b0bad0b71b930baceb9e /t/httpd-corner.t
parent4941f43f0fcac72ba663bc96abef19fe913becd4 (diff)
downloadpublic-inbox-6c2be548847c911c7db7a97118377909bb9ba404.tar.gz
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.
Diffstat (limited to 't/httpd-corner.t')
-rw-r--r--t/httpd-corner.t10
1 files changed, 10 insertions, 0 deletions
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');