get respCode and respCntType from response

This commit is contained in:
hmm 2014-09-01 14:46:07 +08:00
parent 7ccd47d74b
commit 6954a15bf4
2 changed files with 5 additions and 5 deletions

View File

@ -163,8 +163,8 @@ public class RequestHandler implements Runnable {
this.serverIn = serverConnection.getInputStream(); this.serverIn = serverConnection.getInputStream();
synchronized (mutex) { synchronized (mutex) {
this.proxyServer.processRequest(this.header, requestBody); // this.proxyServer.processRequest(this.header, requestBody);
log.trace("processed request"); // log.trace("processed request");
this.buffer.reset(); this.buffer.reset();
int len; int len;

View File

@ -173,7 +173,7 @@ public abstract class AbstractCodeGenerator implements IScriptGenerator,
// doParseRequest(header, requestBody); // doParseRequest(header, requestBody);
} }
private void doParseRequest(HttpRequestHeader header, byte[] requestBody) private void doParseRequest(HttpRequestHeader header, byte[] requestBody, int respCode, String respContentType)
throws UserException, UnsupportedEncodingException { throws UserException, UnsupportedEncodingException {
Param[] params; Param[] params;
int i; int i;
@ -342,7 +342,7 @@ public abstract class AbstractCodeGenerator implements IScriptGenerator,
&& responseHeader.isHtmlContentType() && responseHeader.isHtmlContentType()
&& hasHtmlTag(responseParser)) { && hasHtmlTag(responseParser)) {
dealWithHtmlResponse(header, responseParser); dealWithHtmlResponse(header, responseParser);
doParseRequest(header, requestBody); doParseRequest(header, requestBody, responseHeader.getRespCode(), responseHeader.getContentType());
response.setResponse(responseParser.encodeCoent(doParseHtmlContent(responseParser.getResponseBody(), header.url))); response.setResponse(responseParser.encodeCoent(doParseHtmlContent(responseParser.getResponseBody(), header.url)));
setStruts(new String(response.getResponse()).toLowerCase().indexOf( setStruts(new String(response.getResponse()).toLowerCase().indexOf(
@ -357,7 +357,7 @@ public abstract class AbstractCodeGenerator implements IScriptGenerator,
log.debug("Ignoring response because content type is not known: " log.debug("Ignoring response because content type is not known: "
+ responseHeader.getRespCode()); + responseHeader.getRespCode());
} }
doParseRequest(header, requestBody); doParseRequest(header, requestBody, responseHeader.getRespCode(), responseHeader.getContentType());
} }
private boolean hasHtmlTag(ResponseParser responseParser) { private boolean hasHtmlTag(ResponseParser responseParser) {