summaryrefslogtreecommitdiff
path: root/tests/LightyTest.pm
diff options
context:
space:
mode:
authorGlenn Strauss <gstrauss@gluelogic.com>2023-01-02 09:27:28 -0500
committerGlenn Strauss <gstrauss@gluelogic.com>2023-01-02 09:27:28 -0500
commit208b04c290eae89d2a2ac7444700f92aaf4580b4 (patch)
treef8f9f0052a80fdb0ba978072a7c1c4bf48796596 /tests/LightyTest.pm
parent3fded622b365769053b57b0dc21c30057bce47e2 (diff)
downloadlighttpd-git-208b04c290eae89d2a2ac7444700f92aaf4580b4.tar.gz
[tests] disable Nagle on client, remove sleeps
disable Nagle on client, remove sleeps for tests marked for slow CRLF
Diffstat (limited to 'tests/LightyTest.pm')
-rw-r--r--tests/LightyTest.pm42
1 files changed, 16 insertions, 26 deletions
diff --git a/tests/LightyTest.pm b/tests/LightyTest.pm
index 6415413f..6d7e9a47 100644
--- a/tests/LightyTest.pm
+++ b/tests/LightyTest.pm
@@ -274,40 +274,30 @@ sub handle_http {
}
$remote->autoflush(1);
-
- if (!$slow) {
- diag("\nsending request header to ".$host.":".$self->{PORT}) if $is_debug;
- foreach(@request) {
- # pipeline requests
- s/\r//g;
- s/\n/$EOL/g;
-
- print $remote $_.$BLANK;
- diag("\n<< ".$_) if $is_debug;
+ my $ipproto_tcp = defined &Socket::IPPROTO_TCP ? Socket::IPPROTO_TCP : 6;
+ my $tcp_nodelay = defined &Socket::TCP_NODELAY ? Socket::TCP_NODELAY : 1;
+ $remote->setsockopt($ipproto_tcp, $tcp_nodelay, 1); # (ignore rc)
+
+ diag("\nsending request header to ".$host.":".$self->{PORT}) if $is_debug;
+ foreach(@request) {
+ # pipeline requests
+ chomp;
+ s/\r//g;
+ s/\n/$EOL/g;
+
+ diag("<< ".$_."\n") if $is_debug;
+ if (!$slow) {
+ print $remote $_,$BLANK;
}
- shutdown($remote, 1) if ($^O ne "openbsd" && $^O ne "dragonfly"); # I've stopped writing data
- } else {
- diag("\nsending request header to ".$host.":".$self->{PORT}) if $is_debug;
- foreach(@request) {
- # pipeline requests
- chomp;
- s/\r//g;
- s/\n/$EOL/g;
-
+ else {
print $remote $_;
- diag("<< ".$_."\n") if $is_debug;
- select(undef, undef, undef, 0.0001);
print $remote "\015";
- select(undef, undef, undef, 0.0001);
print $remote "\012";
- select(undef, undef, undef, 0.0001);
print $remote "\015";
- select(undef, undef, undef, 0.0001);
print $remote "\012";
- select(undef, undef, undef, 0.0001);
}
-
}
+ shutdown($remote, 1) if ($^O ne "openbsd" && $^O ne "dragonfly"); # I've stopped writing data
diag("\n... done") if $is_debug;
my $lines = "";