Author: bklaas
Date: Fri Mar 21 14:08:54 2008
New Revision: 2143

URL: http://svn.slimdevices.com?rev=2143&root=Jive&view=rev
Log:
Bug: 6657
Description: though significant effort went into these lines, in chunked 
responses, we still weren't getting the return value right in all instances.

In the case of when your list count is exactly equal to the BLOCK_SIZE * 
lastKey, it is necessary to decrement lastKey by 1 or you get in an endless 
request loop. It looks fine on the UI, but in the background it just keep 
requesting and requesting the last chunk.

Modified:
    trunk/squeezeplay/src/squeezeplay/share/applets/SlimBrowser/DB.lua

Modified: trunk/squeezeplay/src/squeezeplay/share/applets/SlimBrowser/DB.lua
URL: 
http://svn.slimdevices.com/trunk/squeezeplay/src/squeezeplay/share/applets/SlimBrowser/DB.lua?rev=2143&root=Jive&r1=2142&r2=2143&view=diff
==============================================================================
--- trunk/squeezeplay/src/squeezeplay/share/applets/SlimBrowser/DB.lua 
(original)
+++ trunk/squeezeplay/src/squeezeplay/share/applets/SlimBrowser/DB.lua Fri Mar 
21 14:08:54 2008
@@ -238,12 +238,11 @@
        local lastKey = 0
        if count > BLOCK_SIZE then
                lastKey = math.modf(count / BLOCK_SIZE)
+               if lastKey * BLOCK_SIZE == count then
+                       lastKey = lastKey - 1
+               end
                if not self.store[lastKey] then
-                       if lastKey * BLOCK_SIZE != count then
-                               return lastKey * BLOCK_SIZE, BLOCK_SIZE
-                       else
-                               return lastKey * BLOCK_SIZE - 1, BLOCK_SIZE
-                       end
+                       return lastKey * BLOCK_SIZE, BLOCK_SIZE
                end
        end
 

_______________________________________________
Jive-checkins mailing list
[email protected]
http://lists.slimdevices.com/cgi-bin/mailman/listinfo/jive-checkins

Reply via email to