Skip to content

Commit fd2bbba

Browse files
committed
Track sequence numbers of arbitrary length.
We track sequence numbers as Longs now, and the client side encodes the sequence number as an arbitrarily-long base-36 number.
1 parent 82824bf commit fd2bbba

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

web/webkit/src/main/scala/net/liftweb/http/LiftServlet.scala

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -431,15 +431,15 @@ class LiftServlet extends Loggable {
431431
* client. The latter is used to expire result data for sequence
432432
* numbers that are no longer needed.
433433
*/
434-
private case class AjaxVersionInfo(renderVersion:String, sequenceNumber:Int, pendingRequests:Int)
434+
private case class AjaxVersionInfo(renderVersion:String, sequenceNumber:Long, pendingRequests:Int)
435435
private object AjaxVersions {
436436
def unapply(ajaxPathPart: String) : Option[AjaxVersionInfo] = {
437-
val dash = ajaxPathPart.indexOf("-")
438-
if (dash > -1 && ajaxPathPart.length > dash + 2)
437+
val separator = ajaxPathPart.indexOf("-")
438+
if (separator > -1 && ajaxPathPart.length > separator + 2)
439439
Some(
440-
AjaxVersionInfo(ajaxPathPart.substring(0, dash),
441-
ajaxPathPart.charAt(dash + 1),
442-
Integer.parseInt(ajaxPathPart.substring(dash + 2, dash + 3), 36))
440+
AjaxVersionInfo(ajaxPathPart.substring(0, separator),
441+
java.lang.Long.parseLong(ajaxPathPart.substring(separator + 1, ajaxPathPart.length - 1), 36),
442+
Integer.parseInt(ajaxPathPart.substring(ajaxPathPart.length - 1), 36))
443443
)
444444
else
445445
None

web/webkit/src/main/scala/net/liftweb/http/js/ScriptRenderer.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ object ScriptRenderer {
192192
if (LiftRules.enableLiftGC) { """
193193
var replacement = '""" + LiftRules.ajaxPath + """/'+lift_page;
194194
if (version)
195-
replacement += ('-'+(version%36).toString(36)) + (liftAjax.lift_ajaxQueue.length > 35 ? 35 : liftAjax.lift_ajaxQueue.length).toString(36);
195+
replacement += ('-'+version.toString(36)) + (liftAjax.lift_ajaxQueue.length > 35 ? 35 : liftAjax.lift_ajaxQueue.length).toString(36);
196196
return url.replace('""" + LiftRules.ajaxPath + """', replacement);"""
197197
} else {
198198
"return url;"

0 commit comments

Comments
 (0)