diff options
| author | Daniel Pittman <daniel@rimspace.net> | 2011-02-22 14:18:57 -0800 |
|---|---|---|
| committer | Daniel Pittman <daniel@rimspace.net> | 2011-02-22 14:43:43 -0800 |
| commit | 0e9858f19d9d2e021a9d0aa43b69c6ddee229352 (patch) | |
| tree | 2d89725c0fbaacc419600aa37a2b66703d2e05e8 /lib/puppet | |
| parent | ea7b9dfc19ed704bc3abbd9c955e8a40970ada1f (diff) | |
| download | puppet-0e9858f19d9d2e021a9d0aa43b69c6ddee229352.tar.gz puppet-0e9858f19d9d2e021a9d0aa43b69c6ddee229352.tar.xz puppet-0e9858f19d9d2e021a9d0aa43b69c6ddee229352.zip | |
(#6407) Fix spec test hang with Mocha >= 0.9.11 in zlib testing
We had a combination of bad logic, and bad testing, and a nasty behaviour of
Mocha <= 0.9.10 that would result in a false pass for one of our tests.
This not only falsely passed, but hid an infinite loop retrying decompression
on an invalid data stream; it could be triggered by anything that sent an HTTP
request with an invalid compressed body, resulting in a livelock.
Paired-with: Jesse Wolfe <jesse@puppetlabs.com>
Signed-off-by: Daniel Pittman <daniel@puppetlabs.com>
Diffstat (limited to 'lib/puppet')
| -rw-r--r-- | lib/puppet/network/http/compression.rb | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/puppet/network/http/compression.rb b/lib/puppet/network/http/compression.rb index d9b56f184..c8d001169 100644 --- a/lib/puppet/network/http/compression.rb +++ b/lib/puppet/network/http/compression.rb @@ -75,7 +75,10 @@ module Puppet::Network::HTTP::Compression # in this case, we try with a verbatim (no header) # deflater. @uncompressor = Zlib::Inflate.new - retry if @first + if @first then + @first = false + retry + end raise end |
