if (lFlashBridgeReq != null) {
mLog.warn("TCPEngine returned policy file response ('" + new String(lBA, "US-ASCII") + "'), check for FlashBridge plug-in.");
return null;
}
RequestHeader lHeader = new RequestHeader();
Map<String, String> lArgs = new FastMap<String, String>();
String lPath = (String) lRespMap.get("path");
// isolate search string
String lSearchString = "";
if (lPath != null) {
int lPos = lPath.indexOf(JWebSocketCommonConstants.PATHARG_SEPARATOR);
if (lPos >= 0) {
lSearchString = lPath.substring(lPos + 1);
if (lSearchString.length() > 0) {
String[] lArgsArray = lSearchString.split(JWebSocketCommonConstants.ARGARG_SEPARATOR);
for (int i = 0; i < lArgsArray.length; i++) {
String[] lKeyValuePair = lArgsArray[i].split(JWebSocketCommonConstants.KEYVAL_SEPARATOR, 2);
if (lKeyValuePair.length == 2) {
lArgs.put(lKeyValuePair[0], lKeyValuePair[1]);
if (mLog.isDebugEnabled()) {
mLog.debug("arg" + i + ": " + lKeyValuePair[0] + "=" + lKeyValuePair[1]);
}
}
}
}
}
}
if (mLog.isDebugEnabled()) {
mLog.debug("Handshake flushed.");
}
// set default sub protocol if none passed
if (lArgs.get("prot") == null) {
lArgs.put("prot", JWebSocketCommonConstants.SUB_PROT_DEFAULT);
}
lHeader.put("host", lRespMap.get("host"));
lHeader.put("origin", lRespMap.get("origin"));
lHeader.put("location", lRespMap.get("location"));
lHeader.put("path", lRespMap.get("path"));
lHeader.put("searchString", lSearchString);
lHeader.put("args", lArgs);
return lHeader;
}