Author: olegk
Date: Mon Aug 8 11:56:58 2005
New Revision: 230856
URL: http://svn.apache.org/viewcvs?rev=230856&view=rev
Log:
Added tracking of the request life cycle
Modified:
jakarta/httpclient/trunk/coyote-httpconnector/src/java/org/apache/http/coyote/impl/HttpConnectionProcessor.java
Modified: jakarta/httpclient/trunk/coyote-httpconnector/src/java/org/apache/http/coyote/impl/HttpConnectionProcessor.java
URL: http://svn.apache.org/viewcvs/jakarta/httpclient/trunk/coyote-httpconnector/src/java/org/apache/http/coyote/impl/HttpConnectionProcessor.java?rev=230856&r1=230855&r2=230856&view=diff
==============================================================================
--- jakarta/httpclient/trunk/coyote-httpconnector/src/java/org/apache/http/coyote/impl/HttpConnectionProcessor.java
(original)
+++ jakarta/httpclient/trunk/coyote-httpconnector/src/java/org/apache/http/coyote/impl/HttpConnectionProcessor.java
Mon Aug 8 11:56:58 2005
@@ -41,6 +41,7 @@
import org.apache.coyote.ActionCode;
import org.apache.coyote.ActionHook;
import org.apache.coyote.Adapter;
+import org.apache.coyote.Constants;
import org.apache.coyote.Request;
import org.apache.coyote.Response;
import org.apache.http.ConnectionClosedException;
@@ -126,7 +127,7 @@
sendHttpResponse();
manageHttpConnection();
} catch (HttpException ex) {
- LOG.debug("Malformed HTTP requst");
+ LOG.debug("Malformed HTTP request");
this.httpres = processHttpException(ex);
sendHttpResponse();
}
@@ -153,7 +154,10 @@
}
private void receiveHttpRequest() throws IOException, HttpException {
+ this.coyotereq.getRequestProcessor().setStage(Constants.STAGE_NEW);
this.httpreq = this.conn.receiveRequest(this.params);
+ this.coyotereq.getRequestProcessor().setStage(Constants.STAGE_PARSE);
+ this.coyotereq.setStartTime(System.currentTimeMillis());
LOG.debug("HTTP request received");
}
@@ -184,6 +188,7 @@
}
private void prepareCoyoteRequest() throws HttpException {
+ this.coyotereq.getRequestProcessor().setStage(Constants.STAGE_PREPARE);
// Convert the request line
RequestLine reqline = this.httpreq.getRequestLine();
HttpVersion ver = reqline.getHttpVersion();
@@ -258,6 +263,7 @@
}
private void callServletContainer() throws IOException, HttpException {
+ this.coyotereq.getRequestProcessor().setStage(Constants.STAGE_SERVICE);
try {
this.adapter.service(this.coyotereq, this.coyoteres);
} catch (IOException ex) {
@@ -273,8 +279,10 @@
if (!connreuse.keepAlive(this.httpres)) {
this.conn.close();
LOG.debug("Connection closed");
+ this.coyotereq.getRequestProcessor().setStage(Constants.STAGE_ENDED);
} else {
LOG.debug("Connection kept alive");
+ this.coyotereq.getRequestProcessor().setStage(Constants.STAGE_KEEPALIVE);
}
}
this.coyotereq.recycle();
|