hgomez 2003/10/16 00:37:43
Modified: jk/native/common jk_ajp_common.c jk_ajp_common.h jk_ajp13.h
Log:
My latest patches to jk/ajp broke the AJP14 logon phase since I was
using the PING message which ask container to take control for
PING/PONG control.
Created CPING/CPONG message instead ...
Revision Changes Path
1.41 +19 -19 jakarta-tomcat-connectors/jk/native/common/jk_ajp_common.c
Index: jk_ajp_common.c
===================================================================
RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native/common/jk_ajp_common.c,v
retrieving revision 1.40
retrieving revision 1.41
diff -u -r1.40 -r1.41
--- jk_ajp_common.c 4 Oct 2003 09:20:59 -0000 1.40
+++ jk_ajp_common.c 16 Oct 2003 07:37:42 -0000 1.41
@@ -661,7 +661,7 @@
int rc;
FD_ZERO(&rset);
- FD_ZERO(&eset);
+ FD_ZERO(&eset);
FD_SET(ae->sd, &rset);
FD_SET(ae->sd, &eset);
@@ -681,11 +681,11 @@
/*
- * Handle the PING/PONG initial query
+ * Handle the CPING/CPONG initial query
*/
-int ajp_handle_ping_pong(ajp_endpoint_t *ae,
- int timeout,
- jk_logger_t *l)
+int ajp_handle_cping_cpong(ajp_endpoint_t *ae,
+ int timeout,
+ jk_logger_t *l)
{
int cmd;
jk_msg_buf_t * msg;
@@ -693,12 +693,12 @@
msg = jk_b_new(&ae->pool);
jk_b_set_buffer_size(msg, 16); /* 16 is way too large but I'm lazy :-) */
jk_b_reset(msg);
- jk_b_append_byte(msg, AJP13_PING_REQUEST);
+ jk_b_append_byte(msg, AJP13_CPING_REQUEST);
- /* Send Ping query */
+ /* Send CPing query */
if (ajp_connection_tcp_send_message(ae, msg, l) != JK_TRUE)
{
- jk_log(l, JK_LOG_ERROR, "Error ajp13:ping: can't send ping query\n");
+ jk_log(l, JK_LOG_ERROR, "Error ajp13:cping: can't send cping query\n");
return JK_FALSE;
}
@@ -706,7 +706,7 @@
*/
if (ajp_is_input_event(ae, timeout, l) == JK_FALSE)
{
- jk_log(l, JK_LOG_ERROR, "Error ajp13:ping: timeout in reply pong\n");
+ jk_log(l, JK_LOG_ERROR, "Error ajp13:cping: timeout in reply pong\n");
return JK_FALSE;
}
@@ -714,12 +714,12 @@
*/
if (ajp_connection_tcp_get_message(ae, msg, l) != JK_TRUE)
{
- jk_log(l, JK_LOG_ERROR, "Error ajp13:ping: awaited reply pong, not
received\n");
+ jk_log(l, JK_LOG_ERROR, "Error ajp13:cping: awaited reply cpong, not
received\n");
return JK_FALSE;
}
- if ((cmd = jk_b_get_byte(msg)) != AJP13_PONG_REPLY) {
- jk_log(l, JK_LOG_ERROR, "Error ajp13:ping: awaited reply pong,
received %d instead\n", cmd);
+ if ((cmd = jk_b_get_byte(msg)) != AJP13_CPONG_REPLY) {
+ jk_log(l, JK_LOG_ERROR, "Error ajp13:cping: awaited reply cpong,
received %d instead\n", cmd);
return JK_FALSE;
}
@@ -746,9 +746,9 @@
if (ae->worker->logon != NULL)
return (ae->worker->logon(ae, l));
- /* should we send a PING to validate connection ? */
+ /* should we send a CPING to validate connection ? */
if (ae->worker->connect_timeout != 0)
- return (ajp_handle_ping_pong(ae,
ae->worker->connect_timeout, l));
+ return (ajp_handle_cping_cpong(ae,
ae->worker->connect_timeout, l));
return JK_TRUE;
}
@@ -1015,10 +1015,10 @@
{
err = 0;
- /* handle ping/pong before request if timeout is set */
+ /* handle cping/cpong before request if timeout is set */
if (ae->worker->prepost_timeout != 0)
{
- if (ajp_handle_ping_pong(ae, ae->worker->prepost_timeout, l)
== JK_FALSE)
+ if (ajp_handle_cping_cpong(ae, ae->worker->prepost_timeout, l)
== JK_FALSE)
err++;
}
@@ -1037,7 +1037,7 @@
*/
if (ae->sd < 0) {
- /* no need to handle ping/pong here since it should be at connection time */
+ /* no need to handle cping/cpong here since it should be at connection time */
if (ajp_connect_to_endpoint(ae, l) == JK_TRUE) {
/*
@@ -1521,7 +1521,7 @@
if (pThis && pThis->worker_private) {
ajp_worker_t *p = pThis->worker_private;
- int cache_sz = jk_get_worker_cache_size(props, p->name, cache);
+ int cache_sz = jk_get_worker_cache_size(props, p->name, cache);
p->socket_timeout =
jk_get_worker_socket_timeout(props, p->name, AJP13_DEF_TIMEOUT);
1.20 +6 -6 jakarta-tomcat-connectors/jk/native/common/jk_ajp_common.h
Index: jk_ajp_common.h
===================================================================
RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native/common/jk_ajp_common.h,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -r1.19 -r1.20
--- jk_ajp_common.h 25 Sep 2003 15:22:08 -0000 1.19
+++ jk_ajp_common.h 16 Oct 2003 07:37:42 -0000 1.20
@@ -229,9 +229,9 @@
#define AJP_HEADER_SZ_LEN (2)
#define CHUNK_BUFFER_PAD (12)
#define AJP_DEF_CACHE_TIMEOUT (15)
-#define AJP_DEF_CONNECT_TIMEOUT (0) /* NO CONNECTION TIMEOUT => NO
PING/PONG */
-#define AJP_DEF_REPLY_TIMEOUT (0) /* NO REPLY TIMEOUT
*/
-#define AJP_DEF_PREPOST_TIMEOUT (0) /* NO PREPOST TIMEOUT => NO
PING/PONG */
+#define AJP_DEF_CONNECT_TIMEOUT (0) /* NO CONNECTION TIMEOUT => NO
CPING/CPONG */
+#define AJP_DEF_REPLY_TIMEOUT (0) /* NO REPLY TIMEOUT
*/
+#define AJP_DEF_PREPOST_TIMEOUT (0) /* NO PREPOST TIMEOUT => NO
CPING/CPONG */
struct jk_res_data {
int status;
@@ -304,9 +304,9 @@
/*
* Handle Connection/Reply Timeouts
*/
- unsigned connect_timeout; /* connect ping/pong delay in ms (0 means
disabled) */
+ unsigned connect_timeout; /* connect cping/cpong delay in ms (0 means
disabled) */
unsigned reply_timeout; /* reply timeout delay in ms (0 means disabled)
*/
- unsigned prepost_timeout; /* before sending a request ping/pong timeout
delay in ms (0 means disabled) */
+ unsigned prepost_timeout; /* before sending a request cping/cpong
timeout delay in ms (0 means disabled) */
};
1.11 +8 -3 jakarta-tomcat-connectors/jk/native/common/jk_ajp13.h
Index: jk_ajp13.h
===================================================================
RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native/common/jk_ajp13.h,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- jk_ajp13.h 25 Sep 2003 15:22:08 -0000 1.10
+++ jk_ajp13.h 16 Oct 2003 07:37:42 -0000 1.11
@@ -127,14 +127,19 @@
#define JK_AJP13_SHUTDOWN (unsigned char)7
/*
- * Check if the container is alive
+ * Told container to take control (secure login phase)
*/
#define AJP13_PING_REQUEST (unsigned char)8
/*
+ * Check if the container is alive
+ */
+#define AJP13_CPING_REQUEST (unsigned char)10
+
+/*
* Reply from the container to alive request
*/
-#define AJP13_PONG_REPLY (unsigned char)9
+#define AJP13_CPONG_REPLY (unsigned char)9
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]