diff options
| author | Luke Kanies <luke@madstop.com> | 2008-03-21 00:39:26 -0500 |
|---|---|---|
| committer | Luke Kanies <luke@madstop.com> | 2008-03-21 00:39:26 -0500 |
| commit | 18320b8e3271f7d1d1702907be1ff420acfc8d2b (patch) | |
| tree | 159cde5158579fc3b0ae6e502c25b32752d7561c /lib/puppet/network/http | |
| parent | f6325dceb3b10c300f421f540281bbd64bdc091e (diff) | |
| download | puppet-18320b8e3271f7d1d1702907be1ff420acfc8d2b.tar.gz puppet-18320b8e3271f7d1d1702907be1ff420acfc8d2b.tar.xz puppet-18320b8e3271f7d1d1702907be1ff420acfc8d2b.zip | |
Found all instances of methods where split() is used without
any local variables and added a local variable -- see
http://snurl.com/21zf8. My own testing showed that this
caused memory growth to level off at a reasonable level.
Note that the link above says the problem is only with class
methods, but my own testing showed that it's any method that
meets these criteria. This is not a functional change, but
should hopefully be the last nail in the coffin of #1131.
Diffstat (limited to 'lib/puppet/network/http')
| -rw-r--r-- | lib/puppet/network/http/mongrel/rest.rb | 6 | ||||
| -rw-r--r-- | lib/puppet/network/http/webrick/rest.rb | 8 |
2 files changed, 9 insertions, 5 deletions
diff --git a/lib/puppet/network/http/mongrel/rest.rb b/lib/puppet/network/http/mongrel/rest.rb index db63613ab..6c24e360c 100644 --- a/lib/puppet/network/http/mongrel/rest.rb +++ b/lib/puppet/network/http/mongrel/rest.rb @@ -14,11 +14,13 @@ class Puppet::Network::HTTP::MongrelREST < Puppet::Network::HTTP::Handler end def path(request) - '/' + request.params[Mongrel::Const::REQUEST_PATH].split('/')[1] + # LAK:NOTE See http://snurl.com/21zf8 [groups_google_com] + x = '/' + request.params[Mongrel::Const::REQUEST_PATH].split('/')[1] end def request_key(request) - request.params[Mongrel::Const::REQUEST_PATH].split('/')[2] + # LAK:NOTE See http://snurl.com/21zf8 [groups_google_com] + x = request.params[Mongrel::Const::REQUEST_PATH].split('/')[2] end def body(request) diff --git a/lib/puppet/network/http/webrick/rest.rb b/lib/puppet/network/http/webrick/rest.rb index dd0c84d61..8cda079e2 100644 --- a/lib/puppet/network/http/webrick/rest.rb +++ b/lib/puppet/network/http/webrick/rest.rb @@ -19,11 +19,13 @@ class Puppet::Network::HTTP::WEBrickREST < Puppet::Network::HTTP::Handler end def path(request) - '/' + request.path.split('/')[1] + # LAK:NOTE See http://snurl.com/21zf8 [groups_google_com] + x = '/' + request.path.split('/')[1] end def request_key(request) - request.path.split('/')[2] + # LAK:NOTE See http://snurl.com/21zf8 [groups_google_com] + x = request.path.split('/')[2] end def body(request) @@ -38,4 +40,4 @@ class Puppet::Network::HTTP::WEBrickREST < Puppet::Network::HTTP::Handler response.status = status response.body = result end -end
\ No newline at end of file +end |
