cvs commit: jakarta-tomcat-connectors/jk/native/common jk_ajp14.c
mturk 2005/04/21 05:04:02 Modified:jk/native/common jk_ajp14.c Log: Make jk_msg_buf_t structure public to skip the need for calling functions for accessing structure elements. Revision ChangesPath 1.27 +3 -3 jakarta-tomcat-connectors/jk/native/common/jk_ajp14.c Index: jk_ajp14.c === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native/common/jk_ajp14.c,v retrieving revision 1.26 retrieving revision 1.27 diff -u -r1.26 -r1.27 --- jk_ajp14.c6 Feb 2005 09:37:59 - 1.26 +++ jk_ajp14.c21 Apr 2005 12:04:02 - 1.27 @@ -337,7 +337,7 @@ /* * UNHANDLED MESSAGE SIZE */ -if (jk_b_append_int(msg, (unsigned short)jk_b_get_len(unk))) { +if (jk_b_append_int(msg, (unsigned short)unk-len)) { JK_TRACE_EXIT(l); return JK_FALSE; } @@ -345,7 +345,7 @@ * UNHANDLED MESSAGE (Question : Did we have to send all the message or only part of) * ( ie: only 1k max ) */ -if (jk_b_append_bytes(msg, jk_b_get_buff(unk), jk_b_get_len(unk))) { +if (jk_b_append_bytes(msg, unk-buf, unk-len)) { jk_log(l, JK_LOG_ERROR, failed appending the UNHANDLED MESSAGE); JK_TRACE_EXIT(l); - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-tomcat-connectors/jk/native/common jk_ajp14.c
mturk 2004/11/11 09:43:01 Modified:jk/native/common jk_ajp14.c Log: Add new trace macros and clean up some log messages. Revision ChangesPath 1.23 +86 -48jakarta-tomcat-connectors/jk/native/common/jk_ajp14.c Index: jk_ajp14.c === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native/common/jk_ajp14.c,v retrieving revision 1.22 retrieving revision 1.23 diff -u -r1.22 -r1.23 --- jk_ajp14.c10 Nov 2004 16:36:48 - 1.22 +++ jk_ajp14.c11 Nov 2004 17:43:01 - 1.23 @@ -38,7 +38,7 @@ jk_md5((const unsigned char *)s-entropy, (const unsigned char *)s-secret_key, s-computed_key); -jk_log(l, JK_LOG_DEBUG, Into ajp14_compute_md5 (%s/%s) - (%s)\n, +jk_log(l, JK_LOG_DEBUG, (%s/%s) - (%s)\n, s-entropy, s-secret_key, s-computed_key); JK_TRACE_EXIT(l); } @@ -63,21 +63,24 @@ /* * LOGIN */ -if (jk_b_append_byte(msg, AJP14_LOGINIT_CMD)) +if (jk_b_append_byte(msg, AJP14_LOGINIT_CMD)) { +JK_TRACE_EXIT(l); return JK_FALSE; - +} /* * NEGOCIATION FLAGS */ -if (jk_b_append_long(msg, s-negociation)) +if (jk_b_append_long(msg, s-negociation)) { +JK_TRACE_EXIT(l); return JK_FALSE; - +} /* * WEB-SERVER NAME */ if (jk_b_append_string(msg, s-web_server_name)) { jk_log(l, JK_LOG_ERROR, - Error ajp14_marshal_login_init_into_msgb - Error appending the web_server_name string\n); + failed appending the web_server_name string\n); +JK_TRACE_EXIT(l); return JK_FALSE; } @@ -103,7 +106,8 @@ if (jk_b_get_bytes (msg, (unsigned char *)s-entropy, AJP14_ENTROPY_SEED_LEN) 0) { jk_log(l, JK_LOG_ERROR, - Error ajp14_unmarshal_login_seed - can't get seed\n); + can't get seed\n); +JK_TRACE_EXIT(l); return JK_FALSE; } @@ -132,9 +136,10 @@ /* * LOGIN */ -if (jk_b_append_byte(msg, AJP14_LOGCOMP_CMD)) +if (jk_b_append_byte(msg, AJP14_LOGCOMP_CMD)) { +JK_TRACE_EXIT(l); return JK_FALSE; - +} /* * COMPUTED-SEED */ @@ -142,7 +147,8 @@ (msg, (const unsigned char *)s-computed_key, AJP14_COMPUTED_KEY_LEN)) { jk_log(l, JK_LOG_ERROR, - Error ajp14_marshal_login_comp_into_msgb - Error appending the COMPUTED MD5 bytes\n); + failed appending the COMPUTED MD5 bytes\n); +JK_TRACE_EXIT(l); return JK_FALSE; } @@ -172,7 +178,8 @@ if (nego == 0x) { jk_log(l, JK_LOG_ERROR, - Error ajp14_unmarshal_log_ok - can't get negociated data\n); + can't get negociated data\n); +JK_TRACE_EXIT(l); return JK_FALSE; } @@ -180,7 +187,8 @@ if (!sname) { jk_log(l, JK_LOG_ERROR, - Error ajp14_unmarshal_log_ok - can't get servlet engine name\n); + can't get servlet engine name\n); +JK_TRACE_EXIT(l); return JK_FALSE; } @@ -191,7 +199,8 @@ if (!s-servlet_engine_name) { jk_log(l, JK_LOG_ERROR, - Error ajp14_unmarshal_log_ok - can't malloc servlet engine name\n); + can't malloc servlet engine name\n); +JK_TRACE_EXIT(l); return JK_FALSE; } @@ -219,7 +228,8 @@ if (status == 0x) { jk_log(l, JK_LOG_ERROR, - Error ajp14_unmarshal_log_nok - can't get failure code\n); + can't get failure code\n); +JK_TRACE_EXIT(l); return JK_FALSE; } @@ -251,9 +261,10 @@ /* * SHUTDOWN CMD */ -if (jk_b_append_byte(msg, AJP14_SHUTDOWN_CMD)) +if (jk_b_append_byte(msg, AJP14_SHUTDOWN_CMD)) { +JK_TRACE_EXIT(l); return JK_FALSE; - +} /* * COMPUTED-SEED */ @@ -261,7 +272,8 @@ (msg, (const unsigned char *)s-computed_key, AJP14_COMPUTED_KEY_LEN)) { jk_log(l, JK_LOG_ERROR, - Error ajp14_marshal_shutdown_into_msgb - Error appending the COMPUTED MD5 bytes\n); + failed appending the COMPUTED MD5 bytes\n); +JK_TRACE_EXIT(l); return JK_FALSE; } @@ -286,7 +298,8 @@ if (status == 0x) { jk_log(l, JK_LOG_ERROR, - Error ajp14_unmarshal_shutdown_nok - can't get failure code\n); + can't get failure code\n); +JK_TRACE_EXIT(l); return JK_FALSE; } @@ -316,22 +329,25 @@ /*
cvs commit: jakarta-tomcat-connectors/jk/native/common jk_ajp14.c jk_service.h jk_worker.c
costin 01/07/03 14:56:50 Modified:jk/native/common jk_ajp14.c jk_service.h jk_worker.c Log: - in jk_ajp14, avoid a NPE - in jk_service, add a num_of_workers field to workers_env_t, and a first_worker. Both will be used to detect if we have a single worker ( or default worker ? ). I still need to deal with lb configurations, where in most cases lb is the default worker. The idea is that we'll not need to map uri-worker in 99% of the cases ( assuming the server is configured to do that ), most people either use a single worker or a lb ( but all tomcat requests go to lb ). Special configurations are still possible ( for example /foo context to go to JNI worker, /bar to a certain tomcat instance ). This is more related with simplifying the manual configuration, using SetHandler - if the special JkMount directive is used we can of course specify a particular worker. Revision ChangesPath 1.13 +5 -2 jakarta-tomcat-connectors/jk/native/common/jk_ajp14.c Index: jk_ajp14.c === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native/common/jk_ajp14.c,v retrieving revision 1.12 retrieving revision 1.13 diff -u -r1.12 -r1.13 --- jk_ajp14.c2001/07/02 21:14:22 1.12 +++ jk_ajp14.c2001/07/03 21:56:47 1.13 @@ -1,3 +1,4 @@ +/* -*- Mode: C; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil-*- */ /* = * * * * The Apache Software License, Version 1.1 * @@ -58,7 +59,7 @@ /*** * Description: Next generation bi-directional protocol handler. * * Author: Henri Gomez [EMAIL PROTECTED] * - * Version: $Revision: 1.12 $ * + * Version: $Revision: 1.13 $ * ***/ @@ -423,7 +424,9 @@ } /* Check if we get the correct virtual host */ -if (strcmp(c-virtual, vname)) { +if (c-virtual != NULL + vname != NULL + strcmp(c-virtual, vname)) { /* set the virtual name, better to add to a virtual list ? */ if (context_set_virtual(c, vname) == JK_FALSE) { 1.7 +5 -1 jakarta-tomcat-connectors/jk/native/common/jk_service.h Index: jk_service.h === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native/common/jk_service.h,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- jk_service.h 2001/07/02 21:11:47 1.6 +++ jk_service.h 2001/07/03 21:56:48 1.7 @@ -1,3 +1,4 @@ +/* -*- Mode: C; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil-*- */ /* = * * * * The Apache Software License, Version 1.1 * @@ -62,7 +63,7 @@ * Author: Gal Shachor [EMAIL PROTECTED] * * Author: Dan Milstein [EMAIL PROTECTED]* * Author: Henri Gomez [EMAIL PROTECTED] * - * Version: $Revision: 1.6 $ * + * Version: $Revision: 1.7 $ * ***/ #ifndef JK_SERVICE_H @@ -88,6 +89,9 @@ /* The URI to WORKER map, will be feeded by AJP14 autoconf feature */ jk_uri_worker_map_t *uri_to_worker; + +int num_of_workers; +char *first_worker; /* Web-Server we're running on (Apache/IIS/NES) */ char *server_name; 1.7 +5 -2 jakarta-tomcat-connectors/jk/native/common/jk_worker.c Index: jk_worker.c === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native/common/jk_worker.c,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- jk_worker.c 2001/06/22 08:33:56 1.6 +++ jk_worker.c 2001/07/03 21:56:48 1.7 @@ -1,3 +1,4 @@ +/* -*- Mode: C; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil-*- */ /* = * * * * The Apache Software License, Version 1.1
cvs commit: jakarta-tomcat-connectors/jk/native/common jk_ajp14.c
hgomez 01/07/02 05:34:28 Modified:jk/native/common jk_ajp14.c Log: Bad copy paste. When we want to have info about a context, send its name (only) Submitted by: JF-Clere Revision ChangesPath 1.11 +4 -4 jakarta-tomcat-connectors/jk/native/common/jk_ajp14.c Index: jk_ajp14.c === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native/common/jk_ajp14.c,v retrieving revision 1.10 retrieving revision 1.11 diff -u -r1.10 -r1.11 --- jk_ajp14.c2001/06/29 14:53:13 1.10 +++ jk_ajp14.c2001/07/02 12:34:26 1.11 @@ -58,7 +58,7 @@ /*** * Description: Next generation bi-directional protocol handler. * * Author: Henri Gomez [EMAIL PROTECTED] * - * Version: $Revision: 1.10 $ * + * Version: $Revision: 1.11 $ * ***/ @@ -521,7 +521,7 @@ ci = context_find_base(c, cname); if (! ci) { -jk_log(l, JK_LOG_ERROR, Error ajp14_marshal_context_state_into_msgb - unknow context %s\n, cname); +jk_log(l, JK_LOG_ERROR, Warning ajp14_marshal_context_state_into_msgb - unknown context %s\n, cname); return JK_FALSE; } @@ -529,8 +529,8 @@ * CONTEXT CSTRING */ -if (jk_b_append_string(msg, c-contexts[i]-cbase )) { -jk_log(l, JK_LOG_ERROR, Error ajp14_marshal_context_state_into_msgb - Error appending the context string\n); +if (jk_b_append_string(msg, cname )) { +jk_log(l, JK_LOG_ERROR, Error ajp14_marshal_context_state_into_msgb - Error appending the context string %s\n, cname); return JK_FALSE; } }
cvs commit: jakarta-tomcat-connectors/jk/native/common jk_ajp14.c
hgomez 01/07/02 14:14:25 Modified:jk/native/common jk_ajp14.c Log: updated ajp14 protocol handling in context info Revision ChangesPath 1.12 +7 -3 jakarta-tomcat-connectors/jk/native/common/jk_ajp14.c Index: jk_ajp14.c === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native/common/jk_ajp14.c,v retrieving revision 1.11 retrieving revision 1.12 diff -u -r1.11 -r1.12 --- jk_ajp14.c2001/07/02 12:34:26 1.11 +++ jk_ajp14.c2001/07/02 21:14:22 1.12 @@ -58,7 +58,7 @@ /*** * Description: Next generation bi-directional protocol handler. * * Author: Henri Gomez [EMAIL PROTECTED] * - * Version: $Revision: 1.11 $ * + * Version: $Revision: 1.12 $ * ***/ @@ -415,6 +415,8 @@ vname = (char *)jk_b_get_string(msg); +jk_log(l, JK_LOG_DEBUG, ajp14_unmarshal_context_info - get virtual %s for virtual %s\n, vname, c-virtual); + if (! vname) { jk_log(l, JK_LOG_ERROR, Error ajp14_unmarshal_context_info - can't get virtual hostname\n); return JK_FALSE; @@ -439,6 +441,8 @@ return JK_FALSE; } +jk_log(l, JK_LOG_DEBUG, ajp14_unmarshal_context_info - get context %s for virtual %s\n, cname, vname); + /* grab all contexts up to empty one which indicate end of contexts */ if (! strlen(cname)) break; @@ -460,11 +464,11 @@ } if (! strlen(uri)) { - jk_log(l, JK_LOG_DEBUG, No more URI/URL for context %s, cname); + jk_log(l, JK_LOG_DEBUG, No more URI for context %s, cname); break; } - jk_log(l, JK_LOG_INFO, Got URL/URI (%s) for virtualhost %s and context %s, uri, vname, cname); + jk_log(l, JK_LOG_INFO, Got URI (%s) for virtualhost %s and context %s\n, uri, vname, cname); if (context_add_uri(c, cname, uri) == JK_FALSE) { jk_log(l, JK_LOG_ERROR, Error ajp14_unmarshal_context_info - can't add/set uri (%s) for context %s\n, uri, cname);
cvs commit: jakarta-tomcat-connectors/jk/native/common jk_ajp14.c jk_ajp14.h
hgomez 01/06/29 07:53:14 Modified:jk/native/common jk_ajp14.c jk_ajp14.h Log: Autoconf works in progress in Ajp14 protocol handler The key of contexts is the virtual server, we should/could handle N contexts by M vrituals servers Revision ChangesPath 1.10 +138 -83 jakarta-tomcat-connectors/jk/native/common/jk_ajp14.c Index: jk_ajp14.c === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native/common/jk_ajp14.c,v retrieving revision 1.9 retrieving revision 1.10 diff -u -r1.9 -r1.10 --- jk_ajp14.c2001/06/22 08:33:56 1.9 +++ jk_ajp14.c2001/06/29 14:53:13 1.10 @@ -58,7 +58,7 @@ /*** * Description: Next generation bi-directional protocol handler. * * Author: Henri Gomez [EMAIL PROTECTED] * - * Version: $Revision: 1.9 $ * + * Version: $Revision: 1.10 $ * ***/ @@ -399,89 +399,104 @@ * The Autoconf feature of AJP14, let us know which URL/URI could * be handled by the servlet-engine * - * +---+-++---+ - * | CONTEXT INFO CMD (1 byte) | VIRTUAL HOST NAME (CString (*)) | CONTEXT NAME (CString (*)) | URL1 [\n] URL2 [\n] URL3 [\n] | - * +---+-++---+ - * + * +---+-++---+---+ + * | CONTEXT INFO CMD (1 byte) | VIRTUAL HOST NAME (CString (*)) | CONTEXT NAME (CString (*)) | URL1 [\n] URL2 [\n] URL3 [\n] | NEXT CTX. | + * +---+-++---+---+ */ int ajp14_unmarshal_context_info(jk_msg_buf_t *msg, - jk_context_t *context, + jk_context_t *c, jk_logger_t *l) { -char *sname; - /* char *old; unused */ +char *vname; +char *cname; +char *uri; int i; -sname = (char *)jk_b_get_string(msg); +vname = (char *)jk_b_get_string(msg); -if (! sname) { +if (! vname) { jk_log(l, JK_LOG_ERROR, Error ajp14_unmarshal_context_info - can't get virtual hostname\n); return JK_FALSE; } -if (context-virtual) /* take care of removing previously allocated data */ -free(context-virtual); +/* Check if we get the correct virtual host */ +if (strcmp(c-virtual, vname)) { +/* set the virtual name, better to add to a virtual list ? */ + +if (context_set_virtual(c, vname) == JK_FALSE) { +jk_log(l, JK_LOG_ERROR, Error ajp14_unmarshal_context_info - can't malloc virtual hostname\n); +return JK_FALSE; +} +} -context-virtual = strdup(sname); +for (;;) { + +cname = (char *)jk_b_get_string(msg); -if (! context-virtual) { -jk_log(l, JK_LOG_ERROR, Error ajp14_unmarshal_context_info - can't malloc virtual hostname\n); -return JK_FALSE; -} +if (! cname) { +jk_log(l, JK_LOG_ERROR, Error ajp14_unmarshal_context_info - can't get context\n); +return JK_FALSE; +} -sname = (char *)jk_b_get_string(msg); +/* grab all contexts up to empty one which indicate end of contexts */ +if (! strlen(cname)) +break; -if (! sname) { -jk_log(l, JK_LOG_ERROR, Error ajp14_unmarshal_context_info - can't get context\n); -return JK_FALSE; -} +/* create new context base (if needed) */ -if (context-cbase) /* take care of removing previously allocated data */ -free(context-cbase); +if (context_add_base(c, cname) == JK_FALSE) { +jk_log(l, JK_LOG_ERROR, Error ajp14_unmarshal_context_info - can't add/set context %s\n, cname); +return JK_FALSE; +} -context-cbase = strdup(sname); - -if (! context-cbase) { -jk_log(l, JK_LOG_ERROR, Error ajp14_unmarshal_context_info - can't malloc context\n); -return JK_FALSE; -} + for (;;) { - for (i = 1;; i++) { +uri = (char *)jk_b_get_string(msg); - sname =
cvs commit: jakarta-tomcat-connectors/jk/native/common jk_ajp14.c jk_ajp14_worker.c jk_ajp_common.c jk_worker.c
hgomez 01/06/22 01:33:57 Modified:jk/native/common jk_ajp14.c jk_ajp14_worker.c jk_ajp_common.c jk_worker.c Log: This bunch of code fixes the AJP14 login problem. Rigth now ajp14 advanced login features works with the experimental ajp14 I'll commit later today Revision ChangesPath 1.9 +19 -20jakarta-tomcat-connectors/jk/native/common/jk_ajp14.c Index: jk_ajp14.c === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native/common/jk_ajp14.c,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- jk_ajp14.c2001/06/18 14:15:23 1.8 +++ jk_ajp14.c2001/06/22 08:33:56 1.9 @@ -58,7 +58,7 @@ /*** * Description: Next generation bi-directional protocol handler. * * Author: Henri Gomez [EMAIL PROTECTED] * - * Version: $Revision: 1.8 $ * + * Version: $Revision: 1.9 $ * ***/ @@ -73,11 +73,12 @@ * Compute the MD5 with ENTROPY / SECRET KEY */ -void ajp14_compute_md5(jk_login_service_t *s, jk_logger_t *l) +void ajp14_compute_md5(jk_login_service_t *s, + jk_logger_t*l) { jk_md5((const unsigned char *)s-entropy, (const unsigned char *)s-secret_key, s-computed_key); - jk_log(l, JK_LOG_DEBUG, Into ajp14_compute_md5 (%s)\n, s-computed_key); + jk_log(l, JK_LOG_DEBUG, Into ajp14_compute_md5 (%s/%s) - (%s)\n, s-entropy, s-secret_key, s-computed_key); } @@ -132,9 +133,9 @@ * */ -int ajp14_unmarshal_login_seed(jk_msg_buf_t *msg, +int ajp14_unmarshal_login_seed(jk_msg_buf_t *msg, jk_login_service_t *s, - jk_logger_t *l) + jk_logger_t*l) { if (jk_b_get_bytes(msg, (unsigned char *)s-entropy, AJP14_ENTROPY_SEED_LEN) 0) { jk_log(l, JK_LOG_ERROR, Error ajp14_unmarshal_login_seed - can't get seed\n); @@ -169,8 +170,6 @@ if (jk_b_append_byte(msg, AJP14_LOGCOMP_CMD)) return JK_FALSE; - ajp14_compute_md5(s, l); - /* * COMPUTED-SEED */ @@ -192,9 +191,9 @@ * */ -int ajp14_unmarshal_log_ok(jk_msg_buf_t *msg, +int ajp14_unmarshal_log_ok(jk_msg_buf_t *msg, jk_login_service_t *s, - jk_logger_t *l) + jk_logger_t*l) { unsigned long nego; char * sname; @@ -237,7 +236,7 @@ */ int ajp14_unmarshal_log_nok(jk_msg_buf_t *msg, -jk_logger_t *l) +jk_logger_t *l) { unsigned long status; @@ -299,7 +298,7 @@ * */ int ajp14_unmarshal_shutdown_nok(jk_msg_buf_t *msg, - jk_logger_t *l) + jk_logger_t *l) { unsigned long status; @@ -367,9 +366,9 @@ * */ -int ajp14_marshal_context_query_into_msgb(jk_msg_buf_t *msg, - char *virtual, - jk_logger_t *l) +int ajp14_marshal_context_query_into_msgb(jk_msg_buf_t *msg, + char *virtual, + jk_logger_t *l) { jk_log(l, JK_LOG_DEBUG, Into ajp14_marshal_context_query_into_msgb\n); @@ -408,7 +407,7 @@ int ajp14_unmarshal_context_info(jk_msg_buf_t *msg, jk_context_t *context, - jk_logger_t *l) + jk_logger_t *l) { char *sname; /* char *old; unused */ @@ -479,9 +478,9 @@ * */ -int ajp14_marshal_context_state_into_msgb(jk_msg_buf_t *msg, - jk_context_t *context, - jk_logger_t*l) +int ajp14_marshal_context_state_into_msgb(jk_msg_buf_t *msg, + jk_context_t *context, + jk_logger_t *l) { jk_log(l, JK_LOG_DEBUG, Into ajp14_marshal_context_state_into_msgb\n); @@ -525,7 +524,7 @@ int ajp14_unmarshal_context_state_reply(jk_msg_buf_t *msg,
cvs commit: jakarta-tomcat-connectors/jk/native/common jk_ajp14.c jk_md5.c
mmanders01/06/14 12:44:01 Modified:jk/native/common jk_ajp14.c jk_md5.c Log: Added additional casts so that it will build properly for NetWare. Revision ChangesPath 1.7 +6 -6 jakarta-tomcat-connectors/jk/native/common/jk_ajp14.c Index: jk_ajp14.c === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native/common/jk_ajp14.c,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- jk_ajp14.c2001/06/13 21:30:28 1.6 +++ jk_ajp14.c2001/06/14 19:43:57 1.7 @@ -56,7 +56,7 @@ /*** * Description: Next generation bi-directional protocol handler. * * Author: Henri Gomez [EMAIL PROTECTED] * - * Version: $Revision: 1.6 $ * + * Version: $Revision: 1.7 $ * ***/ @@ -65,7 +65,7 @@ #include jk_map.h #include jk_ajp_common.h #include jk_ajp14.h -#include jk_md5.h +#include jk_md5.h /* * Compute the MD5 with ENTROPY / SECRET KEY @@ -73,7 +73,7 @@ void ajp14_compute_md5(jk_login_service_t *s, jk_logger_t *l) { - jk_md5(s-entropy, s-secret_key, s-computed_key); + jk_md5((const unsigned char *)s-entropy, (const unsigned char *)s-secret_key, s-computed_key); jk_log(l, JK_LOG_DEBUG, Into ajp14_compute_md5 (%s)\n, s-computed_key); } @@ -134,7 +134,7 @@ jk_login_service_t *s, jk_logger_t *l) { -if (jk_b_get_bytes(msg, s-entropy, AJP14_ENTROPY_SEED_LEN) 0) { +if (jk_b_get_bytes(msg, (unsigned char *)s-entropy, AJP14_ENTROPY_SEED_LEN) 0) { jk_log(l, JK_LOG_ERROR, Error ajp14_unmarshal_login_seed - can't get seed\n); return JK_FALSE; } @@ -172,7 +172,7 @@ /* * COMPUTED-SEED */ - if (jk_b_append_bytes(msg, s-computed_key, AJP14_COMPUTED_KEY_LEN)) { + if (jk_b_append_bytes(msg, (const unsigned char *)s-computed_key, AJP14_COMPUTED_KEY_LEN)) { jk_log(l, JK_LOG_ERROR, Error ajp14_marshal_login_comp_into_msgb - Error appending the COMPUTED MD5 bytes\n); return JK_FALSE; } @@ -280,7 +280,7 @@ /* * COMPUTED-SEED */ - if (jk_b_append_bytes(msg, s-computed_key, AJP14_COMPUTED_KEY_LEN)) { + if (jk_b_append_bytes(msg, (const unsigned char *)s-computed_key, AJP14_COMPUTED_KEY_LEN)) { jk_log(l, JK_LOG_ERROR, Error ajp14_marshal_shutdown_into_msgb - Error appending the COMPUTED MD5 bytes\n); return JK_FALSE; } 1.4 +5 -5 jakarta-tomcat-connectors/jk/native/common/jk_md5.c Index: jk_md5.c === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native/common/jk_md5.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- jk_md5.c 2001/06/13 21:30:21 1.3 +++ jk_md5.c 2001/06/14 19:43:58 1.4 @@ -103,7 +103,7 @@ /*** * Description: MD5 encoding wrapper * * Author: Henri Gomez [EMAIL PROTECTED] * - * Version: $Revision: 1.3 $ * + * Version: $Revision: 1.4 $ * ***/ /* @@ -463,13 +463,13 @@ charbuf[JK_MD5_DIGESTSIZE + 1]; jk_MD5Init(ctx); -jk_MD5Update(ctx, org, strlen(org)); +jk_MD5Update(ctx, org, strlen((const char *)org)); if (org2 != NULL) - jk_MD5Update(ctx, org2, strlen(org2)); + jk_MD5Update(ctx, org2, strlen((const char *)org2)); -jk_MD5Final(buf, ctx); - return (jk_hextocstr(buf, dst, JK_MD5_DIGESTSIZE)); +jk_MD5Final((unsigned char *)buf, ctx); + return (jk_hextocstr((unsigned char *)buf, dst, JK_MD5_DIGESTSIZE)); } #else /* USE_APACHE_MD5 */
cvs commit: jakarta-tomcat-connectors/jk/native/common jk_ajp14.c jk_ajp14.h jk_ajp14_worker.c
hgomez 01/06/11 23:28:52 Modified:jk/native/common jk_ajp14.c jk_ajp14.h jk_ajp14_worker.c Log: Continuation on AJP14. The works is now on the Logon Phase Revision ChangesPath 1.5 +1 -2 jakarta-tomcat-connectors/jk/native/common/jk_ajp14.c Index: jk_ajp14.c === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native/common/jk_ajp14.c,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- jk_ajp14.c2001/06/07 14:35:44 1.4 +++ jk_ajp14.c2001/06/12 06:28:51 1.5 @@ -56,7 +56,7 @@ /*** * Description: Next generation bi-directional protocol handler. * * Author: Henri Gomez [EMAIL PROTECTED] * - * Version: $Revision: 1.4 $ * + * Version: $Revision: 1.5 $ * ***/ @@ -131,7 +131,6 @@ int ajp14_unmarshal_login_seed(jk_msg_buf_t *msg, jk_login_service_t *s, - jk_pool_t *p, jk_logger_t *l) { if (jk_b_get_bytes(msg, s-entropy, AJP14_ENTROPY_SEED_LEN) 0) { 1.4 +2 -3 jakarta-tomcat-connectors/jk/native/common/jk_ajp14.h Index: jk_ajp14.h === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native/common/jk_ajp14.h,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- jk_ajp14.h2001/06/07 14:35:46 1.3 +++ jk_ajp14.h2001/06/12 06:28:51 1.4 @@ -56,7 +56,7 @@ /*** * Description: Next generation bi-directional protocol handler. * * Author: Henri Gomez [EMAIL PROTECTED] * - * Version: $Revision: 1.3 $ * + * Version: $Revision: 1.4 $ * ***/ #ifndef JK_AJP14_H #define JK_AJP14_H @@ -71,7 +71,7 @@ #define AJP14_PROTO 14 #define AJP14_WS_HEADER 0x1235 -#define AJP14_SW_HEADER 0x4143 /* 'AC' */ +#define AJP14_SW_HEADER 0x1235 /* AJP14 use now the same header in both directions */ #define AJP14_DEF_HOST (localhost) #define AJP14_DEF_PORT (8011) @@ -299,7 +299,6 @@ int ajp14_unmarshal_login_seed(jk_msg_buf_t *msg, jk_login_service_t *s, -jk_pool_t *p, jk_logger_t *l); int ajp14_marshal_login_comp_into_msgb(jk_msg_buf_t *msg, 1.3 +122 -14 jakarta-tomcat-connectors/jk/native/common/jk_ajp14_worker.c Index: jk_ajp14_worker.c === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native/common/jk_ajp14_worker.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- jk_ajp14_worker.c 2001/06/07 14:36:46 1.2 +++ jk_ajp14_worker.c 2001/06/12 06:28:51 1.3 @@ -56,7 +56,7 @@ /*** * Description: AJP14 next generation Bi-directional protocol. * * Author: Henri Gomez [EMAIL PROTECTED] * - * Version: $Revision: 1.2 $ * + * Version: $Revision: 1.3 $ * ***/ #include jk_context.h @@ -65,12 +65,13 @@ /* Method */ static int JK_METHOD validate(jk_worker_t *pThis, jk_map_t*props, + jk_worker_env_t *we, jk_logger_t *l) { ajp_worker_t *aw; char * secret_key; -if (ajp_validate(pThis, props, l, AJP14_PROTO) == JK_FALSE) +if (ajp_validate(pThis, props, we, l, AJP14_PROTO) == JK_FALSE) return JK_FALSE; aw = pThis-worker_private; @@ -85,20 +86,49 @@ return JK_TRUE; } +static int JK_METHOD get_endpoint(jk_worker_t*pThis, + jk_endpoint_t **pend, +