Return-Path: Mailing-List: contact tomcat-dev-help@jakarta.apache.org; run by ezmlm Delivered-To: mailing list tomcat-dev@jakarta.apache.org Received: (qmail 39610 invoked by uid 500); 23 Jun 2000 10:34:19 -0000 Delivered-To: apmail-jakarta-tomcat-cvs@apache.org Received: (qmail 39535 invoked by uid 1115); 23 Jun 2000 10:34:17 -0000 Date: 23 Jun 2000 10:34:17 -0000 Message-ID: <20000623103417.39532.qmail@locus.apache.org> From: shachor@locus.apache.org To: jakarta-tomcat-cvs@apache.org Subject: cvs commit: jakarta-tomcat/src/native/jk jk_ajp12_worker.c jk_service.h jk_util.c jk_util.h shachor 00/06/23 03:34:16 Modified: src/native/jk jk_ajp12_worker.c jk_service.h jk_util.c jk_util.h Log: Prepare for environment attribute passing ... Add environment variable marshaling/demarshaling support for AJPv12 + support for passing environment to the server agnostic part Revision Changes Path 1.2 +24 -6 jakarta-tomcat/src/native/jk/jk_ajp12_worker.c Index: jk_ajp12_worker.c =================================================================== RCS file: /home/cvs/jakarta-tomcat/src/native/jk/jk_ajp12_worker.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- jk_ajp12_worker.c 2000/04/17 09:47:23 1.1 +++ jk_ajp12_worker.c 2000/06/23 10:34:03 1.2 @@ -57,7 +57,7 @@ * Description: ajpv1.2 worker, used to call local or remote jserv hosts * * Author: Gal Shachor * * Based on: jserv_ajpv12.c from Jserv * - * Version: $Revision: 1.1 $ * + * Version: $Revision: 1.2 $ * ***************************************************************************/ #include "jk_ajp12_worker.h" @@ -388,26 +388,44 @@ ajpv12_sendstring(p, "")); /* JSERV ajpv12 compatibility */ if(!ret) { - jk_log(l, JK_LOG_ERROR, "In ajpv12_handle_request, failed to send the ajp12 start sequence\n"); + jk_log(l, JK_LOG_ERROR, + "In ajpv12_handle_request, failed to send the ajp12 start sequence\n"); return JK_FALSE; } - jk_log(l, JK_LOG_DEBUG, "ajpv12_handle_request, sending the headers\n"); + if(s->num_attributes > 0) { + unsigned i; + jk_log(l, JK_LOG_DEBUG, + "ajpv12_handle_request, sending the environment variables\n"); + + for(i = 0 ; i < s->num_attributes ; i++) { + ret = (ajpv12_mark(p, 5) && + ajpv12_sendstring(p, s->attributes_names[i]) && + ajpv12_sendstring(p, s->attributes_values[i])); + if(!ret) { + jk_log(l, JK_LOG_ERROR, + "In ajpv12_handle_request, failed to send environment\n"); + return JK_FALSE; + } + } + } + + jk_log(l, JK_LOG_DEBUG, + "ajpv12_handle_request, sending the headers\n"); /* Send the request headers */ if(s->num_headers) { unsigned i; for(i = 0 ; i < s->num_headers ; ++i) { - ret = (ajpv12_mark(p, 3) && ajpv12_sendstring(p, s->headers_names[i]) && ajpv12_sendstring(p, s->headers_values[i]) ); if(!ret) { - jk_log(l, JK_LOG_ERROR, "In ajpv12_handle_request, failed to send headers\n"); + jk_log(l, JK_LOG_ERROR, + "In ajpv12_handle_request, failed to send headers\n"); return JK_FALSE; } - } } 1.2 +15 -1 jakarta-tomcat/src/native/jk/jk_service.h Index: jk_service.h =================================================================== RCS file: /home/cvs/jakarta-tomcat/src/native/jk/jk_service.h,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- jk_service.h 2000/04/17 09:47:22 1.1 +++ jk_service.h 2000/06/23 10:34:04 1.2 @@ -58,7 +58,7 @@ * These are the web server (ws) the worker and the connection* * JVM connection point * * Author: Gal Shachor * - * Version: $Revision: 1.1 $ * + * Version: $Revision: 1.2 $ * ***************************************************************************/ #ifndef JK_SERVICE_H @@ -130,6 +130,20 @@ char **headers_values; /* Values of the request headers */ unsigned num_headers; /* Number of request headers */ + + /* + * Request attributes. + * + * These attributes that were extracted from the web server and are + * sent to Tomcat. + * + * The developer should be able to read them from the ServletRequest + * attributes. Tomcat is required to append org.apache.tomcat. to + * these attrinbute names. + */ + char **attributes_names; /* Names of the request attributes */ + char **attributes_values; /* Values of the request attributes */ + unsigned num_attributes; /* Number of request attributes */ /* * The jvm route is in use when the adapter load balance among 1.6 +31 -1 jakarta-tomcat/src/native/jk/jk_util.c Index: jk_util.c =================================================================== RCS file: /home/cvs/jakarta-tomcat/src/native/jk/jk_util.c,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- jk_util.c 2000/06/16 07:03:21 1.5 +++ jk_util.c 2000/06/23 10:34:06 1.6 @@ -56,7 +56,7 @@ /*************************************************************************** * Description: Utility functions (mainly configuration) * * Author: Gal Shachor * - * Version: $Revision: 1.5 $ * + * Version: $Revision: 1.6 $ * ***************************************************************************/ @@ -671,4 +671,34 @@ if(env) { putenv(env); } +} + +void jk_init_ws_service(jk_ws_service_t *s) +{ + s->ws_private = NULL; + s->pool = NULL; + s->method = NULL; + s->protocol = NULL; + s->req_uri = NULL; + s->remote_addr = NULL; + s->remote_host = NULL; + s->remote_user = NULL; + s->auth_type = NULL; + s->query_string = NULL; + s->server_name = NULL; + s->server_port = 80; + s->server_software = NULL; + s->content_length = 0; + s->is_ssl = JK_FALSE; + s->ssl_cert = NULL; + s->ssl_cert_len = 0; + s->ssl_cipher = NULL; + s->ssl_session = NULL; + s->headers_names = NULL; + s->headers_values = NULL; + s->num_headers = 0; + s->attributes_names = NULL; + s->attributes_values = NULL; + s->num_attributes = 0; + s->jvm_route = NULL; } 1.5 +4 -2 jakarta-tomcat/src/native/jk/jk_util.h Index: jk_util.h =================================================================== RCS file: /home/cvs/jakarta-tomcat/src/native/jk/jk_util.h,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- jk_util.h 2000/05/31 11:24:03 1.4 +++ jk_util.h 2000/06/23 10:34:08 1.5 @@ -56,7 +56,7 @@ /*************************************************************************** * Description: Various utility functions * * Author: Gal Shachor * - * Version: $Revision: 1.4 $ * + * Version: $Revision: 1.5 $ * ***************************************************************************/ #ifndef _JK_UTIL_H #define _JK_UTIL_H @@ -65,8 +65,8 @@ #include "jk_map.h" #include "jk_pool.h" #include "jk_logger.h" +#include "jk_service.h" - int jk_parse_log_level(const char *level); int jk_open_file_logger(jk_logger_t **l, @@ -172,6 +172,8 @@ void jk_append_libpath(jk_pool_t *p, const char *libpath); + +void jk_init_ws_service(jk_ws_service_t *s); #ifdef __cplusplus extern "C" {