nightdomain / jmemcache-daemon

Automatically exported from code.google.com/p/jmemcache-daemon
Apache License 2.0
0 stars 0 forks source link

Expiration time bug for storage commands when expiry = 2592000 seconds / thirty days #28

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
In jmemcache-core:1.0.0 there appears to be a small bug in handling expiration 
times.

According to the "Expiration times" section of the memcache protocol 
documentation, an expiration value of 2592000 should translate into an 
expiration of 30 days from the time the relevant element is inserted.  Any 
expiration value larger than 2592000 should be treated as a Unix timestamp.

jmemcache-core:1.0.0 treats an expiration value of 2592000 as a Unix timestamp. 
 Memcached and other implementations on the other hand behave as described in 
the protocol.

The fix seems to be a simple replacement of a "<" to a "<=" in 
MemcacheCommandDecoder and MemcacheBinaryCommandDecoder.

I've attached an archive with a test project and a patch against the 
jmemcached-parent-1.0.0 tag.

Original issue reported on code.google.com by Professo...@gmail.com on 6 Jun 2011 at 6:30

Attachments: