costin 01/12/18 14:51:55 Modified: jk/native2/common jk_ajp14_worker.c jk/native2/include jk_webapp.h jk/native2/jni jk_jni_aprImpl.c jk/native2/server/apache2 mod_jk.c Log: Move the reading of initial post data after the sending the request ( to do it in paralel ) Few cleanups ( vars not used ) Removed the 'ctl' handler in mod_jk ( that I added few days back for monitoring that state). There is a much better and cleaner way to do it. Started to add some (prototype for now) code to aprImpl ( the Jni side ). We want to be able use use unix sockets and few other things from APR from java ( probably signals and chuid will also help ). Of course, long-term we should try to create a nicer interface, etc - this is now highly experimental. Revision Changes Path 1.12 +21 -20 jakarta-tomcat-connectors/jk/native2/common/jk_ajp14_worker.c Index: jk_ajp14_worker.c =================================================================== RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/common/jk_ajp14_worker.c,v retrieving revision 1.11 retrieving revision 1.12 diff -u -r1.11 -r1.12 --- jk_ajp14_worker.c 2001/12/17 07:17:08 1.11 +++ jk_ajp14_worker.c 2001/12/18 22:51:55 1.12 @@ -313,25 +313,6 @@ return JK_FALSE; } - /* Prepare to send some post data ( ajp13 proto ) */ - if (s->is_chunked || s->left_bytes_to_send > 0) { - /* We never sent any POST data and we check it we have to send at - * least of block of data (max 8k). These data will be kept in reply - * for resend if the remote Tomcat is down, a fact we will learn only - * doing a read (not yet) - */ - err=jk_serialize_postHead( env, e->post, s, e ); - - if (err != JK_TRUE ) { - /* the browser stop sending data, no need to recover */ - e->recoverable = JK_FALSE; - env->l->jkLog(env, env->l, JK_LOG_ERROR, - "ajp14.service() Error receiving initial post data\n"); - return JK_FALSE; - } - hasPost=JK_TRUE; - } - env->l->jkLog(env, env->l, JK_LOG_INFO, "ajp14.service() %s\n", e->worker->name); @@ -386,8 +367,28 @@ *is_recoverable_error = JK_TRUE; e->recoverable = JK_TRUE; - if( hasPost==JK_TRUE) + /* Prepare to send some post data ( ajp13 proto ). We do that after the + request was sent ( we're receiving data from client, can be slow, no + need to delay - we can do that in paralel. ( not very sure this is + very usefull, and it brakes the protocol ) ! */ + if (s->is_chunked || s->left_bytes_to_send > 0) { + /* We never sent any POST data and we check it we have to send at + * least of block of data (max 8k). These data will be kept in reply + * for resend if the remote Tomcat is down, a fact we will learn only + * doing a read (not yet) + */ + err=jk_serialize_postHead( env, e->post, s, e ); + + if (err != JK_TRUE ) { + /* the browser stop sending data, no need to recover */ + e->recoverable = JK_FALSE; + env->l->jkLog(env, env->l, JK_LOG_ERROR, + "ajp14.service() Error receiving initial post data\n"); + return JK_FALSE; + } + err= e->post->send( env, e->post, e ); + } err = e->worker->workerEnv->processCallbacks(env, e->worker->workerEnv, e, s); 1.4 +1 -12 jakarta-tomcat-connectors/jk/native2/include/jk_webapp.h Index: jk_webapp.h =================================================================== RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/include/jk_webapp.h,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- jk_webapp.h 2001/12/16 23:17:23 1.3 +++ jk_webapp.h 2001/12/18 22:51:55 1.4 @@ -140,22 +140,11 @@ /** You can fine-tune the logging level per location */ - int log_level; + int logLevel; /** Different apps can have different loggers. */ struct jk_logger *l; - - /* SSL Support - you can fine tune this per application. - * ( most likely you only do it per virtual host or globally ) - * XXX shouldn't SSL be enabled by default ??? - */ - int ssl_enable; - char *https_indicator; - char *certs_indicator; - char *cipher_indicator; - char *session_indicator; - char *key_size_indicator; /* Jk Options. Bitflag. */ 1.2 +97 -3 jakarta-tomcat-connectors/jk/native2/jni/jk_jni_aprImpl.c Index: jk_jni_aprImpl.c =================================================================== RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/jni/jk_jni_aprImpl.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- jk_jni_aprImpl.c 2001/12/05 20:52:41 1.1 +++ jk_jni_aprImpl.c 2001/12/18 22:51:55 1.2 @@ -63,11 +63,105 @@ #include <jni.h> #include "apr.h" +#include "apr_pools.h" JNIEXPORT jint JNICALL -Java_org_apache_jk_apr_AprImpl_initApr - (JNIEnv *env, jobject _jthis) +Java_org_apache_jk_apr_AprImpl_initialize(JNIEnv *env, jobject _jthis) { - return; + apr_initialize(); + return 0; } + +JNIEXPORT jint JNICALL +Java_org_apache_jk_apr_AprImpl_terminate(JNIEnv *env, jobject _jthis) +{ + apr_terminate(); + return 0; +} + +JNIEXPORT jlong JNICALL +Java_org_apache_jk_apr_AprImpl_poolCreate(JNIEnv *env, jobject _jthis, jlong parentP) +{ + apr_pool_t *parent; + apr_pool_t *child; + + parent=(apr_pool_t *)(void *)(long)parentP; + apr_pool_create( &child, parent ); + return (jlong)(long)child; +} + +JNIEXPORT jint JNICALL +Java_org_apache_jk_apr_AprImpl_poolClear(JNIEnv *env, jobject _jthis, + jlong poolP) +{ + apr_pool_t *pool; + + pool=(apr_pool_t *)(void *)poolP; + apr_pool_clear( pool ); + return 0; +} + +JNIEXPORT jint JNICALL +Java_org_apache_jk_apr_AprImpl_signal(JNIEnv *env, jobject _jthis, jint signo, + jobject func) +{ + + return 0; +} + +JNIEXPORT jlong JNICALL +Java_org_apache_jk_apr_AprImpl_userId(JNIEnv *env, jobject _jthis, jlong pool) +{ + + return 0; +} + +JNIEXPORT jlong JNICALL +Java_org_apache_jk_apr_AprImpl_shmInit(JNIEnv *env, jobject _jthis, jlong pool, + jlong size, jstring file) +{ + + return 0; +} + +JNIEXPORT jlong JNICALL +Java_org_apache_jk_apr_AprImpl_shmDestroy(JNIEnv *env, jobject _jthis, jlong pool, + jlong size, jstring file) +{ + + return 0; +} + + +JNIEXPORT jlong JNICALL +Java_org_apache_jk_apr_AprImpl_socketCreate(JNIEnv *env, jobject _jthis, jint fam, + jint type, jlong pool) +{ + + return 0; +} + +JNIEXPORT jlong JNICALL +Java_org_apache_jk_apr_AprImpl_socketBind(JNIEnv *env, jobject _jthis, + jlong socket, jlong sa ) +{ + + return 0; +} + +JNIEXPORT jlong JNICALL +Java_org_apache_jk_apr_AprImpl_socketListen(JNIEnv *env, jobject _jthis, + jlong socket, jint bl ) +{ + + return 0; +} + + + + + + + + 1.15 +1 -28 jakarta-tomcat-connectors/jk/native2/server/apache2/mod_jk.c Index: mod_jk.c =================================================================== RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/server/apache2/mod_jk.c,v retrieving revision 1.14 retrieving revision 1.15 diff -u -r1.14 -r1.15 --- mod_jk.c 2001/12/17 07:17:08 1.14 +++ mod_jk.c 2001/12/18 22:51:55 1.15 @@ -59,7 +59,7 @@ * Description: Apache 2 plugin for Jakarta/Tomcat * * Author: Gal Shachor <[EMAIL PROTECTED]> * * Henri Gomez <[EMAIL PROTECTED]> * - * Version: $Revision: 1.14 $ * + * Version: $Revision: 1.15 $ * ***************************************************************************/ /* @@ -96,7 +96,6 @@ #include "jk_apache2.h" #define JK_HANDLER ("jakarta-servlet") -#define JK_CTL_HANDLER ("jakarta-ctl") #define JK_MAGIC_TYPE ("application/x-jakarta-servlet") module AP_MODULE_DECLARE_DATA jk_module; @@ -965,32 +964,6 @@ return 0; } -/** handler for 'ctl' requests. - */ -static int jk_ctl_handler(request_rec *r) -{ - jk_workerEnv_t *workerEnv; - jk_logger_t *l; - jk_env_t *env; - - if( strcmp( r->handler, JK_CTL_HANDLER ) != 0 ) - return DECLINED; - - workerEnv=(jk_workerEnv_t *)ap_get_module_config(r->server->module_config, - &jk_module); - /* XXX Get a 'local' env instance */ - env = workerEnv->globalEnv; - - /* Find what 'ctl' request we have */ - - - /* 'Ping' clt - update the status for all workers, send ping - message. This will update 'up/down' state and give tomcat - an option to update the mapping tables. The ctl handler - will output an xhtml status page */ - - return DECLINED; -} /** Main service method, called to forward a request to tomcat */ static int jk_handler(request_rec *r)
-- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>