diff options
Diffstat (limited to 'test/functional/cases/http_streamline.pl')
-rw-r--r-- | test/functional/cases/http_streamline.pl | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/test/functional/cases/http_streamline.pl b/test/functional/cases/http_streamline.pl new file mode 100644 index 000000000..e5afc5aff --- /dev/null +++ b/test/functional/cases/http_streamline.pl @@ -0,0 +1,35 @@ +#!/usr/bin/env perl + +use warnings; +use strict; + +use Socket; + +my $host = "127.0.0.1"; +my $port = 56789; +my $input = shift; + +open(INPUT, "< $input") or die "Can't open input file $input\n"; + +socket(SOCKET,PF_INET,SOCK_STREAM,(getprotobyname('tcp'))[2]) + or die "Can't create a socket $!\n"; +connect(SOCKET, pack_sockaddr_in($port, inet_aton($host))) + or die "Can't connect to port $port! \n"; + +print SOCKET "POST /symbols HTTP/1.0\r\n\r\n"; + +while (my $line = <INPUT>) { + print SOCKET $line; +} + +SOCKET->autoflush(1); + +shutdown(SOCKET, 1); + +close(INPUT); + +while (my $line = <SOCKET>) { + print $line; +} + +close(SOCKET); |