Author: zwoop
Date: Mon May 16 19:30:43 2011
New Revision: 1103852
URL: http://svn.apache.org/viewvc?rev=1103852&view=rev
Log:
Make set smarter, fix forward_proxy.pl to work
Modified:
trafficserver/traffic/trunk/contrib/perl/ConfigMgmt/examples/forward_proxy.pl
trafficserver/traffic/trunk/contrib/perl/ConfigMgmt/lib/Apache/TS/Config/Records.pm
Modified:
trafficserver/traffic/trunk/contrib/perl/ConfigMgmt/examples/forward_proxy.pl
URL:
http://svn.apache.org/viewvc/trafficserver/traffic/trunk/contrib/perl/ConfigMgmt/examples/forward_proxy.pl?rev=1103852&r1=1103851&r2=1103852&view=diff
==============================================================================
---
trafficserver/traffic/trunk/contrib/perl/ConfigMgmt/examples/forward_proxy.pl
(original)
+++
trafficserver/traffic/trunk/contrib/perl/ConfigMgmt/examples/forward_proxy.pl
Mon May 16 19:30:43 2011
@@ -1,3 +1,4 @@
+#!/usr/bin/perl
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
@@ -26,9 +27,15 @@ my $recedit = new Apache::TS::Config::Re
# Definitely tweak the memory config
$recedit->set(conf => "proxy.config.cache.ram_cache.size", val => "2048M");
+
# These puts the server in forward proxy mode only.
-$recedit->set(conf => "proxy.config.url_remap.remap_required", val => "1");
+$recedit->set(conf => "proxy.config.url_remap.remap_required", val => "0");
$recedit->set(conf => "proxy.config.reverse_proxy.enabled", val => "0");
+# Fine tuning, you might or might not want these
+$recedit->set(conf => "proxy.config.http.transaction_active_timeout_in", val
=> "1800");
+$recedit->set(conf => "proxy.config.dns.dedicated_thread", val => "1");
+$recedit->set(conf => "proxy.config.http.normalize_ae_gzip", val => "1");
+
# Write out the new config file (this won't overwrite your config
$recedit->write(file => "$fn.new");
Modified:
trafficserver/traffic/trunk/contrib/perl/ConfigMgmt/lib/Apache/TS/Config/Records.pm
URL:
http://svn.apache.org/viewvc/trafficserver/traffic/trunk/contrib/perl/ConfigMgmt/lib/Apache/TS/Config/Records.pm?rev=1103852&r1=1103851&r2=1103852&view=diff
==============================================================================
---
trafficserver/traffic/trunk/contrib/perl/ConfigMgmt/lib/Apache/TS/Config/Records.pm
(original)
+++
trafficserver/traffic/trunk/contrib/perl/ConfigMgmt/lib/Apache/TS/Config/Records.pm
Mon May 16 19:30:43 2011
@@ -142,14 +142,16 @@ sub set {
my $ix = $self->{_lookup}->{$c};
if (!defined($ix)) {
- print "Error: set(): No such configuration exists: $c\n";
- return;
- }
+ my $type = $args{type};
- my $val = $self->{_configs}->[$ix];
+ $type = "INT" unless defined($type);
+ $self->append(line => "CONFIG $c $type $v");
+ } else {
+ my $val = $self->{_configs}->[$ix];
- @{$val->[1]}[3] = $v;
- $val->[2] = TS_CONF_MODIFIED;
+ @{$val->[1]}[3] = $v;
+ $val->[2] = TS_CONF_MODIFIED;
+ }
}