seguin 01/05/15 08:23:07
Modified:jk/src/java/org/apache/ajp Ajp13Packet.java
jk/src/java/org/apache/ajp/tomcat4 Ajp13Connector.java
Ajp13InputStream.java Ajp13OutputStream.java
Ajp13Processor.java Ajp13Request.java
Ajp13Response.java
Added: jk/src/java/org/apache/ajp Ajp13.java AjpRequest.java
MessageBytes.java
jk/src/java/org/apache/ajp/test TestAjp13.java
Removed: jk/src/java/org/apache/ajp/tomcat4 Ajp13.java
Log:
refactoring... a work in progress...
Revision ChangesPath
1.2 +14 -13
jakarta-tomcat-connectors/jk/src/java/org/apache/ajp/Ajp13Packet.java
Index: Ajp13Packet.java
===
RCS file:
/home/cvs/jakarta-tomcat-connectors/jk/src/java/org/apache/ajp/Ajp13Packet.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- Ajp13Packet.java 2001/05/12 05:52:39 1.1
+++ Ajp13Packet.java 2001/05/15 15:22:23 1.2
@@ -68,6 +68,9 @@
* packets.
*/
public class Ajp13Packet {
+
+public static final String DEFAULT_CHAR_ENCODING = "8859_1";
+
byte buff[]; // Holds the bytes of the packet
int pos; // The current read or write position in the buffer
@@ -129,7 +132,7 @@
/**
* Prepare this packet for accumulating a message from the container to
* the web server. Set the write position to just after the header
- * (but leave the length unwritten, because it is as yet unknown).
+ * (but leave the length unwritten, because it is as yet unknown).
*/
public void reset() {
len = 4;
@@ -288,19 +291,17 @@
public boolean getBool() {
return (getByte() == (byte) 1);
}
-
-public static final String DEFAULT_CHAR_ENCODING = "8859_1";
-// public void getMessageBytes( MessageBytes mb ) {
-// int length = getInt();
-// if( (length == 0x) || (length == -1) ) {
-// mb.setString( null );
-// return;
-// }
-// mb.setBytes( buff, pos, length );
-// pos += length;
-// pos++; // Skip the terminating \0
-// }
+public void getMessageBytes(MessageBytes mb) {
+int length = getInt();
+if( (length == 0x) || (length == -1) ) {
+mb.setString( null );
+return;
+}
+mb.setBytes( buff, pos, length );
+pos += length;
+pos++; // Skip the terminating \0
+}
// public MessageBytes addHeader( MimeHeaders headers ) {
// int length = getInt();
1.1 jakarta-tomcat-connectors/jk/src/java/org/apache/ajp/Ajp13.java
Index: Ajp13.java
===
/*
*
*
* The Apache Software License, Version 1.1
*
* Copyright (c) 1999 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
*notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
*notice, this list of conditions and the following disclaimer in
*the documentation and/or other materials provided with the
*distribution.
*
* 3. The end-user documentation included with the redistribution, if
*any, must include the following acknowlegement:
* "This product includes software developed by the
*Apache Software Foundation (http://www.apache.org/)."
*Alternately, this acknowlegement may appear in the software itself,
*if and wherever such third-party acknowlegements normally appear.
*
* 4. The names "The Jakarta Project", "Tomcat", and "Apache Software
*Foundation" must not be used to endorse or promote products derived
*from this software without prior written permission. For written
*permission, please contact [EMAIL PROTECTED]
*
* 5. Products derived from this software may not be called "Apache"
*nor may "Apache" appear in their names without prior written
*permission of the Apache Group.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECI