Squid - [squid-users] request_body_max_size ?

This is Interesting: Free IT Magazines  
Home > Archive > Squid > April 2004 > [squid-users] request_body_max_size ?





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author [squid-users] request_body_max_size ?
Michael Gale

2004-04-29, 6:54 pm

Hello,

Can I use "request_body_max_size" inside a acl ?

For example:

acl allowuploads src 10.10.1.3/255.255.255.255
http_access allow allowuploads AND request_body_max_size 20480 KB

then further download just have

request_body_max_size 100 KB

Thanks --- I hope I explained it well enough.

--
Michael Gale
Network Administrator
Utilitran Corporation
Henrik Nordstrom

2004-04-29, 6:54 pm

On Mon, 26 Apr 2004, Michael Gale wrote:

> Can I use "request_body_max_size" inside a acl ?


There only is one single limit in this directive.

But it is possible to invent a new acl for this using the external acl
interface. request_body_max_size looks into the Content-Length request
header, available to external_acl_type as %{Content-Length}


This silly shell script should work

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


Use this as

external_acl_type request_body %{Content-Length} /path/to/above/script

acl request_max_20MB request_body 20971520


This acl can then be used in http_access to match requests up to the given
size. If you need different sizes just define new acls with different
limits in bytes (20971520 == 20480 * 1024 == 20480 KB)

Regards
Henrik


Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com