Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
M
mongoose
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
esp
mongoose
Commits
3cd16d72
Commit
3cd16d72
authored
Nov 12, 2010
by
valenok
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
test for immediate CGI output forward
parent
da21192b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
3 deletions
+13
-3
test.pl
test/test.pl
+13
-3
No files found.
test/test.pl
View file @
3cd16d72
...
@@ -50,7 +50,7 @@ sub get_num_of_log_entries {
...
@@ -50,7 +50,7 @@ sub get_num_of_log_entries {
# Send the request to the 127.0.0.1:$port and return the reply
# Send the request to the 127.0.0.1:$port and return the reply
sub
req
{
sub
req
{
my
(
$request
,
$inc
)
=
@_
;
my
(
$request
,
$inc
,
$timeout
)
=
@_
;
my
$sock
=
IO::Socket::
INET
->
new
(
Proto
=>
"tcp"
,
my
$sock
=
IO::Socket::
INET
->
new
(
Proto
=>
"tcp"
,
PeerAddr
=>
'127.0.0.1'
,
PeerPort
=>
$port
);
PeerAddr
=>
'127.0.0.1'
,
PeerPort
=>
$port
);
fail
(
"Cannot connect: $!"
)
unless
$sock
;
fail
(
"Cannot connect: $!"
)
unless
$sock
;
...
@@ -59,8 +59,14 @@ sub req {
...
@@ -59,8 +59,14 @@ sub req {
last
unless
print
$sock
$byte
;
last
unless
print
$sock
$byte
;
select
undef
,
undef
,
undef
,
.001
if
length
(
$request
)
<
256
;
select
undef
,
undef
,
undef
,
.001
if
length
(
$request
)
<
256
;
}
}
my
@lines
=
<
$sock
>
;
my
$out
=
''
;
my
$out
=
join
''
,
@lines
;
eval
{
alarm
$timeout
if
$timeout
;
foreach
(
<
$sock
>
)
{
$out
.=
$_
;
}
alarm
0
;
};
close
$sock
;
close
$sock
;
$num_requests
+=
defined
(
$inc
)
?
$inc
:
1
;
$num_requests
+=
defined
(
$inc
)
?
$inc
:
1
;
...
@@ -129,6 +135,7 @@ sub kill_spawned_child {
...
@@ -129,6 +135,7 @@ sub kill_spawned_child {
unlink
@files_to_delete
;
unlink
@files_to_delete
;
$SIG
{
PIPE
}
=
'IGNORE'
;
$SIG
{
PIPE
}
=
'IGNORE'
;
$SIG
{
ALRM
}
=
sub
{
die
"timeout\n"
};
#local $| =1;
#local $| =1;
# Make sure we export only symbols that start with "mg_", and keep local
# Make sure we export only symbols that start with "mg_", and keep local
...
@@ -218,6 +225,9 @@ o("GET /ta/x/ HTTP/1.0\n\n", "SCRIPT_NAME=/ta/x/index.cgi",
...
@@ -218,6 +225,9 @@ o("GET /ta/x/ HTTP/1.0\n\n", "SCRIPT_NAME=/ta/x/index.cgi",
# 'HTTP/1.1 200.+keep-alive.+HTTP/1.1 200.+close',
# 'HTTP/1.1 200.+keep-alive.+HTTP/1.1 200.+close',
# 'Request pipelining', 2);
# 'Request pipelining', 2);
fail
(
'Slow CGI output forward '
)
unless
req
(
"GET /timeout.cgi HTTP/1.0\r\n\r\n"
,
1
,
1
)
=~
/Some data/gs
;
my
$mime_types
=
{
my
$mime_types
=
{
html
=>
'text/html'
,
html
=>
'text/html'
,
htm
=>
'text/html'
,
htm
=>
'text/html'
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment