cvs commit: jakarta-tomcat-connectors/jk/native2/common jk_ajp14.h
costin 01/12/12 13:40:53 Modified:jk/native2/common jk_ajp14.h Log: Removed most of the stuff from ajp14, moved to individual handlers. We must start making the distinction between 'protocol' and 'api'. jk supports 'ajp13' protocol, 'jni' protocol, etc. It could also support warp protocol or even a (minimal) IIOP. The API is the set of messages we use - confusingly called 'ajp13', 'ajp14', etc. All the details about message is implemented in message handlers, which are independent ( or should be ) of the protocol. Revision ChangesPath 1.3 +14 -171 jakarta-tomcat-connectors/jk/native2/common/jk_ajp14.h Index: jk_ajp14.h === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/common/jk_ajp14.h,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- jk_ajp14.h2001/12/04 18:40:42 1.2 +++ jk_ajp14.h2001/12/12 21:40:53 1.3 @@ -58,14 +58,14 @@ /*** * Description: Next generation bi-directional protocol handler. * * Author: Henri Gomez [EMAIL PROTECTED] * - * Version: $Revision: 1.2 $ * + * Version: $Revision: 1.3 $ * ***/ #ifndef JK_AJP14_H #define JK_AJP14_H #include jk_global.h #include jk_mt.h -#include jk_msg_buff.h +#include jk_msg.h #include jk_pool.h #include jk_logger.h #include jk_service.h @@ -76,186 +76,29 @@ extern C { #endif /* __cplusplus */ - -#define AJP_DEF_RETRY_ATTEMPTS(1) - -#define AJP_HEADER_LEN(4) -#define AJP_HEADER_SZ_LEN (2) -#define CHUNK_BUFFER_PAD (12) - -#define AJP13_PROTO 13 -#define AJP13_WS_HEADER 0x1234 -#define AJP13_SW_HEADER 0x4142 /* 'AB' */ - -#define AJP13_DEF_HOST (localhost) -#define AJP13_DEF_PORT (8009) -#define AJP13_READ_BUF_SIZE (8*1024) -#define AJP13_DEF_CACHE_SZ (1) -#define JK_INTERNAL_ERROR(-2) -#define JK_FATAL_ERROR (-3) -#define JK_CLIENT_ERROR (-4) -#define AJP13_MAX_SEND_BODY_SZ (DEF_BUFFER_SZ - 6) - -/* - * Message does not have a response (for example, JK_AJP13_END_RESPONSE) - */ -#define JK_AJP13_ERROR -1 -/* - * Message does not have a response (for example, JK_AJP13_END_RESPONSE) - */ -#define JK_AJP13_NO_RESPONSE0 -/* - * Message have a response. - */ -#define JK_AJP13_HAS_RESPONSE 1 - -/* - * Forward a request from the web server to the servlet container. - */ -#define JK_AJP13_FORWARD_REQUEST(unsigned char)2 - -/* - * Write a body chunk from the servlet container to the web server - */ -#define JK_AJP13_SEND_BODY_CHUNK(unsigned char)3 - -/* - * Send response headers from the servlet container to the web server. - */ -#define JK_AJP13_SEND_HEADERS (unsigned char)4 - -/* - * Marks the end of response. - */ -#define JK_AJP13_END_RESPONSE (unsigned char)5 - -/* - * Marks the end of response. - */ -#define JK_AJP13_GET_BODY_CHUNK (unsigned char)6 - -/* - * Asks the container to shutdown - */ -#define JK_AJP13_SHUTDOWN (unsigned char)7 - -/* - * Functions - */ -int ajp13_marshal_shutdown_into_msgb(jk_msg_buf_t *msg, - jk_pool_t *p, - jk_logger_t *l); - -#define AJP14_PROTO 14 - -#define AJP14_DEF_HOST (localhost) -#define AJP14_DEF_PORT (8011) -#define AJP14_READ_BUF_SIZEd(8*1024) -#define AJP14_DEF_RETRY_ATTEMPTS (1) -#define AJP14_DEF_CACHE_SZ (1) -#define AJP14_MAX_SEND_BODY_SZ (DEF_BUFFER_SZ - 6) -#define AJP14_HEADER_LEN (4) -#define AJP14_HEADER_SZ_LEN (2) - -/* - * Servlet Engine Status (web server - servlet engine), what's the status of the servlet engine ? - */ -#define AJP14_STATUS_CMD (unsigned char)0x18 +/* Common ajp13 methods */ -/* - * Unknown Packet Reply (web server - servlet engine), - * when a packet couldn't be decoded - */ -#define AJP14_UNKNOW_PACKET_CMD (unsigned char)0x1E - - -/* - * Negociation flags - */ - -/* - * web-server want context info after login - */ -#define AJP14_CONTEXT_INFO_NEG 0x8000 - -/* - * web-server want context updates - */ -#define AJP14_CONTEXT_UPDATE_NEG0x4000 - -/* - * web-server want compressed stream - */
cvs commit: jakarta-tomcat-connectors/jk/native2/common jk_ajp14.h jk_ajp14_worker.c
costin 01/12/04 10:40:42 Modified:jk/native2/common jk_ajp14.h jk_ajp14_worker.c Log: Merged the code from common. Merged the methods ( what used to be split between 14 and 13 specific ). Revision ChangesPath 1.2 +67 -99jakarta-tomcat-connectors/jk/native2/common/jk_ajp14.h Index: jk_ajp14.h === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/common/jk_ajp14.h,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- jk_ajp14.h2001/12/01 22:40:10 1.1 +++ jk_ajp14.h2001/12/04 18:40:42 1.2 @@ -58,75 +58,109 @@ /*** * Description: Next generation bi-directional protocol handler. * * Author: Henri Gomez [EMAIL PROTECTED] * - * Version: $Revision: 1.1 $ * + * Version: $Revision: 1.2 $ * ***/ #ifndef JK_AJP14_H #define JK_AJP14_H -#include jk_ajp_common.h -#include jk_context.h +#include jk_global.h +#include jk_mt.h +#include jk_msg_buff.h +#include jk_pool.h +#include jk_logger.h +#include jk_service.h +#include jk_worker.h + #ifdef __cplusplus extern C { #endif /* __cplusplus */ -#define AJP14_PROTO 14 + +#define AJP_DEF_RETRY_ATTEMPTS(1) -#define AJP14_DEF_HOST (localhost) -#define AJP14_DEF_PORT (8011) -#define AJP14_READ_BUF_SIZEd(8*1024) -#define AJP14_DEF_RETRY_ATTEMPTS (1) -#define AJP14_DEF_CACHE_SZ (1) -#define AJP14_MAX_SEND_BODY_SZ (DEF_BUFFER_SZ - 6) -#define AJP14_HEADER_LEN (4) -#define AJP14_HEADER_SZ_LEN (2) +#define AJP_HEADER_LEN(4) +#define AJP_HEADER_SZ_LEN (2) +#define CHUNK_BUFFER_PAD (12) +#define AJP13_PROTO 13 +#define AJP13_WS_HEADER 0x1234 +#define AJP13_SW_HEADER 0x4142 /* 'AB' */ + +#define AJP13_DEF_HOST (localhost) +#define AJP13_DEF_PORT (8009) +#define AJP13_READ_BUF_SIZE (8*1024) +#define AJP13_DEF_CACHE_SZ (1) +#define JK_INTERNAL_ERROR(-2) +#define JK_FATAL_ERROR (-3) +#define JK_CLIENT_ERROR (-4) +#define AJP13_MAX_SEND_BODY_SZ (DEF_BUFFER_SZ - 6) + /* - * Context Query (web server - servlet engine), which URI are handled by servlet engine ? + * Message does not have a response (for example, JK_AJP13_END_RESPONSE) */ -#define AJP14_CONTEXT_QRY_CMD(unsigned char)0x15 +#define JK_AJP13_ERROR -1 +/* + * Message does not have a response (for example, JK_AJP13_END_RESPONSE) + */ +#define JK_AJP13_NO_RESPONSE0 +/* + * Message have a response. + */ +#define JK_AJP13_HAS_RESPONSE 1 /* - * Context Info (servlet engine - web server), URI handled response + * Forward a request from the web server to the servlet container. */ -#define AJP14_CONTEXT_INFO_CMD (unsigned char)0x16 +#define JK_AJP13_FORWARD_REQUEST(unsigned char)2 -/* - * Context Update (servlet engine - web server), status of context changed +/* + * Write a body chunk from the servlet container to the web server */ -#define AJP14_CONTEXT_UPDATE_CMD (unsigned char)0x17 +#define JK_AJP13_SEND_BODY_CHUNK(unsigned char)3 /* - * Servlet Engine Status (web server - servlet engine), what's the status of the servlet engine ? + * Send response headers from the servlet container to the web server. */ -#define AJP14_STATUS_CMD (unsigned char)0x18 +#define JK_AJP13_SEND_HEADERS (unsigned char)4 /* - * Secure Shutdown command (web server - servlet engine), - * please servlet stop yourself. + * Marks the end of response. */ -#define AJP14_SHUTDOWN_CMD (unsigned char)0x19 +#define JK_AJP13_END_RESPONSE (unsigned char)5 /* - * Secure Shutdown command Accepted (servlet engine - web server) + * Marks the end of response. */ -#define AJP14_SHUTOK_CMD (unsigned char)0x1A +#define JK_AJP13_GET_BODY_CHUNK (unsigned char)6 /* - * Secure Shutdown Rejected (servlet engine - web server) + * Asks the container to shutdown */ -#define AJP14_SHUTNOK_CMD(unsigned char)0x1B +#define JK_AJP13_SHUTDOWN (unsigned char)7 /* - * Context Status (web server - servlet engine), what's - * the status of the context ? + * Functions */ -#define AJP14_CONTEXT_STATE_CMD (unsigned char)0x1C +int
cvs commit: jakarta-tomcat-connectors/jk/native2/common jk_ajp14.h jk_ajp_common.h jk_connect.h jk_context.h jk_endpoint.h jk_md5.h jk_msg_buff.h jk_mt.h jk_util.h jk_version.h
costin 01/12/01 14:40:10 Added: jk/native2/common jk_ajp14.h jk_ajp_common.h jk_connect.h jk_context.h jk_endpoint.h jk_md5.h jk_msg_buff.h jk_mt.h jk_util.h jk_version.h Log: Remaining .h files. They will be moved to include as we update them. Revision ChangesPath 1.1 jakarta-tomcat-connectors/jk/native2/common/jk_ajp14.h Index: jk_ajp14.h === /* = * * * * The Apache Software License, Version 1.1 * * * * Copyright (c) 1999-2001 The Apache Software Foundation. * * All rights reserved.* * * * = * * * * Redistribution and use in source and binary forms, with or without modi- * * fication, are permitted provided that the following conditions are met: * * * * 1. Redistributions of source code must retain the above copyright notice * *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, Jk, 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 Software Foundation.* * * * 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 indivi- * * duals on behalf of the Apache Software Foundation. For more information * * on the Apache Software Foundation, please see http://www.apache.org/. * * * *