cvs commit: jakarta-tomcat-connectors/jk/java/org/apache/jk/server JkCoyoteHandler.java
billbarker2005/05/19 22:52:02 Modified:jk/java/org/apache/jk/common HandlerRequest.java JkInputStream.java jk/java/org/apache/jk/core MsgContext.java jk/java/org/apache/jk/server JkCoyoteHandler.java Log: Implement the BODY_REPLAY Action for Form auth. Revision ChangesPath 1.46 +1 -1 jakarta-tomcat-connectors/jk/java/org/apache/jk/common/HandlerRequest.java Index: HandlerRequest.java === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/java/org/apache/jk/common/HandlerRequest.java,v retrieving revision 1.45 retrieving revision 1.46 diff -u -r1.45 -r1.46 --- HandlerRequest.java 15 May 2005 19:14:38 - 1.45 +++ HandlerRequest.java 20 May 2005 05:52:02 - 1.46 @@ -329,7 +329,7 @@ static int count = 0; private Request checkRequest(MsgContext ep) { -Request req=(Request)ep.getRequest(); +Request req=ep.getRequest(); if( req==null ) { req=new Request(); Response res=new Response(); 1.18 +16 -0 jakarta-tomcat-connectors/jk/java/org/apache/jk/common/JkInputStream.java Index: JkInputStream.java === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/java/org/apache/jk/common/JkInputStream.java,v retrieving revision 1.17 retrieving revision 1.18 diff -u -r1.17 -r1.18 --- JkInputStream.java15 May 2005 19:14:38 - 1.17 +++ JkInputStream.java20 May 2005 05:52:02 - 1.18 @@ -49,6 +49,7 @@ private boolean end_of_stream=false; private boolean isEmpty = true; private boolean isFirst = true; +private boolean isReplay = false; static { // Make certain HttpMessages is loaded for SecurityManager @@ -72,6 +73,7 @@ end_of_stream = false; isEmpty = true; isFirst = true; +isReplay = false; bodyBuff.recycle(); tempMB.recycle(); } @@ -194,6 +196,9 @@ { // If the server returns an empty packet, assume that that end of // the stream has been reached (yuck -- fix protocol??). +if(isReplay) { +end_of_stream = true; // we've read everything there is +} if (end_of_stream) { if( log.isDebugEnabled() ) log.debug(refillReadBuffer: end of stream ); @@ -271,4 +276,15 @@ mc.getSource().send( outputMsg, mc ); } +/** + * Set the replay buffer for Form auth + */ +public void setReplay(ByteChunk replay) { +isFirst = false; +isEmpty = false; +isReplay = true; +bodyBuff.setBytes(replay.getBytes(), replay.getStart(), replay.getLength()); +} + + } 1.12 +6 -1 jakarta-tomcat-connectors/jk/java/org/apache/jk/core/MsgContext.java Index: MsgContext.java === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/java/org/apache/jk/core/MsgContext.java,v retrieving revision 1.11 retrieving revision 1.12 diff -u -r1.11 -r1.12 --- MsgContext.java 15 May 2005 19:14:38 - 1.11 +++ MsgContext.java 20 May 2005 05:52:02 - 1.12 @@ -156,7 +156,7 @@ res.setHook(this); } -public final Object getRequest() { +public final Request getRequest() { return req; } @@ -348,6 +348,11 @@ } else if( actionCode==ActionCode.ACTION_ACK ) { if( log.isTraceEnabled() ) log.trace(ACK ); +} else if ( actionCode == ActionCode.ACTION_REQ_SET_BODY_REPLAY ) { +if( log.isTraceEnabled() ) +log.trace(Replay ); +ByteChunk bc = (ByteChunk)param; +jkIS.setReplay(bc); } } 1.63 +3 -4 jakarta-tomcat-connectors/jk/java/org/apache/jk/server/JkCoyoteHandler.java Index: JkCoyoteHandler.java === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/java/org/apache/jk/server/JkCoyoteHandler.java,v retrieving revision 1.62 retrieving revision 1.63 diff -u -r1.62 -r1.63 --- JkCoyoteHandler.java 15 May 2005 19:14:38 - 1.62 +++ JkCoyoteHandler.java 20 May 2005 05:52:02 - 1.63 @@ -181,13 +181,12 @@ // Jk handler implementation // Jk Handler mehod public int invoke( Msg msg, MsgContext ep ) -throws IOException -{ +throws IOException { if( ep.isLogTimeEnabled() ) ep.setLong( MsgContext.TIMER_PRE_REQUEST,
cvs commit: jakarta-tomcat-connectors/jk/java/org/apache/jk/server JkCoyoteHandler.java
yoavs 2005/03/24 20:02:34 Modified:webapps/docs changelog.xml jk/java/org/apache/jk/server JkCoyoteHandler.java Log: Bugzilla 32741. Revision ChangesPath 1.267 +4 -1 jakarta-tomcat-catalina/webapps/docs/changelog.xml Index: changelog.xml === RCS file: /home/cvs/jakarta-tomcat-catalina/webapps/docs/changelog.xml,v retrieving revision 1.266 retrieving revision 1.267 diff -u -r1.266 -r1.267 --- changelog.xml 25 Mar 2005 03:56:55 - 1.266 +++ changelog.xml 25 Mar 2005 04:02:34 - 1.267 @@ -149,11 +149,14 @@ lot better (remm) /update update -bug33857/bug: Update information on automatic mod_jk configuration in Apache-HowTo. (yoavs) +bug33857/bug: Update information on automatic mod_jk configuration in Apache-HowTo (yoavs) /update fix Fix sync block placement in Mapper.addContext (remm) /fix + fix +bug32741/bug: Fix spelling of committed [patch from Ben Souther] (yoavs) + /fix /changelog /subsection 1.61 +1 -1 jakarta-tomcat-connectors/jk/java/org/apache/jk/server/JkCoyoteHandler.java Index: JkCoyoteHandler.java === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/java/org/apache/jk/server/JkCoyoteHandler.java,v retrieving revision 1.60 retrieving revision 1.61 diff -u -r1.60 -r1.61 --- JkCoyoteHandler.java 24 Mar 2005 15:31:16 - 1.60 +++ JkCoyoteHandler.java 25 Mar 2005 04:02:34 - 1.61 @@ -419,7 +419,7 @@ if( res.isCommitted() ) { if( log.isInfoEnabled() ) -log.info(Response already commited ); +log.info(Response already committed ); } else { try { appendHead( res ); - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-tomcat-connectors/jk/java/org/apache/jk/server JkCoyoteHandler.java
billbarker2005/02/02 19:36:57 Modified:jk/java/org/apache/jk/server JkCoyoteHandler.java Log: Cleanup exception handling in action, and remember error state so that we can close the connection without having to attempt another read. Fix for Bug #33374 Reported By: Lars George [EMAIL PROTECTED] Revision ChangesPath 1.59 +112 -90 jakarta-tomcat-connectors/jk/java/org/apache/jk/server/JkCoyoteHandler.java Index: JkCoyoteHandler.java === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/java/org/apache/jk/server/JkCoyoteHandler.java,v retrieving revision 1.58 retrieving revision 1.59 diff -u -r1.58 -r1.59 --- JkCoyoteHandler.java 11 Jan 2005 13:37:45 - 1.58 +++ JkCoyoteHandler.java 3 Feb 2005 03:36:57 - 1.59 @@ -96,6 +96,7 @@ public final int JK_STATUS_NEW=0; public final int JK_STATUS_HEAD=1; public final int JK_STATUS_CLOSED=2; +public final int JK_STATUS_ERROR=3; /** Set a property. Name is a component.property. JMX should * be used instead. @@ -311,11 +312,13 @@ res.finish(); } -ep.setStatus( JK_STATUS_NEW ); - req.recycle(); req.updateCounters(); res.recycle(); +if( ep.getStatus() == JK_STATUS_ERROR ) { +return ERROR; +} +ep.setStatus( JK_STATUS_NEW ); rp.setStage(Constants.STAGE_KEEPALIVE); return OK; } @@ -410,106 +413,125 @@ // Coyote Action implementation public void action(ActionCode actionCode, Object param) { -try { -if( actionCode==ActionCode.ACTION_COMMIT ) { -if( log.isDebugEnabled() ) log.debug(COMMIT ); -org.apache.coyote.Response res=(org.apache.coyote.Response)param; - -if( res.isCommitted() ) { -if( log.isInfoEnabled() ) -log.info(Response already commited ); -} else { +if( actionCode==ActionCode.ACTION_COMMIT ) { +if( log.isDebugEnabled() ) log.debug(COMMIT ); +org.apache.coyote.Response res=(org.apache.coyote.Response)param; + +if( res.isCommitted() ) { +if( log.isInfoEnabled() ) +log.info(Response already commited ); +} else { +try { appendHead( res ); +} catch(IOException iex) { +log.warn(Unable to send headers,iex); +MsgContext ep=(MsgContext)res.getNote( epNote ); +ep.setStatus(JK_STATUS_ERROR); } -} else if( actionCode==ActionCode.ACTION_RESET ) { -if( log.isDebugEnabled() ) -log.debug(RESET ); - -} else if( actionCode==ActionCode.ACTION_CLIENT_FLUSH ) { -if( log.isDebugEnabled() ) log.debug(CLIENT_FLUSH ); -org.apache.coyote.Response res=(org.apache.coyote.Response)param; -MsgContext ep=(MsgContext)res.getNote( epNote ); -ep.setType( JkHandler.HANDLE_FLUSH ); +} +} else if( actionCode==ActionCode.ACTION_RESET ) { +if( log.isDebugEnabled() ) +log.debug(RESET ); + +} else if( actionCode==ActionCode.ACTION_CLIENT_FLUSH ) { +if( log.isDebugEnabled() ) log.debug(CLIENT_FLUSH ); +org.apache.coyote.Response res=(org.apache.coyote.Response)param; +MsgContext ep=(MsgContext)res.getNote( epNote ); +ep.setType( JkHandler.HANDLE_FLUSH ); +try { ep.getSource().flush( null, ep ); - -} else if( actionCode==ActionCode.ACTION_CLOSE ) { -if( log.isDebugEnabled() ) log.debug(CLOSE ); - -org.apache.coyote.Response res=(org.apache.coyote.Response)param; -MsgContext ep=(MsgContext)res.getNote( epNote ); -if( ep.getStatus()== JK_STATUS_CLOSED ) { -// Double close - it may happen with forward -if( log.isDebugEnabled() ) log.debug(Double CLOSE - forward ? + res.getRequest().requestURI() ); -return; -} +} catch(IOException iex) { +// This is logged elsewhere, so debug only here +log.debug(Error during flush,iex); +res.setErrorException(iex); +ep.setStatus(JK_STATUS_ERROR); +} + +} else if( actionCode==ActionCode.ACTION_CLOSE ) { +if( log.isDebugEnabled() )
cvs commit: jakarta-tomcat-connectors/jk/java/org/apache/jk/server JkCoyoteHandler.java
pero2004/11/11 06:55:29 Modified:jk/java/org/apache/jk/server JkCoyoteHandler.java Log: add getAttributeNames to access all Connector attributes Revision ChangesPath 1.57 +5 -0 jakarta-tomcat-connectors/jk/java/org/apache/jk/server/JkCoyoteHandler.java Index: JkCoyoteHandler.java === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/java/org/apache/jk/server/JkCoyoteHandler.java,v retrieving revision 1.56 retrieving revision 1.57 diff -u -r1.56 -r1.57 --- JkCoyoteHandler.java 5 Jun 2004 05:19:04 - 1.56 +++ JkCoyoteHandler.java 11 Nov 2004 14:55:28 - 1.57 @@ -25,6 +25,7 @@ import java.security.AccessController; import java.security.PrivilegedActionException; import java.security.PrivilegedAction; +import java.util.Iterator; import javax.management.MBeanServer; import javax.management.ObjectName; @@ -109,6 +110,10 @@ public String getProperty( String name ) { return properties.getProperty(name) ; +} + +public Iterator getAttributeNames() { + return properties.keySet().iterator(); } /** Pass config info - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-tomcat-connectors/jk/java/org/apache/jk/server JkCoyoteHandler.java
billbarker2004/06/04 22:19:04 Modified:jk/java/org/apache/jk/common HandlerRequest.java jk/java/org/apache/jk/server JkCoyoteHandler.java Log: Adding stage information to the RequestInfo. Revision ChangesPath 1.37 +4 -3 jakarta-tomcat-connectors/jk/java/org/apache/jk/common/HandlerRequest.java Index: HandlerRequest.java === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/java/org/apache/jk/common/HandlerRequest.java,v retrieving revision 1.36 retrieving revision 1.37 diff -u -r1.36 -r1.37 --- HandlerRequest.java 31 May 2004 04:48:54 - 1.36 +++ HandlerRequest.java 5 Jun 2004 05:19:04 - 1.37 @@ -29,6 +29,7 @@ import org.apache.coyote.RequestGroupInfo; import org.apache.coyote.RequestInfo; import org.apache.coyote.Response; +import org.apache.coyote.Constants; import org.apache.jk.core.JkHandler; import org.apache.jk.core.Msg; import org.apache.jk.core.MsgContext; @@ -441,6 +442,8 @@ } } + RequestInfo rp = req.getRequestProcessor(); + rp.setStage(Constants.STAGE_PARSE); MessageBytes tmpMB2 = (MessageBytes)req.getNote(WorkerEnv.SSL_CERT_NOTE); if(tmpMB2 != null) { tmpMB2.recycle(); @@ -480,9 +483,7 @@ decodeAttributes( ep, msg, req, tmpMB ); -// if(req.getSecure() ) { -// req.setScheme(req.SCHEME_HTTPS); -// } + rp.setStage(Constants.STAGE_PREPARE); MessageBytes valueMB = req.getMimeHeaders().getValue(host); parseHost(valueMB, req); // set cookies on request now that we have all headers 1.56 +5 -1 jakarta-tomcat-connectors/jk/java/org/apache/jk/server/JkCoyoteHandler.java Index: JkCoyoteHandler.java === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/java/org/apache/jk/server/JkCoyoteHandler.java,v retrieving revision 1.55 retrieving revision 1.56 diff -u -r1.55 -r1.56 --- JkCoyoteHandler.java 31 May 2004 04:48:54 - 1.55 +++ JkCoyoteHandler.java 5 Jun 2004 05:19:04 - 1.56 @@ -36,6 +36,8 @@ import org.apache.coyote.ProtocolHandler; import org.apache.coyote.Request; import org.apache.coyote.Response; +import org.apache.coyote.RequestInfo; +import org.apache.coyote.Constants; import org.apache.jk.common.HandlerRequest; import org.apache.jk.common.JkInputStream; import org.apache.jk.common.MsgAjp; @@ -292,7 +294,8 @@ res.setNote( epNote, ep ); ep.setStatus( JK_STATUS_HEAD ); - + RequestInfo rp = req.getRequestProcessor(); + rp.setStage(Constants.STAGE_SERVICE); try { adapter.service( req, res ); } catch( Exception ex ) { @@ -307,6 +310,7 @@ req.recycle(); req.updateCounters(); res.recycle(); + rp.setStage(Constants.STAGE_KEEPALIVE); return OK; } - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-tomcat-connectors/jk/java/org/apache/jk/server JkCoyoteHandler.java
billbarker2004/05/30 21:48:54 Modified:jk/java/org/apache/jk/apr AprImpl.java jk/java/org/apache/jk/common ChannelJni.java ChannelSocket.java ChannelUn.java HandlerRequest.java JkInputStream.java JniHandler.java jk/java/org/apache/jk/core MsgContext.java jk/java/org/apache/jk/server JkCoyoteHandler.java Added: jk/java/org/apache/jk/core JkChannel.java Log: Clean up the API a bit to make it easier to improve. The big change is that the 'source' attribute of MsgContext is now a JkChannel instead of an arbitrary JkHandler. This allows the Actions to bypass the 'invoke' path (which is really for incoming requests), and makes Request registration easier. Other than Request registration, there really isn't much functionality change here. However, now JK finally plays nice with the Manager status servlet (at least with the Socket and Unix channels). Also, the memory leak with the JNI channel is finally gone (since it doesn't implement Request registration). Revision ChangesPath 1.31 +2 -1 jakarta-tomcat-connectors/jk/java/org/apache/jk/apr/AprImpl.java Index: AprImpl.java === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/java/org/apache/jk/apr/AprImpl.java,v retrieving revision 1.30 retrieving revision 1.31 diff -u -r1.30 -r1.31 --- AprImpl.java 24 Feb 2004 08:48:44 - 1.30 +++ AprImpl.java 31 May 2004 04:48:54 - 1.31 @@ -22,6 +22,7 @@ import java.util.Hashtable; import org.apache.jk.core.JkHandler; import org.apache.jk.core.MsgContext; +import org.apache.jk.core.JkChannel; /** Implements the interface with the APR library. This is for internal-use * only. The goal is to use 'natural' mappings for user code - for example @@ -167,7 +168,7 @@ public static Object createJavaContext(String type, long cContext) { // XXX will be an instance method, fields accessible directly AprImpl apr=aprSingleton; -JkHandler jkH=(JkHandler)apr.jkHandlers.get( type ); +JkChannel jkH=(JkChannel)apr.jkHandlers.get( type ); if( jkH==null ) return null; MsgContext ep=jkH.createMsgContext(); 1.17 +21 -5 jakarta-tomcat-connectors/jk/java/org/apache/jk/common/ChannelJni.java Index: ChannelJni.java === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/java/org/apache/jk/common/ChannelJni.java,v retrieving revision 1.16 retrieving revision 1.17 diff -u -r1.16 -r1.17 --- ChannelJni.java 24 Feb 2004 08:48:42 - 1.16 +++ ChannelJni.java 31 May 2004 04:48:54 - 1.17 @@ -21,13 +21,14 @@ import org.apache.jk.core.JkHandler; import org.apache.jk.core.Msg; import org.apache.jk.core.MsgContext; +import org.apache.jk.core.JkChannel; - +import org.apache.coyote.Request; /** Pass messages using jni * * @author Costin Manolache */ -public class ChannelJni extends JniHandler { +public class ChannelJni extends JniHandler implements JkChannel { int receivedNote=1; public ChannelJni() { @@ -92,6 +93,7 @@ public int send( Msg msg, MsgContext ep ) throws IOException { +ep.setNote( receivedNote, null ); if( log.isDebugEnabled() ) log.debug(ChannelJni.send: + msg ); int rc=super.nativeDispatch( msg, ep, JK_HANDLE_JNI_DISPATCH, 0); @@ -104,6 +106,22 @@ return rc; } +public int flush(Msg msg, MsgContext ep) throws IOException { +ep.setNote( receivedNote, null ); +return OK; +} + +public boolean isSameAddress(MsgContext ep) { +return true; +} + +public void registerRequest(Request req, MsgContext ep, int count) { +// Not supported. +} + +public String getChannelName() { +return getName(); +} /** Receive a packet from the C side. This is called from the C * code using invocation, but only for the first packet - to avoid * recursivity and thread problems. @@ -136,11 +154,9 @@ case JkHandler.HANDLE_RECEIVE_PACKET: return receive( msg, ep ); case JkHandler.HANDLE_SEND_PACKET: -ep.setNote( receivedNote, null ); return send( msg, ep ); case JkHandler.HANDLE_FLUSH: -ep.setNote( receivedNote, null ); -return 0; +return flush(msg, ep); } // Reset receivedNote. It'll be visible only after a SEND and before a receive. 1.46 +64 -12 jakarta-tomcat-connectors/jk/java/org/apache/jk/common/ChannelSocket.java Index:
Re: cvs commit: jakarta-tomcat-connectors/jk/java/org/apache/jk/server JkCoyoteHandler.java
Het adres [EMAIL PROTECTED] is voorlopig niet meer in gebruik vanwege grote hoeveelheden virusmails die daarop binnenkomen. Gebruik het nieuwe adres dat op de website staat (linksonder). Excuses voor het ongemak! - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-tomcat-connectors/jk/java/org/apache/jk/server JkCoyoteHandler.java
billbarker2004/03/24 19:01:21 Modified:jk/java/org/apache/jk/server JkCoyoteHandler.java Log: Make certain that the endpoint is closed, even if Apache has already dropped the connection. IOExceptions here are pretty harmless, since they mean that Apache has already finished with the page, and so doesn't need to be told that the page is done. Fix for Bug #27917. Revision ChangesPath 1.53 +12 -9 jakarta-tomcat-connectors/jk/java/org/apache/jk/server/JkCoyoteHandler.java Index: JkCoyoteHandler.java === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/java/org/apache/jk/server/JkCoyoteHandler.java,v retrieving revision 1.52 retrieving revision 1.53 diff -u -r1.52 -r1.53 --- JkCoyoteHandler.java 24 Feb 2004 08:48:41 - 1.52 +++ JkCoyoteHandler.java 25 Mar 2004 03:01:21 - 1.53 @@ -173,7 +173,7 @@ jkInputStream); } catch( Exception ex ) { -ex.printStackTrace(); +log.error(Error during init,ex); } } @@ -189,7 +189,7 @@ } getJkMain().start(); } catch( Exception ex ) { -ex.printStackTrace(); +log.error(Error during startup,ex); } } @@ -295,7 +295,7 @@ try { adapter.service( req, res ); } catch( Exception ex ) { -ex.printStackTrace(); +log.info(Error servicing request + req,ex); } if(ep.getStatus() != JK_STATUS_CLOSED) { res.finish(); @@ -439,13 +439,16 @@ msg.reset(); msg.appendByte( HandlerRequest.JK_AJP13_END_RESPONSE ); msg.appendByte( 1 ); - -ep.setType( JkHandler.HANDLE_SEND_PACKET ); -ep.getSource().invoke( msg, ep ); - -ep.setType( JkHandler.HANDLE_FLUSH ); -ep.getSource().invoke( msg, ep ); +try { +ep.setType( JkHandler.HANDLE_SEND_PACKET ); +ep.getSource().invoke( msg, ep ); + +ep.setType( JkHandler.HANDLE_FLUSH ); +ep.getSource().invoke( msg, ep ); +} catch(IOException iex) { +log.debug(Connection error ending request.,iex); +} ep.setStatus(JK_STATUS_CLOSED ); if( logTime.isDebugEnabled() ) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-tomcat-connectors/jk/java/org/apache/jk/server JkCoyoteHandler.java
billbarker2004/01/27 00:00:12 Modified:jk/java/org/apache/jk/server JkCoyoteHandler.java Log: Fix stupid infinite recursion bug. Revision ChangesPath 1.51 +9 -2 jakarta-tomcat-connectors/jk/java/org/apache/jk/server/JkCoyoteHandler.java Index: JkCoyoteHandler.java === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/java/org/apache/jk/server/JkCoyoteHandler.java,v retrieving revision 1.50 retrieving revision 1.51 diff -u -r1.50 -r1.51 --- JkCoyoteHandler.java 27 Jan 2004 06:43:18 - 1.50 +++ JkCoyoteHandler.java 27 Jan 2004 08:00:12 - 1.51 @@ -128,6 +128,7 @@ int obNote; int epNote; int inputStreamNote; +private boolean paused = false; Adapter adapter; protected JkMain jkMain=null; @@ -236,11 +237,17 @@ } public void pause() throws Exception { -getJkMain().pause(); +if(!paused) { +paused = true; +getJkMain().pause(); +} } public void resume() throws Exception { -getJkMain().resume(); +if(paused) { +paused = false; +getJkMain().resume(); +} } public void destroy() { - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: cvs commit: jakarta-tomcat-connectors/jk/java/org/apache/jk/server JkCoyoteHandler.java JkMain.java
[EMAIL PROTECTED] wrote: billbarker2004/01/26 22:43:18 Modified:jk/java/org/apache/jk/common ChannelSocket.java JniHandler.java jk/java/org/apache/jk/core JkHandler.java jk/java/org/apache/jk/server JkCoyoteHandler.java JkMain.java Log: Adding support for the new pause/resume protocol. You beat me to it. Thanks :) Rémy - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-tomcat-connectors/jk/java/org/apache/jk/server JkCoyoteHandler.java
remm2004/01/26 10:16:44 Modified:jk/java/org/apache/jk/server JkCoyoteHandler.java Log: - Implement clean shutdown of the connectors (my third proposal). - Add pause and resume methods. - FIXME: Not implemented for JK yet. Revision ChangesPath 1.49 +8 -0 jakarta-tomcat-connectors/jk/java/org/apache/jk/server/JkCoyoteHandler.java Index: JkCoyoteHandler.java === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/java/org/apache/jk/server/JkCoyoteHandler.java,v retrieving revision 1.48 retrieving revision 1.49 diff -u -r1.48 -r1.49 --- JkCoyoteHandler.java 16 Jan 2004 03:14:11 - 1.48 +++ JkCoyoteHandler.java 26 Jan 2004 18:16:44 - 1.49 @@ -235,6 +235,14 @@ } } +public void pause() throws Exception { +// FIXME +} + +public void resume() throws Exception { +// FIXME +} + public void destroy() { if( !started ) return; - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-tomcat-connectors/jk/java/org/apache/jk/server JkCoyoteHandler.java JkMain.java
billbarker2004/01/26 22:43:18 Modified:jk/java/org/apache/jk/common ChannelSocket.java JniHandler.java jk/java/org/apache/jk/core JkHandler.java jk/java/org/apache/jk/server JkCoyoteHandler.java JkMain.java Log: Adding support for the new pause/resume protocol. Revision ChangesPath 1.39 +55 -15 jakarta-tomcat-connectors/jk/java/org/apache/jk/common/ChannelSocket.java Index: ChannelSocket.java === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/java/org/apache/jk/common/ChannelSocket.java,v retrieving revision 1.38 retrieving revision 1.39 diff -u -r1.38 -r1.39 --- ChannelSocket.java16 Jan 2004 06:48:20 - 1.38 +++ ChannelSocket.java27 Jan 2004 06:43:18 - 1.39 @@ -277,13 +277,38 @@ /* */ ServerSocket sSocket; -int socketNote=1; -int isNote=2; -int osNote=3; -int notifNote=4; +final int socketNote=1; +final int isNote=2; +final int osNote=3; +final int notifNote=4; +boolean paused = false; + +public void pause() throws Exception { +synchronized(this) { +paused = true; +unLockSocket(); +} +} + +public void resume() throws Exception { +synchronized(this) { +paused = false; +notify(); +} +} + public void accept( MsgContext ep ) throws IOException { if( sSocket==null ) return; +synchronized(this) { +while(paused) { +try{ +wait(); +} catch(InterruptedException ie) { +//Ignore, since can't happen +} +} +} Socket s=sSocket.accept(); ep.setNote( socketNote, s ); if(log.isDebugEnabled() ) @@ -412,6 +437,20 @@ s.close(); } +private void unLockSocket() throws IOException { + // Need to create a connection to unlock the accept(); + Socket s; + if (inet == null) { + s=new Socket(127.0.0.1, port ); + }else{ + s=new Socket(inet, port ); + // setting soLinger to a small value will help shutdown the + // connection quicker + s.setSoLinger(true, 0); + } + s.close(); +} + public void destroy() throws IOException { running = false; try { @@ -420,17 +459,10 @@ return; tp.shutdown(); -// Need to create a connection to unlock the accept(); -Socket s; -if (inet == null) { -s=new Socket(127.0.0.1, port ); -}else{ -s=new Socket(inet, port ); -// setting soLinger to a small value will help shutdown the -// connection quicker -s.setSoLinger(true, 0); -} -s.close(); + if(!paused) { + unLockSocket(); + } + sSocket.close(); // XXX? if( tpOName != null ) { @@ -575,6 +607,11 @@ log.debug(Accepting ajp connections on + port); while( running ) { try { +synchronized(this) { +while(paused) { +wait(); +} +} MsgContext ep=new MsgContext(); ep.setSource(this); ep.setWorkerEnv( wEnv ); @@ -600,6 +637,9 @@ try { MsgAjp recv=new MsgAjp(); while( running ) { +if(paused) { // Drop the connection on pause +break; +} int status= this.receive( recv, ep ); if( status = 0 ) { if( status==-3) 1.14 +25 -0 jakarta-tomcat-connectors/jk/java/org/apache/jk/common/JniHandler.java Index: JniHandler.java === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/java/org/apache/jk/common/JniHandler.java,v retrieving revision 1.13 retrieving revision 1.14 diff -u -r1.13 -r1.14 --- JniHandler.java 18 Sep 2003 16:21:00 - 1.13 +++ JniHandler.java 27 Jan 2004 06:43:18 - 1.14 @@ -103,6 +103,7 @@ public static final int MSG_NOTE=0; public static final int C2B_NOTE=1; public static final int MB_NOTE=2; +private boolean paused = false; public JniHandler() { @@ -177,11 +178,35 @@ msg.appendByteChunk( bc ); } +
Re: cvs commit: jakarta-tomcat-connectors/jk/java/org/apache/jk/server JkCoyoteHandler.java
[EMAIL PROTECTED] wrote: billbarker2004/01/15 19:14:11 Modified:jk/java/org/apache/jk/server JkCoyoteHandler.java Log: Fix JMX self-registration when loading the normal way. I don't understand why, but two thread pools are registeres (and I have only one connector): Catalina:type=ThreadPool,name=jk8009 Catalina:type=ThreadPool,name=jk8010 ? The good part is that this is automagically picked up by the status servlet :) I don't know if the scoreboard will work, but it's a start. I remember some people who wanted to get status info about JK. Rémy - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: cvs commit: jakarta-tomcat-connectors/jk/java/org/apache/jk/server JkCoyoteHandler.java
- Original Message - From: Remy Maucherat [EMAIL PROTECTED] To: Tomcat Developers List [EMAIL PROTECTED] Sent: Friday, January 16, 2004 2:15 AM Subject: Re: cvs commit: jakarta-tomcat-connectors/jk/java/org/apache/jk/server JkCoyoteHandler.java [EMAIL PROTECTED] wrote: billbarker2004/01/15 19:14:11 Modified:jk/java/org/apache/jk/server JkCoyoteHandler.java Log: Fix JMX self-registration when loading the normal way. I don't understand why, but two thread pools are registeres (and I have only one connector): Catalina:type=ThreadPool,name=jk8009 Catalina:type=ThreadPool,name=jk8010 ? It seems that having the JMX registration broken was hiding all sorts of bugs in Jk. It seems that all the Handlers are now added to the WorkerEnv twice (once by JkMain and once during JMX registration). I'm going to have to think about this one, since I don't really want to have to JMX register the connectors in 3.3.2. The good part is that this is automagically picked up by the status servlet :) I don't know if the scoreboard will work, but it's a start. I remember some people who wanted to get status info about JK. Rémy - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] This message is intended only for the use of the person(s) listed above as the intended recipient(s), and may contain information that is PRIVILEGED and CONFIDENTIAL. If you are not an intended recipient, you may not read, copy, or distribute this message or any attachment. If you received this communication in error, please notify us immediately by e-mail and then delete all copies of this message and any attachments. In addition you should be aware that ordinary (unencrypted) e-mail sent through the Internet is not secure. Do not send confidential or sensitive information, such as social security numbers, account numbers, personal identification numbers and passwords, to us via ordinary (unencrypted) e-mail. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-tomcat-connectors/jk/java/org/apache/jk/server JkCoyoteHandler.java
billbarker2004/01/15 19:14:11 Modified:jk/java/org/apache/jk/server JkCoyoteHandler.java Log: Fix JMX self-registration when loading the normal way. Revision ChangesPath 1.48 +8 -8 jakarta-tomcat-connectors/jk/java/org/apache/jk/server/JkCoyoteHandler.java Index: JkCoyoteHandler.java === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/java/org/apache/jk/server/JkCoyoteHandler.java,v retrieving revision 1.47 retrieving revision 1.48 diff -u -r1.47 -r1.48 --- JkCoyoteHandler.java 7 Jan 2004 05:32:44 - 1.47 +++ JkCoyoteHandler.java 16 Jan 2004 03:14:11 - 1.48 @@ -182,14 +182,6 @@ jkMain=new JkMain(); jkMain.setWorkerEnv(wEnv); -if( oname != null ) { -try { -Registry.getRegistry().registerComponent(jkMain, oname.getDomain(), -JkMain, type=JkMain); -} catch (Exception e) { -log.error( Error registering jkmain + e ); -} -} } return jkMain; } @@ -229,6 +221,14 @@ public void start() { try { +if( oname != null getJkMain().getDomain() == null) { +try { +Registry.getRegistry().registerComponent(getJkMain(), oname.getDomain(), +JkMain, type=JkMain); +} catch (Exception e) { +log.error( Error registering jkmain + e ); +} +} getJkMain().start(); } catch( Exception ex ) { ex.printStackTrace(); - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-tomcat-connectors/jk/java/org/apache/jk/server JkCoyoteHandler.java
billbarker2004/01/06 21:32:44 Modified:jk/java/org/apache/jk/server JkCoyoteHandler.java Log: Adding the required PAs to allow the Coyote-Jk connector to play in the sandbox. Fix for Bug #25819. Reported By: Dario Bonino [EMAIL PROTECTED] Revision ChangesPath 1.47 +39 -2 jakarta-tomcat-connectors/jk/java/org/apache/jk/server/JkCoyoteHandler.java Index: JkCoyoteHandler.java === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/java/org/apache/jk/server/JkCoyoteHandler.java,v retrieving revision 1.46 retrieving revision 1.47 diff -u -r1.46 -r1.47 --- JkCoyoteHandler.java 30 Sep 2003 04:17:37 - 1.46 +++ JkCoyoteHandler.java 7 Jan 2004 05:32:44 - 1.47 @@ -64,6 +64,10 @@ import java.net.InetAddress; import java.security.cert.CertificateFactory; import java.security.cert.X509Certificate; +import java.security.PrivilegedExceptionAction; +import java.security.AccessController; +import java.security.PrivilegedActionException; +import java.security.PrivilegedAction; import javax.management.MBeanServer; import javax.management.ObjectName; @@ -106,6 +110,17 @@ private static org.apache.commons.logging.Log logTime= org.apache.commons.logging.LogFactory.getLog( org.apache.jk.REQ_TIME ); +// --- DoPrivileged +private final class StatusLinePrivilegedAction implements PrivilegedAction { + int status; + StatusLinePrivilegedAction(int status) { + this.status = status; + } + public Object run() { + return HttpMessages.getMessage(status); + } +} + int headersMsgNote; int c2bConvertersNote; int tmpMessageBytesNote; @@ -330,7 +345,24 @@ C2BConverter c2b=(C2BConverter)res.getNote( utfC2bNote ); if( c2b==null ) { -c2b=new C2BConverter( UTF8 ); +if(System.getSecurityManager() != null) { +try { +c2b = (C2BConverter) +AccessController.doPrivileged( + new PrivilegedExceptionAction () { + public Object run() + throws IOException{ + return new C2BConverter( UTF8 ); + } + }); +} catch(PrivilegedActionException pae) { +Exception ex = pae.getException(); +if(ex instanceof IOException) +throw (IOException)ex; +} +} else { +c2b=new C2BConverter( UTF8 ); + } res.setNote( utfC2bNote, c2b ); } @@ -347,7 +379,12 @@ } String message=res.getMessage(); if( message==null ){ -message= HttpMessages.getMessage(res.getStatus()); + if( System.getSecurityManager() != null ) { + message = (String)AccessController.doPrivileged( + new StatusLinePrivilegedAction(res.getStatus())); + } else { + message= HttpMessages.getMessage(res.getStatus()); + } } else { message = message.replace('\n', ' ').replace('\r', ' '); } - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: cvs commit: jakarta-tomcat-connectors/jk/java/org/apache/jk/server JkCoyoteHandler.java
- Original Message - From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, January 06, 2004 9:32 PM Subject: cvs commit: jakarta-tomcat-connectors/jk/java/org/apache/jk/server JkCoyoteHandler.java billbarker2004/01/06 21:32:44 Modified:jk/java/org/apache/jk/server JkCoyoteHandler.java Log: Adding the required PAs to allow the Coyote-Jk connector to play in the sandbox. I'm not really happy with how this turned out. The C2BC issue could actually get solved by moving the check for 'null', but it just didn't seem worth it (since it is a re-used component, the PA is invoked rarely). However, invoking a PA for the status line bothers me. My suggestion is to change o.a.t.u.http.HttpMessages to make 'getMessage' an instance (instead of the current static) method, and make everyone that wants to use it create an instance (at a point where they know the call-stack is clean). Excess memory usage should be pretty small, and you avoid a big hit with the PA. As always, I'm volunteering to do the code-monkey (copy; Pier) part of the project for TC 3.3.x-5.x. This message is intended only for the use of the person(s) listed above as the intended recipient(s), and may contain information that is PRIVILEGED and CONFIDENTIAL. If you are not an intended recipient, you may not read, copy, or distribute this message or any attachment. If you received this communication in error, please notify us immediately by e-mail and then delete all copies of this message and any attachments. In addition you should be aware that ordinary (unencrypted) e-mail sent through the Internet is not secure. Do not send confidential or sensitive information, such as social security numbers, account numbers, personal identification numbers and passwords, to us via ordinary (unencrypted) e-mail. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-tomcat-connectors/jk/java/org/apache/jk/server JkCoyoteHandler.java
billbarker2003/09/29 21:17:37 Modified:jk/java/org/apache/jk/server JkCoyoteHandler.java Log: Remove nls from the status line. Revision ChangesPath 1.46 +5 -1 jakarta-tomcat-connectors/jk/java/org/apache/jk/server/JkCoyoteHandler.java Index: JkCoyoteHandler.java === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/java/org/apache/jk/server/JkCoyoteHandler.java,v retrieving revision 1.45 retrieving revision 1.46 diff -u -r1.45 -r1.46 --- JkCoyoteHandler.java 18 Sep 2003 16:21:02 - 1.45 +++ JkCoyoteHandler.java 30 Sep 2003 04:17:37 - 1.46 @@ -346,7 +346,11 @@ ep.setNote( tmpMessageBytesNote, mb ); } String message=res.getMessage(); -if( message==null ) message= HttpMessages.getMessage(res.getStatus()); +if( message==null ){ +message= HttpMessages.getMessage(res.getStatus()); +} else { +message = message.replace('\n', ' ').replace('\r', ' '); +} mb.setString( message ); c2b.convert( mb ); msg.appendBytes(mb); - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-tomcat-connectors/jk/java/org/apache/jk/server JkCoyoteHandler.java
billbarker2003/09/29 21:18:45 Modified:jk/java/org/apache/jk/server Tag: coyote_10 JkCoyoteHandler.java Log: port patch. Revision ChangesPath No revision No revision 1.32.2.4 +5 -1 jakarta-tomcat-connectors/jk/java/org/apache/jk/server/JkCoyoteHandler.java Index: JkCoyoteHandler.java === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/java/org/apache/jk/server/JkCoyoteHandler.java,v retrieving revision 1.32.2.3 retrieving revision 1.32.2.4 diff -u -r1.32.2.3 -r1.32.2.4 --- JkCoyoteHandler.java 30 Jul 2003 02:27:01 - 1.32.2.3 +++ JkCoyoteHandler.java 30 Sep 2003 04:18:45 - 1.32.2.4 @@ -299,7 +299,11 @@ ep.setNote( tmpMessageBytesNote, mb ); } String message=res.getMessage(); -if( message==null ) message= HttpMessages.getMessage(res.getStatus()); +if( message==null ){ +message= HttpMessages.getMessage(res.getStatus()); +} else { +message = message.replace('\n', ' ').replace('\r', ' '); +} mb.setString( message ); c2b.convert( mb ); msg.appendBytes(mb); - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-tomcat-connectors/jk/java/org/apache/jk/server JkCoyoteHandler.java
remm2003/09/07 11:05:15 Modified:jk/java/org/apache/jk/server JkCoyoteHandler.java Log: - Make the update of the stats an explicit call (I believe it is valid to call recycle multiple times, and it is hard to avoid with HTTP keepalive). Revision ChangesPath 1.44 +1 -0 jakarta-tomcat-connectors/jk/java/org/apache/jk/server/JkCoyoteHandler.java Index: JkCoyoteHandler.java === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/java/org/apache/jk/server/JkCoyoteHandler.java,v retrieving revision 1.43 retrieving revision 1.44 diff -u -r1.43 -r1.44 --- JkCoyoteHandler.java 2 Sep 2003 00:17:40 - 1.43 +++ JkCoyoteHandler.java 7 Sep 2003 18:05:15 - 1.44 @@ -306,6 +306,7 @@ ep.setStatus( JK_STATUS_NEW ); req.recycle(); +req.updateCounters(); res.recycle(); return OK; } - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-tomcat-connectors/jk/java/org/apache/jk/server JkCoyoteHandler.java JkMain.java
billbarker2003/09/01 17:17:40 Modified:jk/java/org/apache/jk/server JkCoyoteHandler.java JkMain.java Log: Adding accessors so that the JkCoyote connectors can play nice with the admin webapp. Revision ChangesPath 1.43 +6 -2 jakarta-tomcat-connectors/jk/java/org/apache/jk/server/JkCoyoteHandler.java Index: JkCoyoteHandler.java === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/java/org/apache/jk/server/JkCoyoteHandler.java,v retrieving revision 1.42 retrieving revision 1.43 diff -u -r1.42 -r1.43 --- JkCoyoteHandler.java 30 Jul 2003 02:25:53 - 1.42 +++ JkCoyoteHandler.java 2 Sep 2003 00:17:40 - 1.43 @@ -132,9 +132,13 @@ if( value instanceof String ) this.setProperty( name, (String)value ); } - + +/** + * Retrieve config info. + * Primarily for use with the admin webapp. + */ public Object getAttribute( String name ) { -return null; +return getJkMain().getProperty(name); } /** The adapter, used to call the connector 1.41 +14 -1 jakarta-tomcat-connectors/jk/java/org/apache/jk/server/JkMain.java Index: JkMain.java === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/java/org/apache/jk/server/JkMain.java,v retrieving revision 1.40 retrieving revision 1.41 diff -u -r1.40 -r1.41 --- JkMain.java 2 Jul 2003 06:30:23 - 1.40 +++ JkMain.java 2 Sep 2003 00:17:40 - 1.41 @@ -188,7 +188,20 @@ saveProperties(); } } - +/** + * Retrieve a property. + */ +public Object getProperty(String name) { +String alias = (String)replacements.get(name); +Object result = null; +if(alias != null) { +result = props.get(alias); +} +if(result == null) { +result = props.get(name); +} +return result; +} /** * Set the codechannelClassName/code that will used to connect to * httpd. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-tomcat-connectors/jk/java/org/apache/jk/server JkCoyoteHandler.java
billbarker2003/07/29 19:25:54 Modified:jk/java/org/apache/jk/server JkCoyoteHandler.java Log: Make certain that we tell Apache that we have finished with the request. If the Adapter throws an exception before entering the Pipeline, we end up with both Apache and Tomcat trying to read the Channel and hence not serving requests. Reported By: [EMAIL PROTECTED] Kwan, Kenneth Y Revision ChangesPath 1.42 +3 -0 jakarta-tomcat-connectors/jk/java/org/apache/jk/server/JkCoyoteHandler.java Index: JkCoyoteHandler.java === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/java/org/apache/jk/server/JkCoyoteHandler.java,v retrieving revision 1.41 retrieving revision 1.42 diff -u -r1.41 -r1.42 --- JkCoyoteHandler.java 17 May 2003 03:21:33 - 1.41 +++ JkCoyoteHandler.java 30 Jul 2003 02:25:53 - 1.42 @@ -295,6 +295,9 @@ } catch( Exception ex ) { ex.printStackTrace(); } +if(ep.getStatus() != JK_STATUS_CLOSED) { +res.finish(); +} ep.setStatus( JK_STATUS_NEW ); - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-tomcat-connectors/jk/java/org/apache/jk/server JkCoyoteHandler.java
billbarker2003/07/29 19:27:02 Modified:jk/java/org/apache/jk/server Tag: coyote_10 JkCoyoteHandler.java Log: Port Patch. Revision ChangesPath No revision No revision 1.32.2.3 +3 -0 jakarta-tomcat-connectors/jk/java/org/apache/jk/server/JkCoyoteHandler.java Index: JkCoyoteHandler.java === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/java/org/apache/jk/server/JkCoyoteHandler.java,v retrieving revision 1.32.2.2 retrieving revision 1.32.2.3 diff -u -r1.32.2.2 -r1.32.2.3 --- JkCoyoteHandler.java 17 May 2003 03:27:36 - 1.32.2.2 +++ JkCoyoteHandler.java 30 Jul 2003 02:27:01 - 1.32.2.3 @@ -264,6 +264,9 @@ } catch( Exception ex ) { ex.printStackTrace(); } +if(ep.getStatus() != JK_STATUS_CLOSED) { +res.finish(); +} ep.setStatus( JK_STATUS_NEW ); - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-tomcat-connectors/jk/java/org/apache/jk/server JkCoyoteHandler.java
costin 2003/03/13 16:00:22 Modified:jk/java/org/apache/jk/server JkCoyoteHandler.java Log: Send the status string PR: 14292 Revision ChangesPath 1.37 +11 -3 jakarta-tomcat-connectors/jk/java/org/apache/jk/server/JkCoyoteHandler.java Index: JkCoyoteHandler.java === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/java/org/apache/jk/server/JkCoyoteHandler.java,v retrieving revision 1.36 retrieving revision 1.37 diff -u -r1.36 -r1.37 --- JkCoyoteHandler.java 17 Feb 2003 02:10:29 - 1.36 +++ JkCoyoteHandler.java 14 Mar 2003 00:00:21 - 1.37 @@ -97,6 +97,7 @@ int headersMsgNote; int c2bConvertersNote; +int tmpMessageBytesNote; int utfC2bNote; int obNote; int epNote; @@ -162,6 +163,7 @@ jkMain.init(); headersMsgNote=wEnv.getNoteId( WorkerEnv.ENDPOINT_NOTE, headerMsg ); +tmpMessageBytesNote=wEnv.getNoteId( WorkerEnv.ENDPOINT_NOTE, tmpMessageBytes ); utfC2bNote=wEnv.getNoteId( WorkerEnv.ENDPOINT_NOTE, utfC2B ); epNote=wEnv.getNoteId( WorkerEnv.ENDPOINT_NOTE, ep ); obNote=wEnv.getNoteId( WorkerEnv.ENDPOINT_NOTE, coyoteBuffer ); @@ -297,9 +299,15 @@ msg.appendByte(HandlerRequest.JK_AJP13_SEND_HEADERS); msg.appendInt( res.getStatus() ); -// s-b conversion, message -msg.appendBytes( null ); - +MessageBytes mb=(MessageBytes)ep.getNote( tmpMessageBytesNote ); +if( mb==null ) { +mb=new MessageBytes(); +ep.setNote( tmpMessageBytesNote, mb ); +} +mb.setString( res.getMessage()); +c2b.convert( mb ); +msg.appendBytes(mb); + // XXX add headers MimeHeaders headers=res.getMimeHeaders(); - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-tomcat-connectors/jk/java/org/apache/jk/server JkCoyoteHandler.java
costin 2003/03/13 16:03:03 Modified:jk/java/org/apache/jk/server JkCoyoteHandler.java Log: Extra fix - avoids the need for a change in Response PR: 14292 Revision ChangesPath 1.38 +3 -1 jakarta-tomcat-connectors/jk/java/org/apache/jk/server/JkCoyoteHandler.java Index: JkCoyoteHandler.java === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/java/org/apache/jk/server/JkCoyoteHandler.java,v retrieving revision 1.37 retrieving revision 1.38 diff -u -r1.37 -r1.38 --- JkCoyoteHandler.java 14 Mar 2003 00:00:21 - 1.37 +++ JkCoyoteHandler.java 14 Mar 2003 00:03:03 - 1.38 @@ -304,7 +304,9 @@ mb=new MessageBytes(); ep.setNote( tmpMessageBytesNote, mb ); } -mb.setString( res.getMessage()); +String message=res.getMessage(); +if( message==null ) message=OK; +mb.setString( message ); c2b.convert( mb ); msg.appendBytes(mb); - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: cvs commit: jakarta-tomcat-connectors/jk/java/org/apache/jk/server JkCoyoteHandler.java
Forgot to include: the patch was submited by Stefan Proels. Costin [EMAIL PROTECTED] wrote: costin 2003/03/13 16:03:03 Modified:jk/java/org/apache/jk/server JkCoyoteHandler.java Log: Extra fix - avoids the need for a change in Response PR: 14292 Revision ChangesPath 1.38 +3 -1 jakarta-tomcat-connectors/jk/java/org/apache/jk/server/JkCoyoteHandler.java Index: JkCoyoteHandler.java === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/java/org/apache/jk/server/JkCoyoteHandler.java,v retrieving revision 1.37 retrieving revision 1.38 diff -u -r1.37 -r1.38 --- JkCoyoteHandler.java14 Mar 2003 00:00:21 - 1.37 +++ JkCoyoteHandler.java14 Mar 2003 00:03:03 - 1.38 @@ -304,7 +304,9 @@ mb=new MessageBytes(); ep.setNote( tmpMessageBytesNote, mb ); } -mb.setString( res.getMessage()); +String message=res.getMessage(); +if( message==null ) message=OK; +mb.setString( message ); c2b.convert( mb ); msg.appendBytes(mb); - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-tomcat-connectors/jk/java/org/apache/jk/server JkCoyoteHandler.java
costin 2003/02/16 18:10:29 Modified:jk/java/org/apache/jk/server JkCoyoteHandler.java Log: Reduce verbosity Revision ChangesPath 1.36 +2 -2 jakarta-tomcat-connectors/jk/java/org/apache/jk/server/JkCoyoteHandler.java Index: JkCoyoteHandler.java === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/java/org/apache/jk/server/JkCoyoteHandler.java,v retrieving revision 1.35 retrieving revision 1.36 diff -u -r1.35 -r1.36 --- JkCoyoteHandler.java 20 Jan 2003 23:48:40 - 1.35 +++ JkCoyoteHandler.java 17 Feb 2003 02:10:29 - 1.36 @@ -347,8 +347,8 @@ appendHead( res ); } } else if( actionCode==ActionCode.ACTION_RESET ) { -if( log.isInfoEnabled() ) -log.info(RESET ); +if( log.isDebugEnabled() ) +log.debug(RESET ); } else if( actionCode==ActionCode.ACTION_CLIENT_FLUSH ) { if( log.isDebugEnabled() ) log.debug(CLIENT_FLUSH ); - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-tomcat-connectors/jk/java/org/apache/jk/server JkCoyoteHandler.java
costin 2003/01/20 11:20:32 Modified:jk/java/org/apache/jk/common ChannelSocket.java HandlerDispatch.java JkMX.java MsgAjp.java jk/java/org/apache/jk/server JkCoyoteHandler.java Log: Remove unused imports, add/fix comments. JkMX will only load the jmx console, since components now know and support JMX. This also removes the dependency on DynamicMbean - modeler now supports all the features of DynamicMBean, it should be deprecated. Revision ChangesPath 1.32 +0 -6 jakarta-tomcat-connectors/jk/java/org/apache/jk/common/ChannelSocket.java Index: ChannelSocket.java === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/java/org/apache/jk/common/ChannelSocket.java,v retrieving revision 1.31 retrieving revision 1.32 diff -u -r1.31 -r1.32 --- ChannelSocket.java16 Jan 2003 22:13:37 - 1.31 +++ ChannelSocket.java20 Jan 2003 19:20:32 - 1.32 @@ -60,17 +60,11 @@ package org.apache.jk.common; import java.io.*; - import java.net.*; -import java.util.*; - -import org.apache.tomcat.util.buf.*; -import org.apache.tomcat.util.http.*; import org.apache.tomcat.util.threads.*; import org.apache.jk.core.*; -import org.apache.jk.server.JkMain; import org.apache.commons.modeler.Registry; 1.4 +1 -7 jakarta-tomcat-connectors/jk/java/org/apache/jk/common/HandlerDispatch.java Index: HandlerDispatch.java === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/java/org/apache/jk/common/HandlerDispatch.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- HandlerDispatch.java 17 Apr 2002 22:38:42 - 1.3 +++ HandlerDispatch.java 20 Jan 2003 19:20:32 - 1.4 @@ -60,15 +60,9 @@ package org.apache.jk.common; import java.io.*; -import java.net.*; -import java.util.*; -import java.security.*; -import java.security.cert.*; - import org.apache.jk.core.*; -import org.apache.tomcat.util.http.*; -import org.apache.tomcat.util.buf.*; + /** 1.8 +27 -16jakarta-tomcat-connectors/jk/java/org/apache/jk/common/JkMX.java Index: JkMX.java === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/java/org/apache/jk/common/JkMX.java,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- JkMX.java 30 Oct 2002 22:22:46 - 1.7 +++ JkMX.java 20 Jan 2003 19:20:32 - 1.8 @@ -58,22 +58,20 @@ */ package org.apache.jk.common; -import java.io.*; -import java.net.*; -import java.util.*; -import org.apache.jk.core.*; -import org.apache.jk.server.JkMain; +import org.apache.jk.core.JkHandler; -import javax.management.*; +import javax.management.MBeanServer; +import javax.management.ObjectName; +import javax.management.Attribute; +import javax.management.MBeanServerFactory; +import java.io.IOException; -import org.apache.tomcat.util.mx.*; - -/** MX-enable jk. +/** + * Load the HTTP or RMI adapters for MX4J and JMXRI. + * + * Add mx.port=PORT in jk2.properties to enable it. * - * Add mx.port=PORT in jk2.properties to enable it. - * If port==-1 the JMX will be enabled but no HTTP adapter will be loaded. - * Port 0 will load the mx4j adapter, if possible. */ public class JkMX extends JkHandler { @@ -216,7 +214,7 @@ public void init() throws IOException { try { -mserver = DynamicMBeanProxy.getMBeanServer(); +mserver = getMBeanServer(); if( port 0 ) { loadAdapter(); @@ -231,27 +229,40 @@ log.info(Can't enable log4j mx); } -DynamicMBeanProxy.createMBean( JkMain.getJkMain(), jk2, name=JkMain ); +/* +DynamicMBeanProxy.createMBean( JkMain.getJkMain(), jk2, name=JkMain ); for( int i=0; i wEnv.getHandlerCount(); i++ ) { JkHandler h=wEnv.getHandler( i ); DynamicMBeanProxy.createMBean( h, jk2, name= + h.getName() ); } - +*/ } catch( Throwable t ) { log.error( Init error, t ); } } public void addHandlerCallback( JkHandler w ) { -if( w!=this ) { +/*if( w!=this ) { DynamicMBeanProxy.createMBean( w, jk2, name= + w.getName() ); } +*/ +} + +MBeanServer getMBeanServer() { +MBeanServer server; +if( MBeanServerFactory.findMBeanServer(null).size() 0 ) { +
cvs commit: jakarta-tomcat-connectors/jk/java/org/apache/jk/server JkCoyoteHandler.java JkMain.java
costin 2003/01/20 15:48:40 Modified:jk/java/org/apache/jk/common HandlerRequest.java jk/java/org/apache/jk/server JkCoyoteHandler.java JkMain.java Log: Few updates for RequestInfo. Revision ChangesPath 1.22 +13 -2 jakarta-tomcat-connectors/jk/java/org/apache/jk/common/HandlerRequest.java Index: HandlerRequest.java === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/java/org/apache/jk/common/HandlerRequest.java,v retrieving revision 1.21 retrieving revision 1.22 diff -u -r1.21 -r1.22 --- HandlerRequest.java 16 Jan 2003 22:13:37 - 1.21 +++ HandlerRequest.java 20 Jan 2003 23:48:40 - 1.22 @@ -411,22 +411,33 @@ } static int count=0; +RequestGroupInfo global=null; private int decodeRequest( Msg msg, MsgContext ep, MessageBytes tmpMB ) throws IOException { // FORWARD_REQUEST handler Request req=(Request)ep.getRequest(); +req.setStartTime(System.currentTimeMillis()); if( req==null ) { req=new Request(); Response res=new Response(); req.setResponse(res); ep.setRequest( req ); -RequestProcessor rp=new RequestProcessor(req); if( this.getDomain() != null ) { try { +if( global==null ) { +global=new RequestGroupInfo(); +Registry.getRegistry().registerComponent( global, +getDomain(), GlobalRequestProcessor, +type=GlobalRequestProcessor,name=jk); +} + +RequestInfo rp=req.getRequestProcessor(); +rp.setGlobalProcessor(global); Registry.getRegistry().registerComponent( rp, -getDomain(), RequestProcessor, name=Request + count++ ); +getDomain(), RequestProcessor, +type=RequestProcessor,name=JkRequest + count++ ); } catch( Exception ex ) { log.warn(Error registering request); } 1.35 +1 -1 jakarta-tomcat-connectors/jk/java/org/apache/jk/server/JkCoyoteHandler.java Index: JkCoyoteHandler.java === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/java/org/apache/jk/server/JkCoyoteHandler.java,v retrieving revision 1.34 retrieving revision 1.35 diff -u -r1.34 -r1.35 --- JkCoyoteHandler.java 20 Jan 2003 19:20:32 - 1.34 +++ JkCoyoteHandler.java 20 Jan 2003 23:48:40 - 1.35 @@ -456,7 +456,7 @@ { // XXX Can we have multiple JkMain ? Registry.getRegistry().registerComponent(jkMain, name.getDomain(), -JkMain, name=JkMain); +JkMain, type=JkHandler,name=JkMain); return super.preRegister(server, name); } } 1.34 +4 -1 jakarta-tomcat-connectors/jk/java/org/apache/jk/server/JkMain.java Index: JkMain.java === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/java/org/apache/jk/server/JkMain.java,v retrieving revision 1.33 retrieving revision 1.34 diff -u -r1.33 -r1.34 --- JkMain.java 16 Jan 2003 22:17:37 - 1.33 +++ JkMain.java 20 Jan 2003 23:48:40 - 1.34 @@ -513,6 +513,9 @@ String fullName=name; String localName=; String propName=; +// ignore +if( name.startsWith(key.)) return; + int dot=name.indexOf(.); int lastDot=name.lastIndexOf(.); if( dot 0 ) { @@ -564,7 +567,7 @@ } if( this.domain != null ) { try { -Registry.getRegistry().registerComponent(handler, this.domain, JkHandler, +Registry.getRegistry().registerComponent(handler, this.domain, classN, type=JkHandler,name= + fullName); } catch (Exception e) { log.error( Error registering + fullName, e ); -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
cvs commit: jakarta-tomcat-connectors/jk/java/org/apache/jk/server JkCoyoteHandler.java JkMain.java
costin 2003/01/16 14:17:37 Modified:jk/java/org/apache/jk/server JkCoyoteHandler.java JkMain.java Log: When the coyote handler is registered ( by the Connector or other method ), it'll also register JkMain. JkMain will register all handlers as mbeans. If the coyote handler is not registered - nothing happens. Revision ChangesPath 1.33 +16 -2 jakarta-tomcat-connectors/jk/java/org/apache/jk/server/JkCoyoteHandler.java Index: JkCoyoteHandler.java === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/java/org/apache/jk/server/JkCoyoteHandler.java,v retrieving revision 1.32 retrieving revision 1.33 diff -u -r1.32 -r1.33 --- JkCoyoteHandler.java 18 Dec 2002 09:15:06 - 1.32 +++ JkCoyoteHandler.java 16 Jan 2003 22:17:37 - 1.33 @@ -74,8 +74,14 @@ import org.apache.tomcat.util.net.SSLSupport; import org.apache.coyote.*; +import org.apache.commons.modeler.Registry; +import javax.management.ObjectName; +import javax.management.MBeanServer; /** Plugs Jk2 into Coyote + * + * @jmx:notification-handler name=org.apache.jk.SEND_PACKET + * @jmx:notification-handler name=org.apache.coyote.ACTION_COMMIT */ public class JkCoyoteHandler extends JkHandler implements ProtocolHandler, @@ -302,8 +308,7 @@ if( contentLanguage != null ) { headers.setValue(Content-Language).setString(contentLanguage); } - -int contentLength = res.getContentLength(); + int contentLength = res.getContentLength(); if( contentLength = 0 ) { headers.setValue(Content-Length).setInt(contentLength); } @@ -441,5 +446,14 @@ logTime.debug(Time pre= + t1 + / service= + t2 + + res.getContentLength() + + uri ); +} + +public ObjectName preRegister(MBeanServer server, + ObjectName name) throws Exception +{ +// XXX Can we have multiple JkMain ? +Registry.getRegistry().registerComponent(jkMain, name.getDomain(), +JkMain, name=JkMain); +return super.preRegister(server, name); } } 1.33 +48 -8 jakarta-tomcat-connectors/jk/java/org/apache/jk/server/JkMain.java Index: JkMain.java === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/java/org/apache/jk/server/JkMain.java,v retrieving revision 1.32 retrieving revision 1.33 diff -u -r1.32 -r1.33 --- JkMain.java 13 Nov 2002 00:19:00 - 1.32 +++ JkMain.java 16 Jan 2003 22:17:37 - 1.33 @@ -60,15 +60,15 @@ package org.apache.jk.server; import java.io.*; -import java.net.*; import java.util.*; import org.apache.jk.core.*; -import org.apache.jk.common.*; -import org.apache.tomcat.util.buf.*; -import org.apache.tomcat.util.http.*; import org.apache.tomcat.util.IntrospectionUtils; +import org.apache.commons.modeler.Registry; +import javax.management.ObjectName; +import javax.management.MBeanServer; +import javax.management.MBeanRegistration; /** Main class used to startup and configure jk. It manages the conf/jk2.properties file * and is the target of JMX proxy. @@ -102,8 +102,9 @@ * to see configs based on registry, LDAP, db, etc. ( XML is not necesarily better ) * * @author Costin Manolache + * @deprecated Will be replaced with JMX operations */ -public class JkMain +public class JkMain implements MBeanRegistration { WorkerEnv wEnv=new WorkerEnv(); String propFile; @@ -113,7 +114,7 @@ boolean modified=false; boolean started=false; boolean saveProperties=false; - + public JkMain() { JkMain.jkMain=this; @@ -122,6 +123,7 @@ modules.put(channelJni, org.apache.jk.common.ChannelJni); modules.put(apr, org.apache.jk.apr.AprImpl); modules.put(mx, org.apache.jk.common.JkMX); +modules.put(modeler, org.apache.jk.common.JkModeler); modules.put(shm, org.apache.jk.common.Shm); modules.put(request,org.apache.jk.common.HandlerRequest); modules.put(container,org.apache.jk.common.HandlerRequest); @@ -150,7 +152,7 @@ ex.printStackTrace(); } } - + // Setting /** Load a .properties file into and set the values @@ -223,7 +225,7 @@ public String getJkHome() { return wEnv.getJkHome(); } - + String out; String err; File propsF; @@ -560,7 +562,15 @@ log.error( Can't create + fullName, ex ); return null;
cvs commit: jakarta-tomcat-connectors/jk/java/org/apache/jk/server JkCoyoteHandler.java
billbarker2002/12/18 01:15:06 Modified:jk/java/org/apache/jk/common HandlerRequest.java jk/java/org/apache/jk/core WorkerEnv.java jk/java/org/apache/jk/server JkCoyoteHandler.java Log: Fixing the mess that was SSL-Cert evalulation for Jk2. Fix for Bug #15456 Reported By: Alex Roytman [EMAIL PROTECTED] Revision ChangesPath 1.19 +7 -6 jakarta-tomcat-connectors/jk/java/org/apache/jk/common/HandlerRequest.java Index: HandlerRequest.java === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/java/org/apache/jk/common/HandlerRequest.java,v retrieving revision 1.18 retrieving revision 1.19 diff -u -r1.18 -r1.19 --- HandlerRequest.java 23 Nov 2002 06:34:47 - 1.18 +++ HandlerRequest.java 18 Dec 2002 09:15:06 - 1.19 @@ -529,16 +529,17 @@ msg.getBytes(req.instanceId()); break; - case SC_A_SSL_CERT : - req.scheme().setString( https ); +case SC_A_SSL_CERT : +req.scheme().setString( https ); // Transform the string into certificate. +tmpMB = new MessageBytes(); msg.getBytes(tmpMB); String certString = tmpMB.toString(); - // SSL certificate extraction is costy, moved to JkCoyoteHandler -req.setAttribute(SSLSupport.CERTIFICATE_KEY, certString); +// SSL certificate extraction is costy, moved to JkCoyoteHandler +req.setNote(WorkerEnv.SSL_CERT_NOTE, tmpMB); break; - - case SC_A_SSL_CIPHER : + +case SC_A_SSL_CIPHER : req.scheme().setString( https ); msg.getBytes(tmpMB); req.setAttribute(SSLSupport.CIPHER_SUITE_KEY, 1.9 +1 -0 jakarta-tomcat-connectors/jk/java/org/apache/jk/core/WorkerEnv.java Index: WorkerEnv.java === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/java/org/apache/jk/core/WorkerEnv.java,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- WorkerEnv.java5 Jun 2002 21:23:32 - 1.8 +++ WorkerEnv.java18 Dec 2002 09:15:06 - 1.9 @@ -82,6 +82,7 @@ public static final int ENDPOINT_NOTE=0; public static final int REQUEST_NOTE=1; +public static final int SSL_CERT_NOTE=16; int noteId[]=new int[4]; String noteName[][]=new String[4][]; private Object notes[]=new Object[32]; 1.32 +21 -19 jakarta-tomcat-connectors/jk/java/org/apache/jk/server/JkCoyoteHandler.java Index: JkCoyoteHandler.java === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/java/org/apache/jk/server/JkCoyoteHandler.java,v retrieving revision 1.31 retrieving revision 1.32 diff -u -r1.31 -r1.32 --- JkCoyoteHandler.java 23 Nov 2002 06:34:47 - 1.31 +++ JkCoyoteHandler.java 18 Dec 2002 09:15:06 - 1.32 @@ -381,27 +381,29 @@ } else if( actionCode==ActionCode.ACTION_REQ_SSL_ATTRIBUTE ) { org.apache.coyote.Request req=(org.apache.coyote.Request)param; - // Extract SSL certificate information (if requested) -String certString = (String)req.getAttribute(SSLSupport.CERTIFICATE_KEY); -byte[] certData = certString.getBytes(); -ByteArrayInputStream bais = new ByteArrayInputStream(certData); +// Extract SSL certificate information (if requested) +MessageBytes certString = (MessageBytes)req.getNote(WorkerEnv.SSL_CERT_NOTE); +if( certString != null ) { +byte[] certData = certString.getByteChunk().getBytes(); +ByteArrayInputStream bais = new ByteArrayInputStream(certData); -// Fill the first element. -X509Certificate jsseCerts[] = null; -try { -CertificateFactory cf = -CertificateFactory.getInstance(X.509); -X509Certificate cert = (X509Certificate) -cf.generateCertificate(bais); -jsseCerts = new X509Certificate[1]; -jsseCerts[0] = cert; -} catch(java.security.cert.CertificateException e) { -log.error(Certificate convertion failed + e ); -e.printStackTrace(); -} +// Fill the first element. +X509Certificate jsseCerts[] =
cvs commit: jakarta-tomcat-connectors/jk/java/org/apache/jk/server JkCoyoteHandler.java
hgomez 2002/11/22 22:34:48 Modified:jk/java/org/apache/jk/common HandlerRequest.java jk/java/org/apache/jk/server JkCoyoteHandler.java Log: Fix null getRemoteHost. Lasy extraction of ssl certs to speed up jk/ajp13 when under SSL Revision ChangesPath 1.18 +6 -24 jakarta-tomcat-connectors/jk/java/org/apache/jk/common/HandlerRequest.java Index: HandlerRequest.java === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/java/org/apache/jk/common/HandlerRequest.java,v retrieving revision 1.17 retrieving revision 1.18 diff -u -r1.17 -r1.18 --- HandlerRequest.java 4 Oct 2002 23:26:25 - 1.17 +++ HandlerRequest.java 23 Nov 2002 06:34:47 - 1.18 @@ -62,13 +62,12 @@ import java.io.*; import java.net.*; import java.util.*; -import java.security.*; -import java.security.cert.*; import org.apache.jk.core.*; import org.apache.tomcat.util.http.*; import org.apache.tomcat.util.buf.*; +import org.apache.tomcat.util.net.SSLSupport; import org.apache.coyote.Request; import org.apache.coyote.*; @@ -482,7 +481,7 @@ */ if( attributeCode == SC_A_SSL_KEY_SIZE ) { // Bug 1326: it's an Integer. - req.setAttribute(javax.servlet.request.key_size, + req.setAttribute(SSLSupport.KEY_SIZE_KEY, new Integer( msg.getInt())); //Integer.toString(msg.getInt())); } @@ -535,38 +534,21 @@ // Transform the string into certificate. msg.getBytes(tmpMB); String certString = tmpMB.toString(); -byte[] certData = certString.getBytes(); -ByteArrayInputStream bais = new ByteArrayInputStream(certData); - -// Fill the first element. -X509Certificate jsseCerts[] = null; -try { -CertificateFactory cf = -CertificateFactory.getInstance(X.509); -X509Certificate cert = (X509Certificate) -cf.generateCertificate(bais); -jsseCerts = new X509Certificate[1]; -jsseCerts[0] = cert; -} catch(java.security.cert.CertificateException e) { -log.error(Certificate convertion failed + e ); -e.printStackTrace(); -} - -req.setAttribute(javax.servlet.request.X509Certificate, - jsseCerts); + // SSL certificate extraction is costy, moved to JkCoyoteHandler +req.setAttribute(SSLSupport.CERTIFICATE_KEY, certString); break; case SC_A_SSL_CIPHER : req.scheme().setString( https ); msg.getBytes(tmpMB); - req.setAttribute(javax.servlet.request.cipher_suite, + req.setAttribute(SSLSupport.CIPHER_SUITE_KEY, tmpMB.toString()); break; case SC_A_SSL_SESSION : req.scheme().setString( https ); msg.getBytes(tmpMB); - req.setAttribute(javax.servlet.request.ssl_session, + req.setAttribute(SSLSupport.SESSION_ID_KEY, tmpMB.toString()); break; 1.31 +31 -1 jakarta-tomcat-connectors/jk/java/org/apache/jk/server/JkCoyoteHandler.java Index: JkCoyoteHandler.java === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/java/org/apache/jk/server/JkCoyoteHandler.java,v retrieving revision 1.30 retrieving revision 1.31 diff -u -r1.30 -r1.31 --- JkCoyoteHandler.java 13 Nov 2002 00:18:16 - 1.30 +++ JkCoyoteHandler.java 23 Nov 2002 06:34:47 - 1.31 @@ -62,6 +62,8 @@ import java.io.*; import java.net.*; import java.util.*; +import java.security.*; +import java.security.cert.*; import org.apache.jk.core.*; import org.apache.jk.common.*; @@ -69,6 +71,7 @@ import org.apache.tomcat.util.buf.*; import org.apache.tomcat.util.log.*; import org.apache.tomcat.util.http.*; +import org.apache.tomcat.util.net.SSLSupport; import org.apache.coyote.*; @@ -376,9 +379,36 @@ if( logTime.isDebugEnabled() ) logTime(res.getRequest(), res); } else if( actionCode==ActionCode.ACTION_REQ_SSL_ATTRIBUTE ) { - +org.apache.coyote.Request req=(org.apache.coyote.Request)param; + + // Extract SSL
Re: cvs commit: jakarta-tomcat-connectors/jk/java/org/apache/jk/server JkCoyoteHandler.java
- Original Message - From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, November 22, 2002 10:34 PM Subject: cvs commit: jakarta-tomcat-connectors/jk/java/org/apache/jk/server JkCoyoteHandler.java hgomez 2002/11/22 22:34:48 Modified:jk/java/org/apache/jk/common HandlerRequest.java jk/java/org/apache/jk/server JkCoyoteHandler.java Log: Fix null getRemoteHost. Lasy extraction of ssl certs to speed up jk/ajp13 when under SSL Revision ChangesPath 1.18 +6 -24 jakarta-tomcat-connectors/jk/java/org/apache/jk/common/HandlerRequest.java Index: HandlerRequest.java + // SSL certificate extraction is costy, moved to JkCoyoteHandler +req.setAttribute(SSLSupport.CERTIFICATE_KEY, certString); break; As much as I very much like the switch to constants, this is still wrong. As far back as the Servlet 2.2 spec (aka Tomat 3.3) this is required to be a java.security.cert.X509Certificate []. I'll have to -1 this section of the patch because of this, but the rest looks really good! -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
cvs commit: jakarta-tomcat-connectors/jk/java/org/apache/jk/server JkCoyoteHandler.java
costin 2002/11/12 16:18:16 Modified:jk/java/org/apache/jk/server JkCoyoteHandler.java Log: Move set attribute to trace level. Revision ChangesPath 1.30 +5 -2 jakarta-tomcat-connectors/jk/java/org/apache/jk/server/JkCoyoteHandler.java Index: JkCoyoteHandler.java === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/java/org/apache/jk/server/JkCoyoteHandler.java,v retrieving revision 1.29 retrieving revision 1.30 diff -u -r1.29 -r1.30 --- JkCoyoteHandler.java 10 Nov 2002 07:25:21 - 1.29 +++ JkCoyoteHandler.java 13 Nov 2002 00:18:16 - 1.30 -101,8 +101,8 public final int JK_STATUS_CLOSED=2; public void setProperty( String name, String value ) { -if( log.isDebugEnabled()) -log.debug(setProperty + name + + value ); +if( log.isTraceEnabled()) +log.trace(setProperty + name + + value ); jkMain.setProperty( name, value ); properties.put( name, value ); } -114,6 +114,8 /** Pass config info */ public void setAttribute( String name, Object value ) { +if( log.isDebugEnabled()) +log.debug(setAttribute + name + + value ); if( value instanceof String ) this.setProperty( name, (String)value ); } -297,6 +299,7 if( contentLanguage != null ) { headers.setValue(Content-Language).setString(contentLanguage); } + int contentLength = res.getContentLength(); if( contentLength = 0 ) { headers.setValue(Content-Length).setInt(contentLength); -- To unsubscribe, e-mail: mailto:tomcat-dev-unsubscribe;jakarta.apache.org For additional commands, e-mail: mailto:tomcat-dev-help;jakarta.apache.org
cvs commit: jakarta-tomcat-connectors/jk/java/org/apache/jk/server JkCoyoteHandler.java
billbarker2002/11/09 23:25:21 Modified:jk/java/org/apache/jk/server JkCoyoteHandler.java Log: This time, without the tabs. Revision ChangesPath 1.29 +12 -12 jakarta-tomcat-connectors/jk/java/org/apache/jk/server/JkCoyoteHandler.java Index: JkCoyoteHandler.java === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/java/org/apache/jk/server/JkCoyoteHandler.java,v retrieving revision 1.28 retrieving revision 1.29 diff -u -r1.28 -r1.29 --- JkCoyoteHandler.java 10 Nov 2002 07:17:13 - 1.28 +++ JkCoyoteHandler.java 10 Nov 2002 07:25:21 - 1.29 -290,18 +290,18 MimeHeaders headers=res.getMimeHeaders(); String contentType = res.getContentType(); - if( contentType != null ) { - headers.setValue(Content-Type).setString(contentType); - } - String contentLanguage = res.getContentLanguage(); - if( contentLanguage != null ) { - headers.setValue(Content-Language).setString(contentLanguage); - } - int contentLength = res.getContentLength(); - if( contentLength = 0 ) { - headers.setValue(Content-Length).setInt(contentLength); - } - int numHeaders = headers.size(); +if( contentType != null ) { +headers.setValue(Content-Type).setString(contentType); +} +String contentLanguage = res.getContentLanguage(); +if( contentLanguage != null ) { +headers.setValue(Content-Language).setString(contentLanguage); +} +int contentLength = res.getContentLength(); +if( contentLength = 0 ) { +headers.setValue(Content-Length).setInt(contentLength); +} +int numHeaders = headers.size(); msg.appendInt(numHeaders); for( int i=0; inumHeaders; i++ ) { MessageBytes hN=headers.getName(i); -- To unsubscribe, e-mail: mailto:tomcat-dev-unsubscribe;jakarta.apache.org For additional commands, e-mail: mailto:tomcat-dev-help;jakarta.apache.org
cvs commit: jakarta-tomcat-connectors/jk/java/org/apache/jk/server JkCoyoteHandler.java
billbarker2002/10/29 19:47:27 Modified:jk/java/org/apache/jk/server JkCoyoteHandler.java Log: Fix what looks like a typo. Without this, the same buffer is used for both input and output. The result is that fields like requestURI and remoteHost are trashed after the servlet has started sending output back. Revision ChangesPath 1.27 +1 -1 jakarta-tomcat-connectors/jk/java/org/apache/jk/server/JkCoyoteHandler.java Index: JkCoyoteHandler.java === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/java/org/apache/jk/server/JkCoyoteHandler.java,v retrieving revision 1.26 retrieving revision 1.27 diff -u -r1.26 -r1.27 --- JkCoyoteHandler.java 9 Aug 2002 17:42:44 - 1.26 +++ JkCoyoteHandler.java 30 Oct 2002 03:47:27 - 1.27 -246,7 +246,7 if( ep.getNote( headersMsgNote ) == null ) { Msg msg2=new MsgAjp(); -ep.setNote( headersMsgNote, msg ); +ep.setNote( headersMsgNote, msg2 ); } res.setNote( epNote, ep ); -- To unsubscribe, e-mail: mailto:tomcat-dev-unsubscribe;jakarta.apache.org For additional commands, e-mail: mailto:tomcat-dev-help;jakarta.apache.org
cvs commit: jakarta-tomcat-connectors/jk/java/org/apache/jk/server JkCoyoteHandler.java
costin 2002/08/09 10:42:44 Modified:jk/java/org/apache/jk/server JkCoyoteHandler.java Log: Move start to the right place. Now the ajp13 port will be opened at the same time with the http port, i.e. at server startup. Revision ChangesPath 1.26 +8 -4 jakarta-tomcat-connectors/jk/java/org/apache/jk/server/JkCoyoteHandler.java Index: JkCoyoteHandler.java === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/java/org/apache/jk/server/JkCoyoteHandler.java,v retrieving revision 1.25 retrieving revision 1.26 diff -u -r1.25 -r1.26 --- JkCoyoteHandler.java 2 Jul 2002 16:57:30 - 1.25 +++ JkCoyoteHandler.java 9 Aug 2002 17:42:44 - 1.26 @@ -63,7 +63,6 @@ import java.net.*; import java.util.*; -import org.apache.jk.*; import org.apache.jk.core.*; import org.apache.jk.common.*; @@ -147,7 +146,6 @@ // jkMain.setJkHome() XXX; jkMain.init(); -jkMain.start(); headersMsgNote=wEnv.getNoteId( WorkerEnv.ENDPOINT_NOTE, headerMsg ); utfC2bNote=wEnv.getNoteId( WorkerEnv.ENDPOINT_NOTE, utfC2B ); @@ -162,6 +160,11 @@ } public void start() { +try { +jkMain.start(); +} catch( Exception ex ) { +ex.printStackTrace(); +} } public void destroy() { @@ -334,7 +337,8 @@ org.apache.coyote.Response res=(org.apache.coyote.Response)param; MsgContext ep=(MsgContext)res.getNote( epNote ); if( ep.getStatus()== JK_STATUS_CLOSED ) { -// Double close - it may happen with forward +// Double close - it may happen with forward +if( log.isDebugEnabled() ) log.debug(Double CLOSE - forward ? + res.getRequest().requestURI() ); return; } @@ -361,7 +365,7 @@ } else if( actionCode==ActionCode.ACTION_REQ_HOST_ATTRIBUTE ) { -} else if( actionCode==ActionCode.ACTION_POST_REQUEST ) { +// } else if( actionCode==ActionCode.ACTION_POST_REQUEST ) { } else if( actionCode==ActionCode.ACTION_ACK ) { if( log.isDebugEnabled() ) -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
cvs commit: jakarta-tomcat-connectors/jk/java/org/apache/jk/server JkCoyoteHandler.java
costin 2002/07/02 09:57:31 Modified:jk/java/org/apache/jk/common ChannelSocket.java jk/java/org/apache/jk/server JkCoyoteHandler.java Log: Added a bit of code to display the time spent in jk and request. I had it in my workspace, better to check it in so it doesn't get lost. Revision ChangesPath 1.16 +2 -1 jakarta-tomcat-connectors/jk/java/org/apache/jk/common/ChannelSocket.java Index: ChannelSocket.java === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/java/org/apache/jk/common/ChannelSocket.java,v retrieving revision 1.15 retrieving revision 1.16 diff -u -r1.15 -r1.16 --- ChannelSocket.java5 Jun 2002 21:22:40 - 1.15 +++ ChannelSocket.java2 Jul 2002 16:57:30 - 1.16 @@ -471,7 +471,8 @@ log.warn(Closing ajp connection + status ); break; } - +ep.setLong( MsgContext.TIMER_RECEIVED, System.currentTimeMillis()); + ep.setType( 0 ); status= this.invoke( recv, ep ); if( status!= JkHandler.OK ) { 1.25 +39 -8 jakarta-tomcat-connectors/jk/java/org/apache/jk/server/JkCoyoteHandler.java Index: JkCoyoteHandler.java === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/java/org/apache/jk/server/JkCoyoteHandler.java,v retrieving revision 1.24 retrieving revision 1.25 diff -u -r1.24 -r1.25 --- JkCoyoteHandler.java 21 Jun 2002 23:41:16 - 1.24 +++ JkCoyoteHandler.java 2 Jul 2002 16:57:30 - 1.25 @@ -83,6 +83,10 @@ { protected static org.apache.commons.logging.Log log = org.apache.commons.logging.LogFactory.getLog(JkCoyoteHandler.class); +// Set debug on this logger to see the container request time +private static org.apache.commons.logging.Log logTime= +org.apache.commons.logging.LogFactory.getLog( org.apache.jk.REQ_TIME ); + int headersMsgNote; int c2bConvertersNote; int utfC2bNote; @@ -185,8 +189,8 @@ int len=chunk.getLength(); byte buf[]=msg.getBuffer(); -// 3 - hardcoded, byte[] marshalling overhead -int chunkSize=buf.length - msg.getHeaderLength() - 3; +// 4 - hardcoded, byte[] marshalling overhead +int chunkSize=buf.length - msg.getHeaderLength() - 4; int off=0; while( len 0 ) { int thisTime=len; @@ -224,6 +228,9 @@ public int invoke( Msg msg, MsgContext ep ) throws IOException { +if( logTime.isDebugEnabled() ) +ep.setLong( MsgContext.TIMER_PRE_REQUEST, System.currentTimeMillis()); + org.apache.coyote.Request req=(org.apache.coyote.Request)ep.getRequest(); org.apache.coyote.Response res=req.getResponse(); res.setHook( this ); @@ -241,7 +248,7 @@ res.setNote( epNote, ep ); ep.setStatus( JK_STATUS_HEAD ); - + try { adapter.service( req, res ); } catch( Exception ex ) { @@ -301,6 +308,7 @@ public void action(ActionCode actionCode, Object param) { try { if( actionCode==ActionCode.ACTION_COMMIT ) { +if( log.isDebugEnabled() ) log.debug(COMMIT ); org.apache.coyote.Response res=(org.apache.coyote.Response)param; if( res.isCommitted() ) { @@ -312,15 +320,17 @@ } else if( actionCode==ActionCode.ACTION_RESET ) { if( log.isInfoEnabled() ) log.info(RESET ); + } else if( actionCode==ActionCode.ACTION_CLIENT_FLUSH ) { +if( log.isDebugEnabled() ) log.debug(CLIENT_FLUSH ); org.apache.coyote.Response res=(org.apache.coyote.Response)param; MsgContext ep=(MsgContext)res.getNote( epNote ); ep.setType( JkHandler.HANDLE_FLUSH ); ep.getSource().invoke( null, ep ); + } else if( actionCode==ActionCode.ACTION_CLOSE ) { -if( log.isDebugEnabled() ) { -log.debug(CLOSE ); -} +if( log.isDebugEnabled() ) log.debug(CLOSE ); + org.apache.coyote.Response res=(org.apache.coyote.Response)param; MsgContext ep=(MsgContext)res.getNote( epNote ); if( ep.getStatus()== JK_STATUS_CLOSED ) { @@ -343,12 +353,16 @@ ep.getSource().invoke( msg, ep ); ep.setStatus(JK_STATUS_CLOSED ); + +if( logTime.isDebugEnabled() ) +
cvs commit: jakarta-tomcat-connectors/jk/java/org/apache/jk/server JkCoyoteHandler.java
costin 02/05/22 16:52:13 Modified:jk/java/org/apache/jk/common ChannelJni.java jk/java/org/apache/jk/core JkHandler.java jk/java/org/apache/jk/server JkCoyoteHandler.java Log: Added the FLUSH code. That shouldn't change any of the existing behaviors. Revision ChangesPath 1.10 +1 -1 jakarta-tomcat-connectors/jk/java/org/apache/jk/common/ChannelJni.java Index: ChannelJni.java === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/java/org/apache/jk/common/ChannelJni.java,v retrieving revision 1.9 retrieving revision 1.10 diff -u -r1.9 -r1.10 --- ChannelJni.java 10 May 2002 00:01:44 - 1.9 +++ ChannelJni.java 22 May 2002 23:52:13 - 1.10 @@ -163,7 +163,7 @@ case JkHandler.HANDLE_SEND_PACKET: return send( msg, ep ); } -// Default is FORWARD +// Default is FORWARD - called from C try { // first, we need to get an endpoint. It should be // per/thread - and probably stored by the C side. 1.7 +1 -0 jakarta-tomcat-connectors/jk/java/org/apache/jk/core/JkHandler.java Index: JkHandler.java === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/java/org/apache/jk/core/JkHandler.java,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- JkHandler.java17 Apr 2002 22:27:18 - 1.6 +++ JkHandler.java22 May 2002 23:52:13 - 1.7 @@ -85,6 +85,7 @@ // will be merged ). public static final int HANDLE_RECEIVE_PACKET = 10; public static final int HANDLE_SEND_PACKET = 11; +public static final int HANDLE_FLUSH= 12; public void setWorkerEnv( WorkerEnv we ) { this.wEnv=we; 1.22 +8 -0 jakarta-tomcat-connectors/jk/java/org/apache/jk/server/JkCoyoteHandler.java Index: JkCoyoteHandler.java === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/java/org/apache/jk/server/JkCoyoteHandler.java,v retrieving revision 1.21 retrieving revision 1.22 diff -u -r1.21 -r1.22 --- JkCoyoteHandler.java 16 May 2002 18:57:39 - 1.21 +++ JkCoyoteHandler.java 22 May 2002 23:52:13 - 1.22 @@ -291,6 +291,11 @@ } else if( actionCode==ActionCode.ACTION_RESET ) { if( log.isInfoEnabled() ) log.info(RESET ); +} else if( actionCode==ActionCode.ACTION_CLIENT_FLUSH ) { +org.apache.coyote.Response res=(org.apache.coyote.Response)param; +MsgContext ep=(MsgContext)res.getNote( epNote ); +ep.setType( JkHandler.HANDLE_FLUSH ); +ep.getSource().invoke( null, ep ); } else if( actionCode==ActionCode.ACTION_CLOSE ) { if( log.isDebugEnabled() ) log.debug(CLOSE ); @@ -303,6 +308,9 @@ msg.appendByte( 1 ); ep.setType( JkHandler.HANDLE_SEND_PACKET ); +ep.getSource().invoke( msg, ep ); + +ep.setType( JkHandler.HANDLE_FLUSH ); ep.getSource().invoke( msg, ep ); } else if( actionCode==ActionCode.ACTION_REQ_SSL_ATTRIBUTE ) { -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
cvs commit: jakarta-tomcat-connectors/jk/java/org/apache/jk/server JkCoyoteHandler.java
costin 02/05/10 16:57:35 Modified:jk/java/org/apache/jk/server JkCoyoteHandler.java Log: That's an important one - without it mod_jk1 will no recycle the connection. Revision ChangesPath 1.20 +1 -1 jakarta-tomcat-connectors/jk/java/org/apache/jk/server/JkCoyoteHandler.java Index: JkCoyoteHandler.java === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/java/org/apache/jk/server/JkCoyoteHandler.java,v retrieving revision 1.19 retrieving revision 1.20 diff -u -r1.19 -r1.20 --- JkCoyoteHandler.java 9 May 2002 23:46:33 - 1.19 +++ JkCoyoteHandler.java 10 May 2002 23:57:35 - 1.20 @@ -297,7 +297,7 @@ MsgAjp msg=(MsgAjp)ep.getNote( headersMsgNote ); msg.reset(); msg.appendByte( HandlerRequest.JK_AJP13_END_RESPONSE ); -msg.appendInt( 1 ); +msg.appendByte( 1 ); ep.setType( JkHandler.HANDLE_SEND_PACKET ); ep.getSource().invoke( msg, ep ); -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
cvs commit: jakarta-tomcat-connectors/jk/java/org/apache/jk/server JkCoyoteHandler.java
costin 02/05/09 16:46:33 Modified:jk/java/org/apache/jk/common JniHandler.java Shm.java jk/java/org/apache/jk/server JkCoyoteHandler.java Log: Reduce verbosity Revision ChangesPath 1.4 +2 -2 jakarta-tomcat-connectors/jk/java/org/apache/jk/common/JniHandler.java Index: JniHandler.java === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/java/org/apache/jk/common/JniHandler.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- JniHandler.java 25 Apr 2002 23:13:24 - 1.3 +++ JniHandler.java 9 May 2002 23:46:33 - 1.4 @@ -186,7 +186,7 @@ protected int nativeDispatch( Msg msg, MsgContext ep, int code ) throws IOException { -if( log.isInfoEnabled() ) log.info( Sending packet ); +if( log.isDebugEnabled() ) log.debug( Sending packet ); msg.end(); if( log.isTraceEnabled() ) msg.dump(OUT: ); long xEnv=ep.getJniEnv(); @@ -209,7 +209,7 @@ nativeContext, code, msg.getBuffer(), msg.getLen()); -if( log.isInfoEnabled() ) log.info( Sending packet - done + status); +if( log.isDebugEnabled() ) log.debug( Sending packet - done + status); return status; } 1.11 +1 -2 jakarta-tomcat-connectors/jk/java/org/apache/jk/common/Shm.java Index: Shm.java === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/java/org/apache/jk/common/Shm.java,v retrieving revision 1.10 retrieving revision 1.11 diff -u -r1.10 -r1.11 --- Shm.java 9 May 2002 00:13:33 - 1.10 +++ Shm.java 9 May 2002 23:46:33 - 1.11 @@ -177,7 +177,6 @@ to identify tomcat. */ public void setUnregister( boolean unregister ) { -System.out.println(XXX set unregister ); this.unregister=true; } @@ -333,7 +332,7 @@ throws IOException { if( apr==null ) return 0; -System.err.println(ChannelShm.invoke: + ep ); +log.debug(ChannelShm.invoke: + ep ); super.nativeDispatch( msg, ep, JK_HANDLE_SHM_DISPATCH ); return 0; } 1.19 +11 -10 jakarta-tomcat-connectors/jk/java/org/apache/jk/server/JkCoyoteHandler.java Index: JkCoyoteHandler.java === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/java/org/apache/jk/server/JkCoyoteHandler.java,v retrieving revision 1.18 retrieving revision 1.19 diff -u -r1.18 -r1.19 --- JkCoyoteHandler.java 25 Apr 2002 23:13:24 - 1.18 +++ JkCoyoteHandler.java 9 May 2002 23:46:33 - 1.19 @@ -172,7 +172,7 @@ // set the filters accordingly. res.sendHeaders(); } -if( log.isInfoEnabled() ) log.info(doWrite ); +if( log.isDebugEnabled() ) log.debug(doWrite ); MsgContext ep=(MsgContext)res.getNote( epNote ); MsgAjp msg=(MsgAjp)ep.getNote( headersMsgNote ); @@ -189,8 +189,8 @@ throws IOException { Response res=req.getResponse(); -if( log.isInfoEnabled() ) -log.info(doRead + chunk.getBytes() + + chunk.getOffset() + + chunk.getLength()); +if( log.isDebugEnabled() ) +log.debug(doRead + chunk.getBytes() + + chunk.getOffset() + + chunk.getLength()); MsgContext ep=(MsgContext)res.getNote( epNote ); JkInputStream jkIS=(JkInputStream)ep.getNote( inputStreamNote ); @@ -207,7 +207,8 @@ org.apache.coyote.Response res=req.getResponse(); res.setHook( this ); -log.info( Invoke + req + + res + + req.requestURI().toString()); +if( log.isDebugEnabled() ) +log.debug( Invoke + req + + res + + req.requestURI().toString()); res.setOutputBuffer( this ); req.setInputBuffer( this ); @@ -233,8 +234,8 @@ private void appendHead(org.apache.coyote.Response res) throws IOException { -if( log.isInfoEnabled() ) -log.info(COMMIT sending headers + res + + res.getMimeHeaders() ); +if( log.isDebugEnabled() ) +log.debug(COMMIT sending headers + res + + res.getMimeHeaders() ); C2BConverter c2b=(C2BConverter)res.getNote( utfC2bNote ); if( c2b==null ) { @@ -288,8 +289,8 @@ if( log.isInfoEnabled() ) log.info(RESET ); } else if( actionCode==ActionCode.ACTION_CLOSE ) { -if( log.isInfoEnabled() ) -
cvs commit: jakarta-tomcat-connectors/jk/java/org/apache/jk/server JkCoyoteHandler.java
costin 02/04/25 11:27:18 Modified:jk/java/org/apache/jk/server JkCoyoteHandler.java Log: Call sendHeaders() in response ( that will set commited ) instead of directly calling the action chain. Also ( I couldn't resist ) moved the code that serializes the headers in a separate ( and more readable ) method. Revision ChangesPath 1.17 +44 -39 jakarta-tomcat-connectors/jk/java/org/apache/jk/server/JkCoyoteHandler.java Index: JkCoyoteHandler.java === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/java/org/apache/jk/server/JkCoyoteHandler.java,v retrieving revision 1.16 retrieving revision 1.17 diff -u -r1.16 -r1.17 --- JkCoyoteHandler.java 24 Apr 2002 23:20:38 - 1.16 +++ JkCoyoteHandler.java 25 Apr 2002 18:27:18 - 1.17 @@ -171,10 +171,9 @@ // Send the connector a request for commit. The connector should // then validate the headers, send them (using sendHeader) and // set the filters accordingly. -res.action(ActionCode.ACTION_COMMIT, null); +res.sendHeaders(); } -if( log.isInfoEnabled() ) -log.info(doWrite ); +if( log.isInfoEnabled() ) log.info(doWrite ); MsgContext ep=(MsgContext)res.getNote( epNote ); MsgAjp msg=(MsgAjp)ep.getNote( headersMsgNote ); @@ -232,6 +231,47 @@ return OK; } +private void appendHead(org.apache.coyote.Response res) +throws IOException +{ +if( log.isInfoEnabled() ) +log.info(COMMIT sending headers + res + + res.getMimeHeaders() ); + +C2BConverter c2b=(C2BConverter)res.getNote( utfC2bNote ); +if( c2b==null ) { +c2b=new C2BConverter( UTF8 ); +res.setNote( utfC2bNote, c2b ); +} + +MsgContext ep=(MsgContext)res.getNote( epNote ); +MsgAjp msg=(MsgAjp)ep.getNote( headersMsgNote ); +msg.reset(); +msg.appendByte(HandlerRequest.JK_AJP13_SEND_HEADERS); +msg.appendInt( res.getStatus() ); + +// s-b conversion, message +msg.appendBytes( null ); + +// XXX add headers + +MimeHeaders headers=res.getMimeHeaders(); +int numHeaders = headers.size(); +msg.appendInt(numHeaders); +for( int i=0; inumHeaders; i++ ) { +MessageBytes hN=headers.getName(i); +// no header to sc conversion - there's little benefit +// on this direction +c2b.convert ( hN ); +msg.appendBytes( hN ); + +MessageBytes hV=headers.getValue(i); +c2b.convert( hV ); +msg.appendBytes( hV ); +} +ep.setType( JkHandler.HANDLE_SEND_PACKET ); +ep.getSource().invoke( msg, ep ); +} + // Coyote Action implementation public void action(ActionCode actionCode, Object param) { @@ -243,42 +283,7 @@ if( log.isInfoEnabled() ) log.info(Response already commited ); } else { -if( log.isInfoEnabled() ) -log.info(COMMIT sending headers + res + + res.getMimeHeaders() ); - -C2BConverter c2b=(C2BConverter)res.getNote( utfC2bNote ); -if( c2b==null ) { -c2b=new C2BConverter( UTF8 ); -res.setNote( utfC2bNote, c2b ); -} - -MsgContext ep=(MsgContext)res.getNote( epNote ); -MsgAjp msg=(MsgAjp)ep.getNote( headersMsgNote ); -msg.reset(); -msg.appendByte(HandlerRequest.JK_AJP13_SEND_HEADERS); -msg.appendInt( res.getStatus() ); - -// s-b conversion, message -msg.appendBytes( null ); - -// XXX add headers - -MimeHeaders headers=res.getMimeHeaders(); -int numHeaders = headers.size(); -msg.appendInt(numHeaders); -for( int i=0; inumHeaders; i++ ) { -MessageBytes hN=headers.getName(i); -// no header to sc conversion - there's little benefit -// on this direction -c2b.convert ( hN ); -msg.appendBytes( hN ); - -MessageBytes
cvs commit: jakarta-tomcat-connectors/jk/java/org/apache/jk/server JkCoyoteHandler.java JkMain.java
costin 02/04/25 16:13:24 Modified:jk/java/org/apache/jk/common ChannelSocket.java ChannelUn.java JniHandler.java jk/java/org/apache/jk/server JkCoyoteHandler.java JkMain.java Log: Fewer messages, more info. We can remove even more - but I would like to keep at least one line for each endpoint that is listening. Revision ChangesPath 1.11 +1 -1 jakarta-tomcat-connectors/jk/java/org/apache/jk/common/ChannelSocket.java Index: ChannelSocket.java === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/java/org/apache/jk/common/ChannelSocket.java,v retrieving revision 1.10 retrieving revision 1.11 diff -u -r1.10 -r1.11 --- ChannelSocket.java23 Apr 2002 16:25:04 - 1.10 +++ ChannelSocket.java25 Apr 2002 23:13:24 - 1.11 @@ -214,7 +214,7 @@ log.error(Can't find free port + startPort + + maxPort ); return; } -log.info(Init + port ); +log.info(JK: listening on tcp port + port ); // If this is not the base port and we are the 'main' channleSocket and // SHM didn't already set the localId - we'll set the instance id 1.17 +2 -2 jakarta-tomcat-connectors/jk/java/org/apache/jk/common/ChannelUn.java Index: ChannelUn.java === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/java/org/apache/jk/common/ChannelUn.java,v retrieving revision 1.16 retrieving revision 1.17 diff -u -r1.16 -r1.17 --- ChannelUn.java25 Apr 2002 22:04:00 - 1.16 +++ ChannelUn.java25 Apr 2002 23:13:24 - 1.17 @@ -128,7 +128,7 @@ public void init() throws IOException { apr=(AprImpl)wEnv.getHandler(apr); if( apr==null || ! apr.isLoaded() ) { -log.error(Apr is not available, disabling unix channel ); +log.debug(Apr is not available, disabling unix channel ); apr=null; return; } @@ -163,7 +163,7 @@ if (unixListenSocket0) throw(new IOException(Cannot create listening socket + file)); -log.info(Listening on unix socket: + file ); +log.info(JK: listening on unix socket: + file ); // Run a thread that will accept connections. tp.start(); 1.3 +3 -2 jakarta-tomcat-connectors/jk/java/org/apache/jk/common/JniHandler.java Index: JniHandler.java === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/java/org/apache/jk/common/JniHandler.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- JniHandler.java 25 Apr 2002 22:44:23 - 1.2 +++ JniHandler.java 25 Apr 2002 23:13:24 - 1.3 @@ -114,7 +114,8 @@ protected void initNative(String nativeComponentName) { apr=(AprImpl)wEnv.getHandler(apr); if( apr==null || ! apr.isLoaded() ) { -log.error(No apr, disabling jni proxy ); +if( log.isDebugEnabled() ) +log.debug(No apr, disabling jni proxy ); apr=null; return; } @@ -126,7 +127,7 @@ log.info(Component not found, creating it + nativeComponentName ); nativeJkHandlerP=apr.createJkHandler(xEnv, nativeComponentName); } -log.info(Native proxy + nativeJkHandlerP ); +log.debug(Native proxy + nativeJkHandlerP ); apr.releaseJkEnv(xEnv); } 1.18 +2 -3 jakarta-tomcat-connectors/jk/java/org/apache/jk/server/JkCoyoteHandler.java Index: JkCoyoteHandler.java === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/java/org/apache/jk/server/JkCoyoteHandler.java,v retrieving revision 1.17 retrieving revision 1.18 diff -u -r1.17 -r1.18 --- JkCoyoteHandler.java 25 Apr 2002 18:27:18 - 1.17 +++ JkCoyoteHandler.java 25 Apr 2002 23:13:24 - 1.18 @@ -94,7 +94,8 @@ protected JkMain jkMain=new JkMain(); public void setProperty( String name, String value ) { -log.info(setProperty + name + + value ); +if( log.isDebugEnabled()) +log.debug(setProperty + name + + value ); jkMain.setProperty( name, value ); properties.put( name, value ); } @@ -139,8 +140,6 @@ jkMain.init(); jkMain.start(); - -log.info(Jk2 started ); headersMsgNote=wEnv.getNoteId( WorkerEnv.ENDPOINT_NOTE, headerMsg );
cvs commit: jakarta-tomcat-connectors/jk/java/org/apache/jk/server JkCoyoteHandler.java JkMain.java
costin 02/04/24 12:45:09 Modified:jk/java/org/apache/jk/server JkCoyoteHandler.java JkMain.java Log: Potential fix for 8478. Check if the response has been already commited, and don't recommit. Display a small info notice - COMMIT action shouldn't be called twice or after the first chunk. Revision ChangesPath 1.15 +39 -36 jakarta-tomcat-connectors/jk/java/org/apache/jk/server/JkCoyoteHandler.java Index: JkCoyoteHandler.java === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/java/org/apache/jk/server/JkCoyoteHandler.java,v retrieving revision 1.14 retrieving revision 1.15 diff -u -r1.14 -r1.15 --- JkCoyoteHandler.java 23 Apr 2002 08:11:05 - 1.14 +++ JkCoyoteHandler.java 24 Apr 2002 19:45:09 - 1.15 @@ -239,47 +239,50 @@ if( actionCode==ActionCode.ACTION_COMMIT ) { org.apache.coyote.Response res=(org.apache.coyote.Response)param; -if( log.isInfoEnabled() ) -log.info(COMMIT sending headers + res + + res.getMimeHeaders() ); - - -C2BConverter c2b=(C2BConverter)res.getNote( utfC2bNote ); -if( c2b==null ) { -c2b=new C2BConverter( UTF8 ); -res.setNote( utfC2bNote, c2b ); -} - -MsgContext ep=(MsgContext)res.getNote( epNote ); -MsgAjp msg=(MsgAjp)ep.getNote( headersMsgNote ); -msg.reset(); -msg.appendByte(HandlerRequest.JK_AJP13_SEND_HEADERS); -msg.appendInt( res.getStatus() ); - -// s-b conversion, message -msg.appendBytes( null ); - -// XXX add headers - -MimeHeaders headers=res.getMimeHeaders(); -int numHeaders = headers.size(); -msg.appendInt(numHeaders); -for( int i=0; inumHeaders; i++ ) { -MessageBytes hN=headers.getName(i); -// no header to sc conversion - there's little benefit -// on this direction -c2b.convert ( hN ); -msg.appendBytes( hN ); +if( res.isCommited() ) { +if( log.isInfoEnabled() ) +log.info(Response already commited ); +} else { +if( log.isInfoEnabled() ) +log.info(COMMIT sending headers + res + + res.getMimeHeaders() ); + +C2BConverter c2b=(C2BConverter)res.getNote( utfC2bNote ); +if( c2b==null ) { +c2b=new C2BConverter( UTF8 ); +res.setNote( utfC2bNote, c2b ); +} + +MsgContext ep=(MsgContext)res.getNote( epNote ); +MsgAjp msg=(MsgAjp)ep.getNote( headersMsgNote ); +msg.reset(); +msg.appendByte(HandlerRequest.JK_AJP13_SEND_HEADERS); +msg.appendInt( res.getStatus() ); + +// s-b conversion, message +msg.appendBytes( null ); -MessageBytes hV=headers.getValue(i); -c2b.convert( hV ); -msg.appendBytes( hV ); +// XXX add headers + +MimeHeaders headers=res.getMimeHeaders(); +int numHeaders = headers.size(); +msg.appendInt(numHeaders); +for( int i=0; inumHeaders; i++ ) { +MessageBytes hN=headers.getName(i); +// no header to sc conversion - there's little benefit +// on this direction +c2b.convert ( hN ); +msg.appendBytes( hN ); + +MessageBytes hV=headers.getValue(i); +c2b.convert( hV ); +msg.appendBytes( hV ); +} +ep.setType( JkHandler.HANDLE_SEND_PACKET ); +ep.getSource().invoke( msg, ep ); } -ep.setType( JkHandler.HANDLE_SEND_PACKET ); -ep.getSource().invoke( msg, ep ); } else if( actionCode==ActionCode.ACTION_RESET ) { if( log.isInfoEnabled() ) log.info(RESET ); - } else
cvs commit: jakarta-tomcat-connectors/jk/java/org/apache/jk/server JkCoyoteHandler.java
costin 02/04/24 16:20:38 Modified:jk/java/org/apache/jk/server JkCoyoteHandler.java Log: extra 't' Revision ChangesPath 1.16 +1 -1 jakarta-tomcat-connectors/jk/java/org/apache/jk/server/JkCoyoteHandler.java Index: JkCoyoteHandler.java === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/java/org/apache/jk/server/JkCoyoteHandler.java,v retrieving revision 1.15 retrieving revision 1.16 diff -u -r1.15 -r1.16 --- JkCoyoteHandler.java 24 Apr 2002 19:45:09 - 1.15 +++ JkCoyoteHandler.java 24 Apr 2002 23:20:38 - 1.16 @@ -239,7 +239,7 @@ if( actionCode==ActionCode.ACTION_COMMIT ) { org.apache.coyote.Response res=(org.apache.coyote.Response)param; -if( res.isCommited() ) { +if( res.isCommitted() ) { if( log.isInfoEnabled() ) log.info(Response already commited ); } else { -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
cvs commit: jakarta-tomcat-connectors/jk/java/org/apache/jk/server JkCoyoteHandler.java
remm02/04/23 01:11:05 Modified:jk/java/org/apache/jk/server JkCoyoteHandler.java Log: - The boolean test was inverted (cut paste bug ...). - AJP does display some stack traces on shutdown. Revision ChangesPath 1.14 +1 -1 jakarta-tomcat-connectors/jk/java/org/apache/jk/server/JkCoyoteHandler.java Index: JkCoyoteHandler.java === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/java/org/apache/jk/server/JkCoyoteHandler.java,v retrieving revision 1.13 retrieving revision 1.14 diff -u -r1.13 -r1.14 --- JkCoyoteHandler.java 22 Apr 2002 20:19:02 - 1.13 +++ JkCoyoteHandler.java 23 Apr 2002 08:11:05 - 1.14 @@ -155,7 +155,7 @@ } public void destroy() { -if( started ) return; +if( !started ) return; started = false; jkMain.stop(); -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
cvs commit: jakarta-tomcat-connectors/jk/java/org/apache/jk/server JkCoyoteHandler.java JkMain.java
costin 02/04/22 12:03:34 Modified:jk/java/org/apache/jk/server JkCoyoteHandler.java JkMain.java Log: Fix the shutdown for jk2. Revision ChangesPath 1.12 +1 -1 jakarta-tomcat-connectors/jk/java/org/apache/jk/server/JkCoyoteHandler.java Index: JkCoyoteHandler.java === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/java/org/apache/jk/server/JkCoyoteHandler.java,v retrieving revision 1.11 retrieving revision 1.12 diff -u -r1.11 -r1.12 --- JkCoyoteHandler.java 17 Apr 2002 22:39:26 - 1.11 +++ JkCoyoteHandler.java 22 Apr 2002 19:03:34 - 1.12 @@ -155,7 +155,7 @@ } public void destroy() { -// jkMain.stop(); +jkMain.stop(); } // OutputBuffer implementation 1.21 +18 -1 jakarta-tomcat-connectors/jk/java/org/apache/jk/server/JkMain.java Index: JkMain.java === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/java/org/apache/jk/server/JkMain.java,v retrieving revision 1.20 retrieving revision 1.21 diff -u -r1.20 -r1.21 --- JkMain.java 18 Apr 2002 19:13:02 - 1.20 +++ JkMain.java 22 Apr 2002 19:03:34 - 1.21 @@ -230,7 +230,24 @@ shm, request, container, - channelSocket}; + channelSocket, + channelJni, + channelUn}; + +public void stop() +{ +for( int i=0; iwEnv.getHandlerCount(); i++ ) { +if( wEnv.getHandler(i) != null ) { +try { +wEnv.getHandler(i).destroy(); +} catch( IOException ex) { +log.error(Error stoping + wEnv.getHandler(i).getName(), ex); +} +} +} + +started=false; +} public void start() throws IOException { -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
cvs commit: jakarta-tomcat-connectors/jk/java/org/apache/jk/server JkCoyoteHandler.java
remm02/04/22 13:19:02 Modified:jk/java/org/apache/jk/server JkCoyoteHandler.java Log: - Fix the fix for the shutdown. - Costin: if the fix is not good, feel free to revert or fix it. Revision ChangesPath 1.13 +3 -0 jakarta-tomcat-connectors/jk/java/org/apache/jk/server/JkCoyoteHandler.java Index: JkCoyoteHandler.java === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/java/org/apache/jk/server/JkCoyoteHandler.java,v retrieving revision 1.12 retrieving revision 1.13 diff -u -r1.12 -r1.13 --- JkCoyoteHandler.java 22 Apr 2002 19:03:34 - 1.12 +++ JkCoyoteHandler.java 22 Apr 2002 20:19:02 - 1.13 @@ -155,6 +155,9 @@ } public void destroy() { +if( started ) return; + +started = false; jkMain.stop(); } -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
cvs commit: jakarta-tomcat-connectors/jk/java/org/apache/jk/server JkCoyoteHandler.java
costin 02/04/17 15:39:26 Modified:jk/java/org/apache/jk/server JkCoyoteHandler.java Log: Update. Revision ChangesPath 1.11 +6 -3 jakarta-tomcat-connectors/jk/java/org/apache/jk/server/JkCoyoteHandler.java Index: JkCoyoteHandler.java === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/java/org/apache/jk/server/JkCoyoteHandler.java,v retrieving revision 1.10 retrieving revision 1.11 diff -u -r1.10 -r1.11 --- JkCoyoteHandler.java 10 Apr 2002 23:53:11 - 1.10 +++ JkCoyoteHandler.java 17 Apr 2002 22:39:26 - 1.11 @@ -178,7 +178,8 @@ msg.reset(); msg.appendByte( HandlerRequest.JK_AJP13_SEND_BODY_CHUNK); msg.appendBytes( chunk.getBytes(), chunk.getOffset(), chunk.getLength() ); -ep.getChannel().send( msg, ep ); +ep.setType( JkHandler.HANDLE_SEND_PACKET ); +ep.getSource().invoke( msg, ep ); return 0; } @@ -270,7 +271,8 @@ c2b.convert( hV ); msg.appendBytes( hV ); } -ep.getChannel().send( msg, ep ); +ep.setType( JkHandler.HANDLE_SEND_PACKET ); +ep.getSource().invoke( msg, ep ); } else if( actionCode==ActionCode.ACTION_RESET ) { if( log.isInfoEnabled() ) log.info(RESET ); @@ -286,7 +288,8 @@ msg.appendByte( HandlerRequest.JK_AJP13_END_RESPONSE ); msg.appendInt( 1 ); -ep.getChannel().send(msg, ep ); +ep.setType( JkHandler.HANDLE_SEND_PACKET ); +ep.getSource().invoke( msg, ep ); } else if( actionCode==ActionCode.ACTION_REQ_SSL_ATTRIBUTE ) { -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
cvs commit: jakarta-tomcat-connectors/jk/java/org/apache/jk/server JkCoyoteHandler.java JkMain.java
costin 02/04/10 13:43:41 Modified:jk/java/org/apache/jk/server JkCoyoteHandler.java JkMain.java Log: Few tweaks, pass attributes to jk components, etc. Revision ChangesPath 1.9 +12 -7 jakarta-tomcat-connectors/jk/java/org/apache/jk/server/JkCoyoteHandler.java Index: JkCoyoteHandler.java === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/java/org/apache/jk/server/JkCoyoteHandler.java,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- JkCoyoteHandler.java 9 Apr 2002 20:51:06 - 1.8 +++ JkCoyoteHandler.java 10 Apr 2002 20:43:41 - 1.9 @@ -97,6 +97,8 @@ */ public void setAttribute( String name, Object value ) { log.info(setAttribute + name + + value ); +if( value instanceof String ) +jkMain.setProperty( name, (String)value ); } public Object getAttribute( String name ) { @@ -260,13 +262,11 @@ msg.appendBytes( hV ); } ep.getChannel().send( msg, ep ); -} -if( actionCode==ActionCode.ACTION_RESET ) { +} else if( actionCode==ActionCode.ACTION_RESET ) { if( log.isInfoEnabled() ) log.info(RESET ); -} -if( actionCode==ActionCode.ACTION_CLOSE ) { +} else if( actionCode==ActionCode.ACTION_CLOSE ) { if( log.isInfoEnabled() ) log.info(CLOSE ); org.apache.coyote.Response res=(org.apache.coyote.Response)param; @@ -278,11 +278,16 @@ msg.appendInt( 1 ); ep.getChannel().send(msg, ep ); -} -if( actionCode==ActionCode.ACTION_ACK ) { +} else if( actionCode==ActionCode.ACTION_REQ_SSL_ATTRIBUTE ) { + + +} else if( actionCode==ActionCode.ACTION_REQ_HOST_ATTRIBUTE ) { + + +} else if( actionCode==ActionCode.ACTION_ACK ) { if( log.isInfoEnabled() ) log.info(ACK ); - +// What should we do here ? Who calls it ? } } catch( Exception ex ) { log.error( Error in action code , ex ); 1.13 +3 -5 jakarta-tomcat-connectors/jk/java/org/apache/jk/server/JkMain.java Index: JkMain.java === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/java/org/apache/jk/server/JkMain.java,v retrieving revision 1.12 retrieving revision 1.13 diff -u -r1.12 -r1.13 --- JkMain.java 20 Feb 2002 23:43:43 - 1.12 +++ JkMain.java 10 Apr 2002 20:43:41 - 1.13 @@ -70,10 +70,9 @@ import org.apache.tomcat.util.http.*; import org.apache.tomcat.util.IntrospectionUtils; -/** Main class used for testing jk core and common code and tunning. +/** Main class used to startup jk. * - * It'll just start/init jk and use a dummy endpoint ( i.e. no servlet - * container ). + * It is also useable standalone for testing or as a minimal socket server. */ public class JkMain { @@ -137,6 +136,7 @@ String home=wEnv.getJkHome(); if( home==null ) { // XXX use IntrospectionUtil to find myself +jkMain.guessHome(); } if( home != null ) { File hF=new File(home); @@ -252,8 +252,6 @@ IntrospectionUtils.processArgs( jkMain, args, new String[] {}, null, new Hashtable()); -jkMain.guessHome(); - jkMain.init(); jkMain.start(); } catch( Exception ex ) { -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
cvs commit: jakarta-tomcat-connectors/jk/java/org/apache/jk/server JkCoyoteHandler.java JkMain.java
costin 02/04/10 16:53:11 Modified:jk/java/org/apache/jk/apr AprImpl.java jk/java/org/apache/jk/common ChannelUn.java jk/java/org/apache/jk/core JkHandler.java jk/java/org/apache/jk/server JkCoyoteHandler.java JkMain.java Log: More fixes for the new env. The properties will find their way to the target jk component ( assuming you want to use attributes in server.xml for config - I strongly disagree with this ) conf/jk2.properties ( or whatever name you set ) will be read. Also: AprImpl and ChannelUn work - assuming you know the magic incantations. ( i.e. jk2.properties and LD_LIBRARY_PATH ) Revision ChangesPath 1.4 +27 -11jakarta-tomcat-connectors/jk/java/org/apache/jk/apr/AprImpl.java Index: AprImpl.java === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/java/org/apache/jk/apr/AprImpl.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- AprImpl.java 12 Jan 2002 04:01:47 - 1.3 +++ AprImpl.java 10 Apr 2002 23:53:11 - 1.4 @@ -10,6 +10,7 @@ public class AprImpl { String baseDir; String aprHome; +String soExt=so; /** Initialize APR */ @@ -51,7 +52,11 @@ public void setBaseDir(String s) { baseDir=s; } - + +public void setSoExt(String s ) { +soExt=s; +} + // XXX maybe install the jni lib in apr-home ? public void setAprHome( String s ) { aprHome=s; @@ -71,16 +76,27 @@ public void loadNative() { if( aprHome==null ) aprHome=baseDir; -File dir=new File(aprHome); -// XXX platform independent, etc... -File apr=new File( dir, libapr.so); - -loadNative( apr.getAbsolutePath() ); - -dir=new File(baseDir); -File jniConnect=new File( dir, jni_connect.so); - -loadNative( jniConnect.getAbsolutePath() ); +if( aprHome==null ) { +// Use load() +try { +System.loadLibrary( apr ); +System.loadLibrary( jni_connect ); +} catch( Throwable ex ) { +ok=false; +ex.printStackTrace(); +} +} else { +File dir=new File(aprHome); +// XXX platform independent, etc... +File apr=new File( dir, libapr. + soExt ); + +loadNative( apr.getAbsolutePath() ); + +dir=new File(baseDir); +File jniConnect=new File( dir, jni_connect. + soExt ); + +loadNative( jniConnect.getAbsolutePath() ); +} } boolean ok=true; 1.8 +20 -5 jakarta-tomcat-connectors/jk/java/org/apache/jk/common/ChannelUn.java Index: ChannelUn.java === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/java/org/apache/jk/common/ChannelUn.java,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- ChannelUn.java4 Apr 2002 00:55:35 - 1.7 +++ ChannelUn.java10 Apr 2002 23:53:11 - 1.8 @@ -82,6 +82,7 @@ String file; ThreadPool tp=new ThreadPool(); String jkHome; +String aprHome; /* Tcp socket options */ @@ -100,6 +101,12 @@ jkHome=s; } +/** Directory where APR and jni_connect are installed. + */ +public void setAprHome( String s ) { +aprHome=s; +} + /* */ long unixListenSocket; int socketNote=1; @@ -120,14 +127,22 @@ public void init() throws IOException { apr=new AprImpl(); -File f=new File( jkHome ); -File aprBase=new File( jkHome, /WEB-INF/jk2/jni ); -apr.setBaseDir( aprBase.getAbsolutePath() ); -apr.loadNative(); +if( aprHome==null jkHome != null ) { +File f=new File( jkHome ); +File aprBase=new File( jkHome, jk2/jni ); +if( aprBase.exists() ) { +aprHome=aprBase.getAbsolutePath(); +} +} +if( aprHome != null ) { +apr.setBaseDir( aprHome ); +} +apr.loadNative(); + apr.initialize(); +if( log.isDebugEnabled() ) log.debug( Creating pool + gPool ); gPool=apr.poolCreate( 0 ); -if( log.isDebugEnabled() ) log.debug( Create pool + gPool ); File socketFile=new File( file ); if( socketFile.exists() ) { 1.5 +1 -1
cvs commit: jakarta-tomcat-connectors/jk/java/org/apache/jk/server JkCoyoteHandler.java
costin 02/04/09 10:13:51 Modified:jk/java/org/apache/jk/server JkCoyoteHandler.java Log: Implement the input buffer. Recycle the req/res ( coyote http adapter doesn't call recycle on coyoteRequest/coyoteResponse - which is actually a very good idea ). Add a workaround for the fact that COMMIT is not called. Revision ChangesPath 1.5 +28 -5 jakarta-tomcat-connectors/jk/java/org/apache/jk/server/JkCoyoteHandler.java Index: JkCoyoteHandler.java === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/java/org/apache/jk/server/JkCoyoteHandler.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- JkCoyoteHandler.java 8 Apr 2002 22:59:37 - 1.4 +++ JkCoyoteHandler.java 9 Apr 2002 17:13:51 - 1.5 @@ -86,7 +86,8 @@ int utfC2bNote; int obNote; int epNote; - +int inputStreamNote; + Adapter adapter; protected JkMain jkMain=new JkMain(); @@ -121,6 +122,8 @@ jkMain.getWorkerEnv().addHandler(container, this ); try { +// jkMain.setJkHome() XXX; + jkMain.init(); jkMain.start(); @@ -130,6 +133,8 @@ utfC2bNote=wEnv.getNoteId( WorkerEnv.ENDPOINT_NOTE, utfC2B ); epNote=wEnv.getNoteId( WorkerEnv.ENDPOINT_NOTE, ep ); obNote=wEnv.getNoteId( WorkerEnv.ENDPOINT_NOTE, coyoteBuffer ); +inputStreamNote= wEnv.getNoteId( WorkerEnv.ENDPOINT_NOTE, + jkInputStream); } catch( Exception ex ) { ex.printStackTrace(); @@ -146,6 +151,7 @@ { int epNote; int headersMsgNote; +int inputStreamNote; org.apache.coyote.Response res; void setResponse( org.apache.coyote.Response res ) { @@ -155,6 +161,12 @@ public int doWrite(ByteChunk chunk) throws IOException { +if (!res.isCommitted()) { +// Send the connector a request for commit. The connector should +// then validate the headers, send them (using sendHeader) and +// set the filters accordingly. +res.action(ActionCode.ACTION_COMMIT, null); +} if( log.isInfoEnabled() ) log.info(doWrite ); MsgContext ep=(MsgContext)res.getNote( epNote ); @@ -172,8 +184,12 @@ throws IOException { if( log.isInfoEnabled() ) -log.info(doRead ); -return 0; +log.info(doRead + chunk.getBytes() + + chunk.getOffset() + + chunk.getLength()); +MsgContext ep=(MsgContext)res.getNote( epNote ); + +JkInputStream jkIS=(JkInputStream)ep.getNote( inputStreamNote ); +// return jkIS.read( chunk.getBytes(), chunk.getOffset(), chunk.getLength()); +return jkIS.doRead( chunk ); } } @@ -186,13 +202,16 @@ org.apache.coyote.Response res=req.getResponse(); res.setHook( this ); +log.info( Invoke + req + + res + + req.requestURI().toString()); JkCoyoteBuffers ob=(JkCoyoteBuffers)res.getNote( obNote ); if( ob == null ) { // Buffers not initialized yet // Workaround - IB, OB require state. ob=new JkCoyoteBuffers(); +// Pass the required state. ob.epNote=epNote; ob.headersMsgNote=headersMsgNote; +ob.inputStreamNote=inputStreamNote; ob.setResponse(res); res.setOutputBuffer( ob ); req.setInputBuffer( ob ); @@ -209,6 +228,9 @@ } catch( Exception ex ) { ex.printStackTrace(); } + +req.recycle(); +res.recycle(); return OK; } @@ -217,10 +239,11 @@ public void action(ActionCode actionCode, Object param) { try { if( actionCode==ActionCode.ACTION_COMMIT ) { +org.apache.coyote.Response res=(org.apache.coyote.Response)param; + if( log.isInfoEnabled() ) -log.info(COMMIT sending headers ); +log.info(COMMIT sending headers + res + + res.getMimeHeaders() ); -org.apache.coyote.Response res=(org.apache.coyote.Response)param; C2B c2b=(C2B)res.getNote( utfC2bNote ); if( c2b==null ) { -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
cvs commit: jakarta-tomcat-connectors/jk/java/org/apache/jk/server JkCoyoteHandler.java
costin 02/04/09 13:19:53 Modified:jk/java/org/apache/jk/server JkCoyoteHandler.java Log: Update to the stateless-enabled Input/OutputBuffer interfaces. Clean up the code ( jk2 is mostly stateless ) Revision ChangesPath 1.6 +42 -58 jakarta-tomcat-connectors/jk/java/org/apache/jk/server/JkCoyoteHandler.java Index: JkCoyoteHandler.java === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/java/org/apache/jk/server/JkCoyoteHandler.java,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- JkCoyoteHandler.java 9 Apr 2002 17:13:51 - 1.5 +++ JkCoyoteHandler.java 9 Apr 2002 20:19:53 - 1.6 @@ -77,7 +77,10 @@ /** Plugs Jk2 into Coyote */ public class JkCoyoteHandler extends JkHandler implements -ProtocolHandler, ActionHook +ProtocolHandler, +ActionHook, +org.apache.coyote.OutputBuffer, +org.apache.coyote.InputBuffer { protected static org.apache.commons.logging.Log log = org.apache.commons.logging.LogFactory.getLog(JkCoyoteHandler.class); @@ -144,55 +147,45 @@ public void destroy() { // jkMain.stop(); } + // OutputBuffer implementation -static class JkCoyoteBuffers implements org.apache.coyote.OutputBuffer, -org.apache.coyote.InputBuffer -{ -int epNote; -int headersMsgNote; -int inputStreamNote; -org.apache.coyote.Response res; -void setResponse( org.apache.coyote.Response res ) { -this.res=res; +public int doWrite(ByteChunk chunk, Response res) +throws IOException +{ +if (!res.isCommitted()) { +// Send the connector a request for commit. The connector should +// then validate the headers, send them (using sendHeader) and +// set the filters accordingly. +res.action(ActionCode.ACTION_COMMIT, null); } +if( log.isInfoEnabled() ) +log.info(doWrite ); +MsgContext ep=(MsgContext)res.getNote( epNote ); -public int doWrite(ByteChunk chunk) -throws IOException -{ -if (!res.isCommitted()) { -// Send the connector a request for commit. The connector should -// then validate the headers, send them (using sendHeader) and -// set the filters accordingly. -res.action(ActionCode.ACTION_COMMIT, null); -} -if( log.isInfoEnabled() ) -log.info(doWrite ); -MsgContext ep=(MsgContext)res.getNote( epNote ); - -MsgAjp msg=(MsgAjp)ep.getNote( headersMsgNote ); -msg.reset(); -msg.appendByte( HandlerRequest.JK_AJP13_SEND_BODY_CHUNK); -msg.appendBytes( chunk.getBytes(), chunk.getOffset(), chunk.getLength() ); -ep.getChannel().send( msg, ep ); - -return 0; -} +MsgAjp msg=(MsgAjp)ep.getNote( headersMsgNote ); +msg.reset(); +msg.appendByte( HandlerRequest.JK_AJP13_SEND_BODY_CHUNK); +msg.appendBytes( chunk.getBytes(), chunk.getOffset(), chunk.getLength() ); +ep.getChannel().send( msg, ep ); -public int doRead(ByteChunk chunk) -throws IOException -{ -if( log.isInfoEnabled() ) -log.info(doRead + chunk.getBytes() + + chunk.getOffset() + + chunk.getLength()); -MsgContext ep=(MsgContext)res.getNote( epNote ); - -JkInputStream jkIS=(JkInputStream)ep.getNote( inputStreamNote ); -// return jkIS.read( chunk.getBytes(), chunk.getOffset(), chunk.getLength()); -return jkIS.doRead( chunk ); -} +return 0; } - + +public int doRead(ByteChunk chunk, Request req) +throws IOException +{ +Response res=req.getResponse(); +if( log.isInfoEnabled() ) +log.info(doRead + chunk.getBytes() + + chunk.getOffset() + + chunk.getLength()); +MsgContext ep=(MsgContext)res.getNote( epNote ); + +JkInputStream jkIS=(JkInputStream)ep.getNote( inputStreamNote ); +// return jkIS.read( chunk.getBytes(), chunk.getOffset(), chunk.getLength()); +return jkIS.doRead( chunk ); +} + // Jk handler implementation // Jk Handler mehod public int invoke( Msg msg, MsgContext ep ) @@ -203,24 +196,15 @@ res.setHook( this ); log.info( Invoke + req + + res + + req.requestURI().toString()); -
cvs commit: jakarta-tomcat-connectors/jk/java/org/apache/jk/server JkCoyoteHandler.java
costin 02/04/09 13:40:44 Modified:jk/java/org/apache/jk/common JkInputStream.java jk/java/org/apache/jk/core JkHandler.java jk/java/org/apache/jk/server JkCoyoteHandler.java Log: Revision ChangesPath 1.5 +10 -0 jakarta-tomcat-connectors/jk/java/org/apache/jk/common/JkInputStream.java Index: JkInputStream.java === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/java/org/apache/jk/common/JkInputStream.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- JkInputStream.java3 Apr 2002 23:56:08 - 1.4 +++ JkInputStream.java9 Apr 2002 20:40:43 - 1.5 @@ -68,6 +68,7 @@ import javax.servlet.http.Cookie; import org.apache.tomcat.util.buf.MessageBytes; +import org.apache.tomcat.util.buf.ByteChunk; import org.apache.tomcat.util.http.Cookies; import org.apache.tomcat.util.http.ServerCookie; import org.apache.tomcat.util.http.MimeHeaders; @@ -270,6 +271,15 @@ contentLength=-1; } +public int doRead(ByteChunk responseChunk ) throws IOException { +log.info( JkInputStream: + pos + + blen + + available ); +if( blen == pos ) { +receive(); +} +responseChunk.setBytes( bodyBuff, pos, blen-pos ); +return blen - pos; +} + /** Receive a chunk of data. Called to implement the * 'special' packet in ajp13 and to receive the data * after we send a GET_BODY packet 1.4 +2 -0 jakarta-tomcat-connectors/jk/java/org/apache/jk/core/JkHandler.java Index: JkHandler.java === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/java/org/apache/jk/core/JkHandler.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- JkHandler.java4 Apr 2002 19:00:09 - 1.3 +++ JkHandler.java9 Apr 2002 20:40:43 - 1.4 @@ -62,6 +62,8 @@ import java.util.*; import java.security.*; +import org.apache.tomcat.util.handler.*; + /** * * @author Costin Manolache 1.7 +2 -2 jakarta-tomcat-connectors/jk/java/org/apache/jk/server/JkCoyoteHandler.java Index: JkCoyoteHandler.java === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/java/org/apache/jk/server/JkCoyoteHandler.java,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- JkCoyoteHandler.java 9 Apr 2002 20:19:53 - 1.6 +++ JkCoyoteHandler.java 9 Apr 2002 20:40:44 - 1.7 @@ -229,9 +229,9 @@ log.info(COMMIT sending headers + res + + res.getMimeHeaders() ); -C2B c2b=(C2B)res.getNote( utfC2bNote ); +C2BConverter c2b=(C2BConverter)res.getNote( utfC2bNote ); if( c2b==null ) { -c2b=new C2B( UTF8 ); +c2b=new C2BConverter( UTF8 ); res.setNote( utfC2bNote, c2b ); } -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
cvs commit: jakarta-tomcat-connectors/jk/java/org/apache/jk/server JkCoyoteHandler.java
remm02/04/09 13:51:06 Modified:jk/java/org/apache/jk/common JkInputStream.java jk/java/org/apache/jk/server JkCoyoteHandler.java Log: - Remove old package from imports. Revision ChangesPath 1.6 +0 -1 jakarta-tomcat-connectors/jk/java/org/apache/jk/common/JkInputStream.java Index: JkInputStream.java === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/java/org/apache/jk/common/JkInputStream.java,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- JkInputStream.java9 Apr 2002 20:40:43 - 1.5 +++ JkInputStream.java9 Apr 2002 20:51:06 - 1.6 @@ -75,7 +75,6 @@ import org.apache.jk.core.*; import org.apache.jk.common.*; -import org.apache.jk.util.*; /** Generic input stream impl on top of ajp 1.8 +0 -1 jakarta-tomcat-connectors/jk/java/org/apache/jk/server/JkCoyoteHandler.java Index: JkCoyoteHandler.java === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/java/org/apache/jk/server/JkCoyoteHandler.java,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- JkCoyoteHandler.java 9 Apr 2002 20:40:44 - 1.7 +++ JkCoyoteHandler.java 9 Apr 2002 20:51:06 - 1.8 @@ -66,7 +66,6 @@ import org.apache.jk.*; import org.apache.jk.core.*; import org.apache.jk.common.*; -import org.apache.jk.util.*; import org.apache.tomcat.util.buf.*; import org.apache.tomcat.util.log.*; -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
cvs commit: jakarta-tomcat-connectors/jk/java/org/apache/jk/server JkCoyoteHandler.java
costin 02/04/08 15:59:37 Modified:jk/java/org/apache/jk/server JkCoyoteHandler.java Log: More impl. Now it kind-of-works ( something is broken in headers, but close ) Revision ChangesPath 1.4 +142 -14 jakarta-tomcat-connectors/jk/java/org/apache/jk/server/JkCoyoteHandler.java Index: JkCoyoteHandler.java === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/java/org/apache/jk/server/JkCoyoteHandler.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- JkCoyoteHandler.java 6 Apr 2002 17:02:47 - 1.3 +++ JkCoyoteHandler.java 8 Apr 2002 22:59:37 - 1.4 @@ -76,15 +76,24 @@ /** Plugs Jk2 into Coyote */ -public class JkCoyoteHandler extends JkHandler implements ProtocolHandler, ActionHook +public class JkCoyoteHandler extends JkHandler implements +ProtocolHandler, ActionHook { +protected static org.apache.commons.logging.Log log += org.apache.commons.logging.LogFactory.getLog(JkCoyoteHandler.class); +int headersMsgNote; +int c2bConvertersNote; +int utfC2bNote; +int obNote; +int epNote; + Adapter adapter; protected JkMain jkMain=new JkMain(); /** Pass config info */ public void setAttribute( String name, Object value ) { -System.out.println(Set attribute + name + + value ); +log.info(setAttribute + name + + value ); } public Object getAttribute( String name ) { @@ -114,6 +123,14 @@ try { jkMain.init(); jkMain.start(); + +log.info(Jk2 started ); + +headersMsgNote=wEnv.getNoteId( WorkerEnv.ENDPOINT_NOTE, headerMsg ); +utfC2bNote=wEnv.getNoteId( WorkerEnv.ENDPOINT_NOTE, utfC2B ); +epNote=wEnv.getNoteId( WorkerEnv.ENDPOINT_NOTE, ep ); +obNote=wEnv.getNoteId( WorkerEnv.ENDPOINT_NOTE, coyoteBuffer ); + } catch( Exception ex ) { ex.printStackTrace(); } @@ -122,16 +139,71 @@ public void destroy() { // jkMain.stop(); } +// OutputBuffer implementation +static class JkCoyoteBuffers implements org.apache.coyote.OutputBuffer, +org.apache.coyote.InputBuffer +{ +int epNote; +int headersMsgNote; +org.apache.coyote.Response res; + +void setResponse( org.apache.coyote.Response res ) { +this.res=res; +} + +public int doWrite(ByteChunk chunk) +throws IOException +{ +if( log.isInfoEnabled() ) +log.info(doWrite ); +MsgContext ep=(MsgContext)res.getNote( epNote ); + +MsgAjp msg=(MsgAjp)ep.getNote( headersMsgNote ); +msg.reset(); +msg.appendByte( HandlerRequest.JK_AJP13_SEND_BODY_CHUNK); +msg.appendBytes( chunk.getBytes(), chunk.getOffset(), chunk.getLength() ); +ep.getChannel().send( msg, ep ); + +return 0; +} + +public int doRead(ByteChunk chunk) +throws IOException +{ +if( log.isInfoEnabled() ) +log.info(doRead ); +return 0; +} +} +// Jk handler implementation // Jk Handler mehod public int invoke( Msg msg, MsgContext ep ) throws IOException { -System.out.println(XXX Invoke ); org.apache.coyote.Request req=(org.apache.coyote.Request)ep.getRequest(); org.apache.coyote.Response res=req.getResponse(); res.setHook( this ); + +JkCoyoteBuffers ob=(JkCoyoteBuffers)res.getNote( obNote ); +if( ob == null ) { +// Buffers not initialized yet +// Workaround - IB, OB require state. +ob=new JkCoyoteBuffers(); +ob.epNote=epNote; +ob.headersMsgNote=headersMsgNote; +ob.setResponse(res); +res.setOutputBuffer( ob ); +req.setInputBuffer( ob ); + +Msg msg2=new MsgAjp(); +ep.setNote( headersMsgNote, msg ); + +res.setNote( obNote, ob ); +} +res.setNote( epNote, ep ); + try { adapter.service( req, res ); } catch( Exception ex ) { @@ -140,18 +212,74 @@ return OK; } +// Coyote Action implementation + public void action(ActionCode actionCode, Object param) { -System.out.println(XXX Action + actionCode +
cvs commit: jakarta-tomcat-connectors/jk/java/org/apache/jk/server JkCoyoteHandler.java
costin 02/04/06 09:02:47 Modified:jk/java/org/apache/jk/server JkCoyoteHandler.java Log: Initial implementation for the coyote ProtocolHandler. Very early code, not working - I have to implement the callbacks. Note that all existing jk connectors will be deprecated/removed and merged with coyote. Revision ChangesPath 1.3 +46 -18 jakarta-tomcat-connectors/jk/java/org/apache/jk/server/JkCoyoteHandler.java Index: JkCoyoteHandler.java === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/java/org/apache/jk/server/JkCoyoteHandler.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- JkCoyoteHandler.java 5 Apr 2002 13:37:39 - 1.2 +++ JkCoyoteHandler.java 6 Apr 2002 17:02:47 - 1.3 @@ -76,30 +76,15 @@ /** Plugs Jk2 into Coyote */ -public class JkCoyoteHandler implements ProtocolHandler +public class JkCoyoteHandler extends JkHandler implements ProtocolHandler, ActionHook { -static class ResponseActionHook implements ActionHook { -public void action(ActionCode actionCode, Object param) { -if( actionCode==ActionCode.ACTION_COMMIT ) { - -} -if( actionCode==ActionCode.ACTION_RESET ) { - -} -if( actionCode==ActionCode.ACTION_CLOSE ) { -} -if( actionCode==ActionCode.ACTION_ACK ) { - -} -} -} - Adapter adapter; +protected JkMain jkMain=new JkMain(); /** Pass config info */ public void setAttribute( String name, Object value ) { - +System.out.println(Set attribute + name + + value ); } public Object getAttribute( String name ) { @@ -116,16 +101,59 @@ return adapter; } +boolean started=false; + /** Start the protocol */ public void init() { +if( started ) return; +started=true; +jkMain.getWorkerEnv().addHandler(container, this ); + +try { +jkMain.init(); +jkMain.start(); +} catch( Exception ex ) { +ex.printStackTrace(); +} } public void destroy() { +// jkMain.stop(); +} + +// Jk Handler mehod +public int invoke( Msg msg, MsgContext ep ) +throws IOException +{ +System.out.println(XXX Invoke ); +org.apache.coyote.Request req=(org.apache.coyote.Request)ep.getRequest(); +org.apache.coyote.Response res=req.getResponse(); +res.setHook( this ); +try { +adapter.service( req, res ); +} catch( Exception ex ) { +ex.printStackTrace(); +} +return OK; } +public void action(ActionCode actionCode, Object param) { +System.out.println(XXX Action + actionCode + + param ); +if( actionCode==ActionCode.ACTION_COMMIT ) { + +} +if( actionCode==ActionCode.ACTION_RESET ) { + +} +if( actionCode==ActionCode.ACTION_CLOSE ) { +} +if( actionCode==ActionCode.ACTION_ACK ) { + +} +} } -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
cvs commit: jakarta-tomcat-connectors/jk/java/org/apache/jk/server JkCoyoteHandler.java
remm02/04/05 05:37:39 Modified:jk/java/org/apache/jk/server JkCoyoteHandler.java Log: - Fix the build (remove TC 3.3 imports + implement missing method). Revision ChangesPath 1.2 +4 -4 jakarta-tomcat-connectors/jk/java/org/apache/jk/server/JkCoyoteHandler.java Index: JkCoyoteHandler.java === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/java/org/apache/jk/server/JkCoyoteHandler.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- JkCoyoteHandler.java 5 Apr 2002 00:13:17 - 1.1 +++ JkCoyoteHandler.java 5 Apr 2002 13:37:39 - 1.2 @@ -67,11 +67,7 @@ import org.apache.jk.core.*; import org.apache.jk.common.*; import org.apache.jk.util.*; -import org.apache.tomcat.modules.server.PoolTcpConnector; -import org.apache.tomcat.core.*; - -import org.apache.tomcat.util.net.*; import org.apache.tomcat.util.buf.*; import org.apache.tomcat.util.log.*; import org.apache.tomcat.util.http.*; @@ -106,6 +102,10 @@ } +public Object getAttribute( String name ) { +return null; +} + /** The adapter, used to call the connector */ public void setAdapter(Adapter adapter) { -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
cvs commit: jakarta-tomcat-connectors/jk/java/org/apache/jk/server JkCoyoteHandler.java
costin 02/04/04 16:13:17 Added: jk/java/org/apache/jk/server JkCoyoteHandler.java Log: Initial impl. for the Coyote handler. This will replace the connector stuff from jk with coyote. Revision ChangesPath 1.1 jakarta-tomcat-connectors/jk/java/org/apache/jk/server/JkCoyoteHandler.java Index: JkCoyoteHandler.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, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * * * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see * http://www.apache.org/. * * [Additional notices, if required by prior licensing conditions] * */ package org.apache.jk.server; import java.io.*; import java.net.*; import java.util.*; import org.apache.jk.*; import org.apache.jk.core.*; import org.apache.jk.common.*; import org.apache.jk.util.*; import org.apache.tomcat.modules.server.PoolTcpConnector; import org.apache.tomcat.core.*; import org.apache.tomcat.util.net.*; import org.apache.tomcat.util.buf.*; import org.apache.tomcat.util.log.*; import org.apache.tomcat.util.http.*; import org.apache.coyote.*; /** Plugs Jk2 into Coyote */ public class JkCoyoteHandler implements ProtocolHandler { static class ResponseActionHook implements ActionHook { public void action(ActionCode actionCode, Object param) { if( actionCode==ActionCode.ACTION_COMMIT ) { } if( actionCode==ActionCode.ACTION_RESET ) { } if( actionCode==ActionCode.ACTION_CLOSE ) { } if( actionCode==ActionCode.ACTION_ACK ) { } } } Adapter adapter; /** Pass config info */ public void setAttribute( String name, Object value ) { } /** The adapter, used to call the connector */ public void setAdapter(Adapter adapter) { this.adapter=adapter; } public Adapter getAdapter() { return adapter; } /** Start the protocol */ public void init() { } public void destroy() { } } -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]