private int decodeRequest( Msg msg, MsgContext ep, MessageBytes tmpMB )
throws IOException {
// FORWARD_REQUEST handler
Request req = checkRequest(ep);
RequestInfo rp = req.getRequestProcessor();
rp.setStage(Constants.STAGE_PARSE);
MessageBytes tmpMB2 = (MessageBytes)req.getNote(WorkerEnv.SSL_CERT_NOTE);
if(tmpMB2 != null) {
tmpMB2.recycle();
}
req.setStartTime(System.currentTimeMillis());
// Translate the HTTP method code to a String.
byte methodCode = msg.getByte();
if (methodCode != AjpConstants.SC_M_JK_STORED) {
String mName=AjpConstants.methodTransArray[(int)methodCode - 1];
req.method().setString(mName);
}
msg.getBytes(req.protocol());
msg.getBytes(req.requestURI());
msg.getBytes(req.remoteAddr());
msg.getBytes(req.remoteHost());
msg.getBytes(req.localName());
req.setLocalPort(msg.getInt());
boolean isSSL = msg.getByte() != 0;
if( isSSL ) {
// XXX req.setSecure( true );
req.scheme().setString("https");
}
decodeHeaders( ep, msg, req, tmpMB );
decodeAttributes( ep, msg, req, tmpMB );
rp.setStage(Constants.STAGE_PREPARE);
MessageBytes valueMB = req.getMimeHeaders().getValue("host");
parseHost(valueMB, req);
// set cookies on request now that we have all headers
req.getCookies().setHeaders(req.getMimeHeaders());