remm 2002/10/06 11:10:04
Modified: http11/src/java/org/apache/coyote/http11
Http11Processor.java
Log:
- Optimization: avoid useless B2C operation on the host name.
Revision Changes Path
1.40 +13 -2
jakarta-tomcat-connectors/http11/src/java/org/apache/coyote/http11/Http11Processor.java
Index: Http11Processor.java
===================================================================
RCS file:
/home/cvs/jakarta-tomcat-connectors/http11/src/java/org/apache/coyote/http11/Http11Processor.java,v
retrieving revision 1.39
retrieving revision 1.40
diff -u -r1.39 -r1.40
--- Http11Processor.java 4 Oct 2002 23:07:23 -0000 1.39
+++ Http11Processor.java 6 Oct 2002 18:10:04 -0000 1.40
@@ -237,6 +237,13 @@
*/
protected int timeout = 300000; // 5 minutes as in Apache HTTPD server
+
+ /**
+ * Host name (used to avoid useless B2C conversion on the host name).
+ */
+ protected char[] hostNameC = new char[0];
+
+
// --------------------------------------------------------- Public Methods
@@ -787,9 +794,13 @@
int valueL = valueBC.getLength();
int valueS = valueBC.getStart();
int colonPos = -1;
+ if (hostNameC.length < valueL) {
+ hostNameC = new char[valueL];
+ }
for (int i = 0; i < valueL; i++) {
char b = (char) valueB[i + valueS];
+ hostNameC[i] = b;
if (b == ':') {
colonPos = i;
break;
@@ -804,10 +815,10 @@
// 443 - Default HTTPS port
request.setServerPort(443);
}
- request.serverName().setBytes(valueB, valueS, valueL);
+ request.serverName().setChars(hostNameC, 0, valueL);
} else {
- request.serverName().setBytes(valueB, valueS, colonPos);
+ request.serverName().setChars(hostNameC, 0, colonPos);
int port = 0;
int mult = 1;
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>