JBossWeb SVN: r1397 - sandbox/clients.
by jbossweb-commits@lists.jboss.org
Author: jfrederic.clere(a)jboss.com
Date: 2010-03-05 11:30:48 -0500 (Fri, 05 Mar 2010)
New Revision: 1397
Modified:
sandbox/clients/CometTest.java
sandbox/clients/CometTestSSL.java
Log:
Improve the sessionid checks.
Modified: sandbox/clients/CometTest.java
===================================================================
--- sandbox/clients/CometTest.java 2010-03-05 00:36:32 UTC (rev 1396)
+++ sandbox/clients/CometTest.java 2010-03-05 16:30:48 UTC (rev 1397)
@@ -33,6 +33,7 @@
Exception ex = null;
int max = 0;
boolean failed = true;
+ String lastPartialSess = null;
/**
*
* Usage:
@@ -104,7 +105,7 @@
writechunk(os, "Testing...");
String res = readchunk(in);
String cursess = readsess(res);
- if (sess != null && cursess.compareTo(sess) != 0) {
+ if (sess != null && (cursess == null || sess.compareTo(cursess) != 0)) {
System.out.println("Session changed: " + cursess + " " + sess);
break;
}
@@ -133,10 +134,15 @@
while (len == -1) {
try {
data = in.readLine();
+ // System.out.println("DATA (len): " + data);
len = Integer.valueOf(data, 16);
- // System.out.println("Got: " + len);
} catch (Exception ex) {
System.out.println("Ex: " + ex);
+ } finally {
+ if (len == 0) {
+ System.out.println("End chunk");
+ throw new Exception("End chunk");
+ }
}
}
len++; // For the CR...
@@ -147,19 +153,21 @@
while (recv != len) {
int i = in.read(buf, offset, len-offset);
recv = recv + i;
+ // System.out.println("DATA: " + recv + ":" + len);
offset = recv;
}
data = new String(buf);
// System.out.println("DATA: " + recv + " : " + data);
+ // System.out.println("DATA: " + recv);
return data;
}
- static String readsess(String in)
+ static String getsess(String in)
{
String data = null;
int start = in.indexOf('[');
if (start != -1) {
- int end = in.indexOf(']');
- if (end != -1) {
+ int end = in.indexOf(']');
+ if (end != -1) {
if (end > start) {
data = in.substring(start+1, end);
} else {
@@ -171,9 +179,35 @@
}
}
}
- }
+ }
}
- // System.out.println("SESSION: " + data);
return data;
}
+ String readsess(String input)
+ {
+ String data = null;
+ String in = input;
+
+ data = getsess(in);
+ if (data == null) {
+ /* A small chunk without a complete sessionid */
+ if (this.lastPartialSess == null)
+ this.lastPartialSess = input;
+ else
+ this.lastPartialSess = this.lastPartialSess + input;
+ in = this.lastPartialSess;
+ data = getsess(in);
+ }
+ /* Store the last part of session (for the next "small" chunk) */
+ if (data != null) {
+ int start = in.lastIndexOf("["+data+"]");
+ if (start>=0)
+ this.lastPartialSess = in.substring(start);
+ else
+ this.lastPartialSess = null;
+ }
+ if (data == null)
+ System.out.println("SESSION not found in: " + in);
+ return data;
+ }
}
Modified: sandbox/clients/CometTestSSL.java
===================================================================
--- sandbox/clients/CometTestSSL.java 2010-03-05 00:36:32 UTC (rev 1396)
+++ sandbox/clients/CometTestSSL.java 2010-03-05 16:30:48 UTC (rev 1397)
@@ -57,6 +57,7 @@
if (args.length != 1)
{
System.err.println("missing command line arguments");
+ System.err.println("CometTestSSL URL");
System.exit(1);
}
@@ -72,6 +73,7 @@
comet[i].join();
if (comet[i].failed) {
System.err.println("Test failed! " + comet[i].ex);
+ comet[i].ex.printStackTrace();
System.exit(1);
}
}
14 years, 2 months
JBossWeb SVN: r1396 - in trunk/java/org/apache: catalina/startup and 2 other directories.
by jbossweb-commits@lists.jboss.org
Author: remy.maucherat(a)jboss.com
Date: 2010-03-04 19:36:32 -0500 (Thu, 04 Mar 2010)
New Revision: 1396
Modified:
trunk/java/org/apache/catalina/core/StandardEngine.java
trunk/java/org/apache/catalina/core/StandardService.java
trunk/java/org/apache/catalina/startup/Catalina.java
trunk/java/org/apache/coyote/ajp/AjpAprProtocol.java
trunk/java/org/apache/coyote/ajp/AjpProtocol.java
trunk/java/org/apache/coyote/http11/Http11AprProtocol.java
trunk/java/org/apache/coyote/http11/Http11Protocol.java
Log:
- Move to debug less useful start/stop messages.
Modified: trunk/java/org/apache/catalina/core/StandardEngine.java
===================================================================
--- trunk/java/org/apache/catalina/core/StandardEngine.java 2010-03-04 15:36:30 UTC (rev 1395)
+++ trunk/java/org/apache/catalina/core/StandardEngine.java 2010-03-05 00:36:32 UTC (rev 1396)
@@ -425,10 +425,6 @@
}
}
- // Log our server identification information
- //System.out.println(ServerInfo.getServerInfo());
- if(log.isInfoEnabled())
- log.info( "Starting Servlet Engine: " + ServerInfo.getServerInfo());
if( mbeans != null ) {
try {
Registry.getRegistry(null, null)
Modified: trunk/java/org/apache/catalina/core/StandardService.java
===================================================================
--- trunk/java/org/apache/catalina/core/StandardService.java 2010-03-04 15:36:30 UTC (rev 1395)
+++ trunk/java/org/apache/catalina/core/StandardService.java 2010-03-05 00:36:32 UTC (rev 1396)
@@ -530,8 +530,8 @@
// Notify our interested LifecycleListeners
lifecycle.fireLifecycleEvent(BEFORE_START_EVENT, null);
- if(log.isInfoEnabled())
- log.info(sm.getString("standardService.start.name", this.name));
+ if(log.isDebugEnabled())
+ log.debug(sm.getString("standardService.start.name", this.name));
lifecycle.fireLifecycleEvent(START_EVENT, null);
started = true;
@@ -595,9 +595,8 @@
}
lifecycle.fireLifecycleEvent(STOP_EVENT, null);
- if(log.isInfoEnabled())
- log.info
- (sm.getString("standardService.stop.name", this.name));
+ if(log.isDebugEnabled())
+ log.debug(sm.getString("standardService.stop.name", this.name));
started = false;
// Stop our defined Container second
Modified: trunk/java/org/apache/catalina/startup/Catalina.java
===================================================================
--- trunk/java/org/apache/catalina/startup/Catalina.java 2010-03-04 15:36:30 UTC (rev 1395)
+++ trunk/java/org/apache/catalina/startup/Catalina.java 2010-03-05 00:36:32 UTC (rev 1396)
@@ -579,8 +579,8 @@
}
long t2 = System.nanoTime();
- if(log.isInfoEnabled())
- log.info("Server startup in " + ((t2 - t1) / 1000000) + " ms");
+ if (log.isDebugEnabled())
+ log.debug("Server startup in " + ((t2 - t1) / 1000000) + " ms");
try {
// Register shutdown hook
Modified: trunk/java/org/apache/coyote/ajp/AjpAprProtocol.java
===================================================================
--- trunk/java/org/apache/coyote/ajp/AjpAprProtocol.java 2010-03-04 15:36:30 UTC (rev 1395)
+++ trunk/java/org/apache/coyote/ajp/AjpAprProtocol.java 2010-03-05 00:36:32 UTC (rev 1396)
@@ -171,8 +171,8 @@
log.error(sm.getString("ajpprotocol.endpoint.initerror"), ex);
throw ex;
}
- if (log.isInfoEnabled()) {
- log.info(sm.getString("ajpprotocol.init", getName()));
+ if (log.isDebugEnabled()) {
+ log.debug(sm.getString("ajpprotocol.init", getName()));
}
}
Modified: trunk/java/org/apache/coyote/ajp/AjpProtocol.java
===================================================================
--- trunk/java/org/apache/coyote/ajp/AjpProtocol.java 2010-03-04 15:36:30 UTC (rev 1395)
+++ trunk/java/org/apache/coyote/ajp/AjpProtocol.java 2010-03-05 00:36:32 UTC (rev 1396)
@@ -171,8 +171,8 @@
log.error(sm.getString("ajpprotocol.endpoint.initerror"), ex);
throw ex;
}
- if (log.isInfoEnabled()) {
- log.info(sm.getString("ajpprotocol.init", getName()));
+ if (log.isDebugEnabled()) {
+ log.debug(sm.getString("ajpprotocol.init", getName()));
}
}
Modified: trunk/java/org/apache/coyote/http11/Http11AprProtocol.java
===================================================================
--- trunk/java/org/apache/coyote/http11/Http11AprProtocol.java 2010-03-04 15:36:30 UTC (rev 1395)
+++ trunk/java/org/apache/coyote/http11/Http11AprProtocol.java 2010-03-05 00:36:32 UTC (rev 1396)
@@ -117,8 +117,8 @@
log.error(sm.getString("http11protocol.endpoint.initerror"), ex);
throw ex;
}
- if(log.isInfoEnabled())
- log.info(sm.getString("http11protocol.init", getName()));
+ if(log.isDebugEnabled())
+ log.debug(sm.getString("http11protocol.init", getName()));
}
Modified: trunk/java/org/apache/coyote/http11/Http11Protocol.java
===================================================================
--- trunk/java/org/apache/coyote/http11/Http11Protocol.java 2010-03-04 15:36:30 UTC (rev 1395)
+++ trunk/java/org/apache/coyote/http11/Http11Protocol.java 2010-03-05 00:36:32 UTC (rev 1396)
@@ -188,8 +188,8 @@
log.error(sm.getString("http11protocol.endpoint.initerror"), ex);
throw ex;
}
- if (log.isInfoEnabled())
- log.info(sm.getString("http11protocol.init", getName()));
+ if (log.isDebugEnabled())
+ log.debug(sm.getString("http11protocol.init", getName()));
}
14 years, 2 months
JBossWeb SVN: r1395 - trunk/java/org/apache/coyote/http11.
by jbossweb-commits@lists.jboss.org
Author: remy.maucherat(a)jboss.com
Date: 2010-03-04 10:36:30 -0500 (Thu, 04 Mar 2010)
New Revision: 1395
Modified:
trunk/java/org/apache/coyote/http11/Http11AprProtocol.java
Log:
- Disable IO events with SSL for now (JBWEB-154).
Modified: trunk/java/org/apache/coyote/http11/Http11AprProtocol.java
===================================================================
--- trunk/java/org/apache/coyote/http11/Http11AprProtocol.java 2010-03-04 13:30:39 UTC (rev 1394)
+++ trunk/java/org/apache/coyote/http11/Http11AprProtocol.java 2010-03-04 15:36:30 UTC (rev 1395)
@@ -101,7 +101,7 @@
public boolean hasIoEvents() {
- return true;
+ return !isSSLEnabled();
}
14 years, 2 months
JBossWeb SVN: r1394 - trunk/java/org/apache/coyote/http11.
by jbossweb-commits@lists.jboss.org
Author: remy.maucherat(a)jboss.com
Date: 2010-03-04 08:30:39 -0500 (Thu, 04 Mar 2010)
New Revision: 1394
Modified:
trunk/java/org/apache/coyote/http11/InternalAprOutputBuffer.java
Log:
- Add a condition on a write block since the write is not certain, leading to setting last write back to 0.
Modified: trunk/java/org/apache/coyote/http11/InternalAprOutputBuffer.java
===================================================================
--- trunk/java/org/apache/coyote/http11/InternalAprOutputBuffer.java 2010-03-04 13:29:39 UTC (rev 1393)
+++ trunk/java/org/apache/coyote/http11/InternalAprOutputBuffer.java 2010-03-04 13:30:39 UTC (rev 1394)
@@ -748,19 +748,21 @@
int pos = 0;
int end = bbuf.position();
- int res = 0;
- while (pos < end) {
- res = Socket.sendibb(socket, pos, end - pos);
- if (res > 0) {
- pos += res;
- } else {
- break;
+ if (pos < end) {
+ int res = 0;
+ while (pos < end) {
+ res = Socket.sendibb(socket, pos, end - pos);
+ if (res > 0) {
+ pos += res;
+ } else {
+ break;
+ }
}
+ if (res < 0) {
+ throw new IOException(sm.getString("oob.failedwrite"));
+ }
+ response.setLastWrite(res);
}
- if (res < 0) {
- throw new IOException(sm.getString("oob.failedwrite"));
- }
- response.setLastWrite(res);
if (pos < end) {
leftover.allocate(end - pos, -1);
bbuf.position(pos);
14 years, 2 months
JBossWeb SVN: r1393 - trunk/java/org/apache/naming.
by jbossweb-commits@lists.jboss.org
Author: remy.maucherat(a)jboss.com
Date: 2010-03-04 08:29:39 -0500 (Thu, 04 Mar 2010)
New Revision: 1393
Modified:
trunk/java/org/apache/naming/NamingContext.java
Log:
- Revert bad fix.
Modified: trunk/java/org/apache/naming/NamingContext.java
===================================================================
--- trunk/java/org/apache/naming/NamingContext.java 2010-02-26 16:58:25 UTC (rev 1392)
+++ trunk/java/org/apache/naming/NamingContext.java 2010-03-04 13:29:39 UTC (rev 1393)
@@ -516,7 +516,7 @@
throws NamingException {
checkWritable();
- Context newContext = new NamingContext(env, name.get(name.size() - 1));
+ Context newContext = new NamingContext(env, this.name);
bind(name, newContext);
return newContext;
14 years, 2 months