From: bluhm Date: Sun, 14 Jan 2018 00:53:11 +0000 (+0000) Subject: Unlocking the TCP stack resulted in smaller TCP segments sent out X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=4f38abc25edad4a17bdca009c30daca81ae35c32;p=openbsd Unlocking the TCP stack resulted in smaller TCP segments sent out early on some machines. Use the TCP_NOPUSH socket option to get reliable regress results and syslogd(8) debug messages for grep. --- diff --git a/regress/usr.sbin/syslogd/args-client-tcp-octet-maxline.pl b/regress/usr.sbin/syslogd/args-client-tcp-octet-maxline.pl index 584733a1a59..b18dcbffbde 100644 --- a/regress/usr.sbin/syslogd/args-client-tcp-octet-maxline.pl +++ b/regress/usr.sbin/syslogd/args-client-tcp-octet-maxline.pl @@ -8,7 +8,7 @@ use strict; use warnings; -use Socket; +use Socket qw(AF_INET IPPROTO_TCP TCP_NOPUSH); use constant MAXLINE => 8192; use constant MAX_UDPMSG => 1180; @@ -24,11 +24,15 @@ our %args = ( print STDERR "<<< $msg\n"; ${$self->{syslogd}}->loggrep(qr/tcp logger .* use \d+ bytes/, 5) or die ref($self), " syslogd did not use bytes"; + setsockopt(\*STDOUT, IPPROTO_TCP, TCP_NOPUSH, pack('i', 1)) + or die ref($self), " set TCP_NOPUSH failed: $!"; $msg = generate_chars(MAXLINE); printf "%05d %s", MAXLINE+1, $msg; print STDERR "<<< $msg\n"; + setsockopt(\*STDOUT, IPPROTO_TCP, TCP_NOPUSH, pack('i', 0)) + or die ref($self), " clear TCP_NOPUSH failed: $!"; ${$self->{syslogd}}->loggrep("tcp logger .* incomplete", 5) - or die ref($self), " syslogd did not receive 2 incomplete"; + or die ref($self), " syslogd did not receive incomplete"; print "\n"; print STDERR "<<< \n"; write_shutdown($self);