From: wessels <> Date: Thu, 13 Aug 1998 22:52:25 +0000 (+0000) Subject: NULL terminate the URL X-Git-Tag: SQUID_3_0_PRE1~2911 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=36f42e091ec4360769a86278db45683b3b9c6ee7;p=thirdparty%2Fsquid.git NULL terminate the URL --- diff --git a/scripts/icp-test.pl b/scripts/icp-test.pl index fb36455ba9..73abe9cfd1 100755 --- a/scripts/icp-test.pl +++ b/scripts/icp-test.pl @@ -71,11 +71,21 @@ while ($ARGV[0] =~ /([^:]+):(\d+)/) { shift; } +$rn = 0; while (<>) { print; chop; - $request_template = 'CCnx4Nx4x4a4a' . length; - $request = pack($request_template, 1, 2, 24 + length, $flags, $myip, $_); + $len = length($_) + 1; + $request_template = sprintf 'CCnNNa4a4x4a%d', $len; + $request = pack($request_template, + 1, # C opcode + 2, # C version + 24 + $len, # n length + ++$rn, # N reqnum + $flags, # N flags + '', # a4 pad + $myip, # a4 shostid + $_); # a%d payload $n = 0; foreach $host (keys %ADDR) { $port = $PORT{$host};