obb = (cl <= 0) ? Process.getByteBuffer(8000, tis)
: Process.getByteBuffer(8000, tis, cl);
} catch (SysException e) {
e.printStackTrace();
tprc.interrupt();
throw new SysRuntimeException(e);
} finally {
executor.free(tprc);
}
try {
setPrms(cp, prms, "body", obb);
if ("POST".equals(httpExchange.getRequestMethod())
&& ct != null
&& ct.indexOf("application/x-www-form-urlencoded") >= 0) {
String enc;
try {
enc = cntx.getPrmNvl("request.encoding", "UTF-8");
if (enc == null || enc.trim().length() == 0)
enc = "UTF-8";
} catch (SysException e2) {
enc = "UTF-8";
}
StringBuffer sb = Strings.getStringBuffer(obb.getIS(),
enc);
setPrms(cp, prms, "postquery", sb);
try {
boolean parse_postquery = cntx.getPrmNvl(
"parse_postquery", false);
if (parse_postquery) {
String[] eqs = Strings.parseXVSLine(
sb.toString(), '/', '&');
for (String eq : eqs) {
int j = eq.indexOf('=');
if (j >= 0)
setPrms(cp, prms,
"post." + eq.substring(0, j),
eq.substring(j + 1));
}
}
} catch (SysException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
}
} catch (IOException e) {
e.printStackTrace();
throw new SysRuntimeException(e);
}
String enc;
try {
enc = cntx.getPrmNvl("response.encoding", "UTF-8");