Search squid archive

Re: using request_body_max_size inside an acl (second time post)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



ankush grover wrote:


Should work, but you may want to tune the script to also handle "no
content-length"... (should dump warnings in your cache.log in the
current design)..


hey  Mr. Henrik,

Thanks for the reply. Can you tell me how to handle "no
content-length" the script I am using is below for content-length is
below

the request_body_max_size script for content-length

#!/bin/sh
while read line; do
 set -- $line
 length="$1"
 limit="$2"
 if [ "$length" -le "$2" ]; then

Change the above line to...

if [ -n "$length" ] && [ "$length" -le "$2" ]; then

... as this will check to make sure $length is defined. Given the context of its usage, this should be sufficient error checking. If you wish to allow requests without a content-length, use...

if [ -z "$length" ] || [ "$length" -le "$2" ]; then

...instead.

    echo OK
 else
    echo ERR
 fi
done

The warning in cache.log is below

/etc/squid/request.sh: line 6: [: -: integer expression expected

Thanks & Regards

Ankush Grover

Chris


[Index of Archives]     [Linux Audio Users]     [Samba]     [Big List of Linux Books]     [Linux USB]     [Yosemite News]

  Powered by Linux