Skip to content
Browse files

Revert "Don't suspend requests too early for the first request."

This reverts commit 70ffcba.
  • Loading branch information...
1 parent 1d9840e commit e6866826e62ba6c627dc23e819b8c9ed8a340090 @fmpwizard fmpwizard committed Aug 31, 2012
View
10 web/webkit/src/main/scala/net/liftweb/http/LiftServlet.scala
@@ -626,6 +626,8 @@ class LiftServlet extends Loggable {
(renderVersion ->
AjaxRequestInfo(handlerVersion, Empty, cont :: Nil, millis))
+ suspendRequest()
+
Empty // no response available, triggers the actual AJAX computation below
case AjaxRequestInfo(storedVersion, existingResponseBox @ Full(_), _, _) =>
@@ -644,12 +646,14 @@ class LiftServlet extends Loggable {
(renderVersion ->
AjaxRequestInfo(handlerVersion, Empty, cont :: Nil, millis))
+ suspendRequest()
+
Empty // no response available, triggers the actual AJAX computation below
}
}
toReturn or {
- val result = Full(runAjax(requestState, liftSession, Full((result: LiftResponse) => {
+ Full(runAjax(requestState, liftSession, Full((result: LiftResponse) => {
// When we get the response, synchronizedly check that the
// versions are still the same in the map, and, if so, update
// any waiting actors then clear the actor list and update the
@@ -665,10 +669,6 @@ class LiftServlet extends Loggable {
}
}
})))
-
- suspendRequest()
-
- result
} openOr Empty
case _ =>
View
2 web/webkit/src/main/scala/net/liftweb/http/LiftSession.scala
@@ -573,7 +573,7 @@ class LiftSession(private[http] val _contextPath: String, val uniqueId: String,
*/
private var ajaxRequests = scala.collection.mutable.Map[String,AjaxRequestInfo]()
- private[http] def withAjaxRequests[T](fn: (scala.collection.mutable.Map[String, AjaxRequestInfo]) => T): T = {
+ private[http] def withAjaxRequests[T](fn: (scala.collection.mutable.Map[String, AjaxRequestInfo]) => T) = {
ajaxRequests.synchronized { fn(ajaxRequests) }
}

0 comments on commit e686682

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