Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
evan committed Jun 9, 2012
1 parent f5b7743 commit 94f9188
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
v1.4.2. Remove race from Marshal.load for any poor saps who have side-effects in their serialization mechanism (jason-o-matic).

v1.4.1. Fix Memcached::Rails#servers bug (tomhughes).

v1.4.0. Update Memcached::Rails compatibility wrapper to play along with Rails 3.2, including support for the horrendous ActiveSupport::Duration (tomhughes).
Expand Down
7 changes: 6 additions & 1 deletion lib/memcached/memcached.rb
Original file line number Diff line number Diff line change
Expand Up @@ -499,12 +499,17 @@ def get(keys, marshal=true)
value, key, flags, ret = Lib.memcached_fetch_rvalue(@struct)
while ret != 21 do # Lib::MEMCACHED_END
if ret == 0 # Lib::MEMCACHED_SUCCESS
hash[key] = (marshal ? Marshal.load(value) : value)
hash[key] = value
elsif ret != 16 # Lib::MEMCACHED_NOTFOUND
check_return_code(ret, key)
end
value, key, flags, ret = Lib.memcached_fetch_rvalue(@struct)
end
if marshal
hash.each do |key, value|
hash[key] = Marshal.load(value)
end
end
hash
else
# Single get
Expand Down

0 comments on commit 94f9188

Please sign in to comment.