if (log.debugable()) log.debug("Error found at client: "+errClient+"\n"+Servlets.getDetail(request));
//parse desktop ID
final WebApp wapp = sess.getWebApp();
final WebAppCtrl wappc = (WebAppCtrl)wapp;
final AuDecoder audec = getAuDecoder(wapp);
final String dtid = audec.getDesktopId(request);
if (dtid == null) {
//Bug 1929139: incomplete request (IE only)
if (log.debugable()) {
final String msg = "Incomplete request\n"+Servlets.getDetail(request);
log.debug(msg);
}
response.sendError(467, "Incomplete request");
return;
}
Desktop desktop = getDesktop(sess, dtid);
if (desktop == null) {
final String cmdId = audec.getFirstCommand(request);
if (!"rmDesktop".equals(cmdId))
desktop = recoverDesktop(sess, request, response, wappc, dtid);
if (desktop == null) {
response.setIntHeader("ZK-Error", response.SC_GONE); //denote timeout
sessionTimeout(request, response, wapp, dtid);
return;
}
}
WebManager.setDesktop(request, desktop);
//reason: a new page might be created (such as include)
final String sid = request.getHeader("ZK-SID");
if (sid != null) //Some client might not have ZK-SID
response.setHeader("ZK-SID", sid);
//parse commands
final Configuration config = wapp.getConfiguration();
final List aureqs;
boolean keepAlive = false;
try {
final boolean timerKeepAlive = config.isTimerKeepAlive();
aureqs = audec.decode(request, desktop);
for (Iterator it = aureqs.iterator(); it.hasNext();) {
final String cmdId = ((AuRequest)it.next()).getCommand();
keepAlive = !(!timerKeepAlive && Events.ON_TIMER.equals(cmdId))
&& !"dummy".equals(cmdId);
//dummy is used for PollingServerPush for piggyback