JBoss Native SVN: r1770 - sandbox/mod_jk.
by jbossnative-commits@lists.jboss.org
Author: jfrederic.clere(a)jboss.com
Date: 2008-08-27 12:00:49 -0400 (Wed, 27 Aug 2008)
New Revision: 1770
Modified:
sandbox/mod_jk/TraceAna.java
Log:
Allow truncated messages to be analysed.
Modified: sandbox/mod_jk/TraceAna.java
===================================================================
--- sandbox/mod_jk/TraceAna.java 2008-08-19 17:04:24 UTC (rev 1769)
+++ sandbox/mod_jk/TraceAna.java 2008-08-27 16:00:49 UTC (rev 1770)
@@ -27,11 +27,13 @@
public class TraceAna {
private int pos = 0; /* position in the buffer */
+ private int size = 0; /* size of the received data */
private ByteBuffer buf; /* ByteBuffer to use */
TraceAna(int size) {
buf = ByteBuffer.allocate(size);
}
void putByte(byte b) {
+ size++;
buf.put(b);
}
private int getShort(int offset) {
@@ -57,9 +59,14 @@
return(getByte());
}
private byte getByte() {
- byte b1;
- b1 = buf.get(pos);
- pos++;
+ byte b1 =-1;
+ try {
+ b1 = buf.get(pos);
+ pos++;
+ } catch(IndexOutOfBoundsException ex) {
+ }
+ if (pos > size)
+ return -1; /* outside buffer... */
return b1;
}
private boolean isByteEgal(byte b) {
@@ -72,16 +79,29 @@
}
private String getString() {
int size;
+ boolean truncated = false;
size = getShort();
if ( size == 65535)
return("NULL");
+
+ /* prevent the size to be bigger than the read data */
+ if (this.size-pos <size) {
+ size = this.size - pos;
+ truncated = true;
+ }
byte [] buffet = new byte[size];
for (int i=0; i<size; i++) {
buffet[i] = buf.get(pos);
pos++;
}
pos++; // zero byte.
- return new String(buffet);
+ String ssize = String.valueOf(size);
+ ssize = ssize.concat(" ");
+ ssize = ssize.concat(new String(buffet));
+ if (truncated) {
+ ssize = ssize.concat(" [TRUNCATED!!!]");
+ }
+ return ssize;
}
private static int HexVal(char c) {
16 years, 4 months
JBoss Native SVN: r1769 - trunk/build/unix.
by jbossnative-commits@lists.jboss.org
Author: jfrederic.clere(a)jboss.com
Date: 2008-08-19 13:04:24 -0400 (Tue, 19 Aug 2008)
New Revision: 1769
Modified:
trunk/build/unix/package.list
Log:
Oops it doesn't take the last on but the first on the same version.
Modified: trunk/build/unix/package.list
===================================================================
--- trunk/build/unix/package.list 2008-08-18 22:00:59 UTC (rev 1768)
+++ trunk/build/unix/package.list 2008-08-19 17:04:24 UTC (rev 1769)
@@ -4,7 +4,6 @@
jboss-native|2.0.2|TOMCAT_NATIVE_1_1_11|apr:v:1.2.9|apu:v:1.2.8|api:v:1.2.1|ssl:v:0.9.8e|zlib:v:1.2.3
jboss-native|2.0.3|TOMCAT_NATIVE_1_1_12|apr:v:1.2.8|apu:v:1.2.8|api:v:1.2.1|ssl:v:0.9.8e|zlib:v:1.2.3
jboss-native|2.0.4|TOMCAT_NATIVE_1_1_13|apr:v:1.2.8|apu:v:1.2.8|api:v:1.2.1|ssl:v:0.9.8e|zlib:v:1.2.3
-jboss-native|2.0.5-dev|TOMCAT_NATIVE_1_1_14|apr:v:1.2.8|apu:v:1.2.8|api:v:1.2.1|ssl:v:0.9.8h|zlib:v:1.2.3
jboss-native|2.0.5-dev|trunk|apr:v:1.2.8|apu:v:1.2.8|api:v:1.2.1|ssl:v:0.9.8h|zlib:v:1.2.3
# SIGHT
jboss-sight|1.0.0|trunk|apr:v:1.2.9|apu:v:1.2.8|api:v:1.2.1
16 years, 4 months
JBoss Native SVN: r1768 - trunk/build/unix.
by jbossnative-commits@lists.jboss.org
Author: jfrederic.clere(a)jboss.com
Date: 2008-08-18 18:00:59 -0400 (Mon, 18 Aug 2008)
New Revision: 1768
Modified:
trunk/build/unix/package.list
Log:
Use trunk.
Modified: trunk/build/unix/package.list
===================================================================
--- trunk/build/unix/package.list 2008-07-25 09:36:17 UTC (rev 1767)
+++ trunk/build/unix/package.list 2008-08-18 22:00:59 UTC (rev 1768)
@@ -5,6 +5,7 @@
jboss-native|2.0.3|TOMCAT_NATIVE_1_1_12|apr:v:1.2.8|apu:v:1.2.8|api:v:1.2.1|ssl:v:0.9.8e|zlib:v:1.2.3
jboss-native|2.0.4|TOMCAT_NATIVE_1_1_13|apr:v:1.2.8|apu:v:1.2.8|api:v:1.2.1|ssl:v:0.9.8e|zlib:v:1.2.3
jboss-native|2.0.5-dev|TOMCAT_NATIVE_1_1_14|apr:v:1.2.8|apu:v:1.2.8|api:v:1.2.1|ssl:v:0.9.8h|zlib:v:1.2.3
+jboss-native|2.0.5-dev|trunk|apr:v:1.2.8|apu:v:1.2.8|api:v:1.2.1|ssl:v:0.9.8h|zlib:v:1.2.3
# SIGHT
jboss-sight|1.0.0|trunk|apr:v:1.2.9|apu:v:1.2.8|api:v:1.2.1
jboss-sight|1.0.1|trunk|apr:v:1.2.8|apu:v:1.2.8|api:v:1.2.1
16 years, 4 months