leif 2004/03/10 05:59:34
Modified:
instrument-manager/src/java/org/apache/excalibur/instrument/manager/http/server
HTTPServer.java
Log:
Add additional debug output that was useful in tracking down some performance
problems. Also was not flushing output in the event of an error.
Revision Changes Path
1.6 +12 -5
avalon-excalibur/instrument-manager/src/java/org/apache/excalibur/instrument/manager/http/server/HTTPServer.java
Index: HTTPServer.java
===================================================================
RCS file:
/home/cvs/avalon-excalibur/instrument-manager/src/java/org/apache/excalibur/instrument/manager/http/server/HTTPServer.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- HTTPServer.java 6 Mar 2004 14:01:28 -0000 1.5
+++ HTTPServer.java 10 Mar 2004 13:59:34 -0000 1.6
@@ -142,10 +142,6 @@
// and all encoded variables. All of the following lines until a pair of
// Line feeds are headers and can be skipped for now.
- // Get the actual output stream so we can write the response.
- ByteArrayOutputStream hbos = new ByteArrayOutputStream();
- PrintWriter out = new PrintWriter( hbos );
-
// Read the input header
BufferedReader r = new BufferedReader( new InputStreamReader( is ) );
String request = r.readLine();
@@ -163,8 +159,18 @@
}
while ( ( header != null ) && ( header.length() > 0 ) );
+ if ( getLogger().isDebugEnabled() )
+ {
+ getLogger().debug( "got request: " + request + " : "
+ + Thread.currentThread().getName() );
+ }
+
Throwable error = null;
+ // Get the actual output stream so we can write the response.
+ ByteArrayOutputStream hbos = new ByteArrayOutputStream();
+ PrintWriter out = new PrintWriter( hbos );
+
// Parse the header to make sure it is valid.
StringTokenizer st = new StringTokenizer( request, " " );
if ( st.countTokens() == 3 )
@@ -353,6 +359,7 @@
// Write the contents of the headers.
out.flush();
os.write( hbos.toByteArray() );
+ os.flush();
return false;
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]