Skip to content
This repository
Browse code

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.
  • Loading branch information...
commit fd2bbba0fe96cdc29439516f68bc8623515a8571 1 parent 82824bf
Antonio Salazar Cardozo Shadowfiend authored
12 web/webkit/src/main/scala/net/liftweb/http/LiftServlet.scala
@@ -431,15 +431,15 @@ class LiftServlet extends Loggable {
431 431 * client. The latter is used to expire result data for sequence
432 432 * numbers that are no longer needed.
433 433 */
434   - private case class AjaxVersionInfo(renderVersion:String, sequenceNumber:Int, pendingRequests:Int)
  434 + private case class AjaxVersionInfo(renderVersion:String, sequenceNumber:Long, pendingRequests:Int)
435 435 private object AjaxVersions {
436 436 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)
439 439 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))
443 443 )
444 444 else
445 445 None
2  web/webkit/src/main/scala/net/liftweb/http/js/ScriptRenderer.scala
@@ -192,7 +192,7 @@ object ScriptRenderer {
192 192 if (LiftRules.enableLiftGC) { """
193 193 var replacement = '""" + LiftRules.ajaxPath + """/'+lift_page;
194 194 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);
196 196 return url.replace('""" + LiftRules.ajaxPath + """', replacement);"""
197 197 } else {
198 198 "return url;"

0 comments on commit fd2bbba

Please sign in to comment.
Something went wrong with that request. Please try again.