You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by ji...@apache.org on 2014/12/02 17:39:13 UTC
svn commit: r1642939 - in /httpd/test/framework/trunk/scripts: ./ uds-test.pl
Author: jim
Date: Tue Dec 2 16:39:12 2014
New Revision: 1642939
URL: http://svn.apache.org/r1642939
Log:
Simple UDS test script (in perl)
Added:
httpd/test/framework/trunk/scripts/
httpd/test/framework/trunk/scripts/uds-test.pl (with props)
Added: httpd/test/framework/trunk/scripts/uds-test.pl
URL: http://svn.apache.org/viewvc/httpd/test/framework/trunk/scripts/uds-test.pl?rev=1642939&view=auto
==============================================================================
--- httpd/test/framework/trunk/scripts/uds-test.pl (added)
+++ httpd/test/framework/trunk/scripts/uds-test.pl Tue Dec 2 16:39:12 2014
@@ -0,0 +1,17 @@
+#!/usr/bin/env perl
+use Socket;
+use strict;
+
+my $socket_path = '/tmp/test-ptf.sock';
+my $sock_addr = sockaddr_un($socket_path);
+socket(my $server, PF_UNIX, SOCK_STREAM, 0) || die "socket: $!";
+unlink($socket_path);
+bind($server, $sock_addr) || die "bind: $!";
+listen($server,1024) || die "listen: $!";
+while (accept(my $new_sock, $server)) {
+ my $data = <$new_sock>;
+ print $new_sock "HTTP/1.0 200 OK\r\n";
+ print $new_sock "Content-Type: text/html\r\n\r\n";
+ print $new_sock "<html><body><h1>Hello World</h1><pre>$data</pre></body></html>\n";
+ close $new_sock;
+}
\ No newline at end of file
Propchange: httpd/test/framework/trunk/scripts/uds-test.pl
------------------------------------------------------------------------------
svn:executable = *