On Fri, 2009-10-23 at 10:24 +0200, David Schmitt wrote:
> Brice Figureau wrote:
> > This is not the right fix, but more a hackish workaround.
> > 
> > Since 0.25, the facts are transmitted as GET parameters when a
> > node asks for a catalog. Most proxies or webserver have a size limit
> > which is sometimes reached. In this case the request is denied
> > and the node can't get its catalog.
> > 
> > The idea is to compress facts (some non-scientific studies show a
> > 57% fact size decrease for an average node) when transmitting
> > those when asking for a catalog.
> > 
> > Signed-off-by: Brice Figureau <[email protected]>
> > ---
> >  lib/puppet/configurer/fact_handler.rb |    4 +-
> >  lib/puppet/network/formats.rb         |   50 +++++++++++++++++++
> >  spec/unit/configurer/fact_handler.rb  |    6 +-
> >  spec/unit/network/formats.rb          |   85 
> > +++++++++++++++++++++++++++++++++
> >  4 files changed, 140 insertions(+), 5 deletions(-)
> > 
> > diff --git a/lib/puppet/configurer/fact_handler.rb 
> > b/lib/puppet/configurer/fact_handler.rb
> > index 43e9f35..8e0fef7 100644
> > --- a/lib/puppet/configurer/fact_handler.rb
> > +++ b/lib/puppet/configurer/fact_handler.rb
> > @@ -29,11 +29,11 @@ module Puppet::Configurer::FactHandler
> >          #format = facts.class.default_format
> >  
> >          # Hard-code yaml, because I couldn't get marshal to work.
> > -        format = :yaml
> > +        format = :b64_zlib_yaml
> >  
> >          text = facts.render(format)
> >  
> > -        return {:facts_format => format, :facts => CGI.escape(text)}
> > +        return {:facts_format => :b64_zlib_yaml, :facts => 
> > CGI.escape(text)}
> 
> The :facts don't need CGI.escape, don't they?

They need it because base64 can generate a '+' character which in an URL
will be transformed as a ' '. So we still escape those.

I could have used the url safe base64 variant[1], but it meant more
touched files, and there is no direct support in ruby.

[1] http://www.ietf.org/rfc/rfc3548.txt
-- 
Brice Figureau
Follow the latest Puppet Community evolutions on www.planetpuppet.org!


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Puppet Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/puppet-dev?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to