You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by Henri Gomez <hg...@apache.org> on 2004/07/27 10:07:04 UTC
mod_ajp / ajplib
It seems we all agreed on the need to make an ajplib
using APR to provide a fully functionnal AJP client lib.
This library will be used by :
- mod_ajp (at least to have some sort of test framework)
- proxy_ajp (to provide something usefull for mod_proxy
and inclusion in HTTPD, I still wonder if it will be
in 2.0 and/or 2.1 ?
Could we discuss now what should be included in such
library, structures, functions and others ?
I start to write some code by extracting part of jk2
and wonder for example about logging.
I'd like to have a pluggable logging function, something
which will be by default using stdout/stderr, but which
could be overrided to use Apache2 logging functions.
Advices welcome
---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org
Re: mod_ajp / ajplib
Posted by Henri Gomez <hg...@apache.org>.
Mladen Turk wrote:
>
>
> Costin Manolache wrote:
>
>>I think the second part ( a lib_apache ) is better - i.e. use
>>apache functions in mod_ajp, and if it needs to be tested
>>standalone or used with a different server - then you'll link
>>in a lib_apache containing the extracted functions. Maybe a
>>separate directory with the apache headers, functions will e
>>a good idea.
>>
>
>
> Well, I started the httpd_wrap, and it already has a fully functional ap
> logging API to stdout/stderr.
> Other functions like ap_run_create_connection, apr_rprintf etc.. will be
> aded.
>
> So, one will eiter include the full set of http headers or http_wrap.h. I
> don't like the idea of duplicating apache header names. IMO it can be
> confusing.
I should leave now.
I'll work on ajp_link/ajp_msg to use your logger and modify connect to
use your parms :)
Regards
---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org
RE: mod_ajp / ajplib
Posted by Mladen Turk <mt...@apache.org>.
Costin Manolache wrote:
>
> I think the second part ( a lib_apache ) is better - i.e. use
> apache functions in mod_ajp, and if it needs to be tested
> standalone or used with a different server - then you'll link
> in a lib_apache containing the extracted functions. Maybe a
> separate directory with the apache headers, functions will e
> a good idea.
>
Well, I started the httpd_wrap, and it already has a fully functional ap
logging API to stdout/stderr.
Other functions like ap_run_create_connection, apr_rprintf etc.. will be
aded.
So, one will eiter include the full set of http headers or http_wrap.h. I
don't like the idea of duplicating apache header names. IMO it can be
confusing.
MT.
Re: mod_ajp / ajplib
Posted by Costin Manolache <cm...@yahoo.com>.
Mladen Turk wrote:
>>I start to write some code by extracting part of jk2 and
>>wonder for example about logging.
>>
>>I'd like to have a pluggable logging function, something
>>which will be by default using stdout/stderr, but which could
>>be overrided to use Apache2 logging functions.
>>
>
>
> Well, I can extract the apache's logging functions in file that will use
> stdout/stderr, so we'll have the same api.
> The file will get complied together with test case, so there will be no need
> to change something in the core of lib, and we willl not need anything
> pluggable :).
> The only difference would be:
>
> #ifdef AJP_TEST_CASE
> #include "httpd_wrapper.h"
> #else
> ... Include the real apache headers
> #endif
>
> Think that other needed ap_xxx api calls can be written in the same way,
> finaly having something like 'dummy apache2 API lib' for testing from
> command line.
> If we need a request_rec struct for example, we'll make our own surrogate
> and fill it only with the needed struct elements, etc...
I think the second part ( a lib_apache ) is better - i.e. use apache
functions in mod_ajp, and if it needs to be tested standalone or used
with a different server - then you'll link in a lib_apache containing
the extracted functions. Maybe a separate directory with the apache
headers, functions will e a good idea.
I agree with Mladen that it would be better to use apache, there is no
point in adding an extra layer. Well - it would be better if the logging
will be part of APR :-)
Costn
---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org
Re: mod_ajp / ajplib
Posted by jean-frederic clere <jf...@fujitsu-siemens.com>.
Henri Gomez wrote:
> Mladen Turk wrote:
>
>>
>>
>> Henri Gomez wrote:
>>
>>> It seems we all agreed on the need to make an ajplib using APR to
>>> provide a fully functionnal AJP client lib.
>>>
>>> This library will be used by :
>>>
>>> - mod_ajp (at least to have some sort of test framework)
>>>
>>
>>
>> Well, it's discussable if we decide to import the mod_proxy code to our
>> source tree, and roll out our own version of mod_proxy calling it
>> mod_proxy_on_the_steroids :).
>>
>>
>>> - proxy_ajp (to provide something usefull for mod_proxy
>>> and inclusion in HTTPD, I still wonder if it will be
>>> in 2.0 and/or 2.1 ?
>>>
>>> Could we discuss now what should be included in such library,
>>> structures, functions and others ?
>>>
>>
>>
>> The starting point for lib should be opened apr_socket_t. The way how
>> it's
>> get opened to a particular backend depends on framework.
>> For start we can make our own simply directly opening apr_socket (or
>> couple
>> of them) from command line, something like apr/aprutil test framework?
>>
>>
>>
>>> I start to write some code by extracting part of jk2 and wonder for
>>> example about logging.
>>>
>>> I'd like to have a pluggable logging function, something which will
>>> be by default using stdout/stderr, but which could be overrided to
>>> use Apache2 logging functions.
>>>
>>
>>
>> Well, I can extract the apache's logging functions in file that will use
>> stdout/stderr, so we'll have the same api.
>> The file will get complied together with test case, so there will be
>> no need
>> to change something in the core of lib, and we willl not need anything
>> pluggable :).
>> The only difference would be:
>>
>> #ifdef AJP_TEST_CASE
>> #include "httpd_wrapper.h"
>> #else
>> ... Include the real apache headers
>> #endif
>>
>> Think that other needed ap_xxx api calls can be written in the same way,
>> finaly having something like 'dummy apache2 API lib' for testing from
>> command line.
>> If we need a request_rec struct for example, we'll make our own surrogate
>> and fill it only with the needed struct elements, etc...
>
>
> I could start with assumption we have ajp_log(xxxx) function in the lib
> like this ?
No. It is better to have a file doing the wrapping from the ap_xxx to
replacement routine. Otherwise you return to mod_jk2.
>
> ajp_log(ajp_env_t * env, int loglevel, char * fmt, ...) ?
>
> The idea could be to have :
>
> ajp_env_t * ajp_init()
>
> ajp_env_t * env;
>
> myenv = ajp_init();
>
> ajp_setlogfunc(myenv, myfunc)
>
> or
>
> myenv->logfunc = myfunc;
>
> or
>
> myenv = ajp_init(myfunc)
>
>
>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org
RE: mod_ajp / ajplib
Posted by Mladen Turk <mt...@apache.org>.
Henri Gomez wrote:
>
> Well we should make room on jtc to host ajplib/mod_ajp/ajp_proxy.
>
> What about creating in jtc root :
>
> ajp
> ajp/ajplib
ajp/ajplib/test
+1
> ajp/mod_ajp
> ajp/proxy_ajp
>
Let's wait on those two for a while.
Taking last week discussion into account who knows where we'll end up next
week :)
MT.
Re: mod_ajp / ajplib
Posted by Henri Gomez <hg...@apache.org>.
Mladen Turk wrote:
>
>
> Henri Gomez wrote:
>
>>>Well, I can extract the apache's logging functions in file
>>
>>that will
>>
>>>use stdout/stderr, so we'll have the same api.
>>>The file will get complied together with test case, so
>>
>>there will be
>>
>>>no need to change something in the core of lib, and we
>>
>>willl not need
>>
>>>anything pluggable :).
>>>The only difference would be:
>>>
>>>#ifdef AJP_TEST_CASE
>>>#include "httpd_wrapper.h"
>>>#else
>>>... Include the real apache headers
>>>#endif
>>>
>>>Think that other needed ap_xxx api calls can be written in the same
>>>way, finaly having something like 'dummy apache2 API lib'
>>
>>for testing
>>
>>>from command line.
>>>If we need a request_rec struct for example, we'll make our own
>>>surrogate and fill it only with the needed struct elements, etc...
>>
>>I could start with assumption we have ajp_log(xxxx) function
>>in the lib like this ?
>>
>>ajp_log(ajp_env_t * env, int loglevel, char * fmt, ...) ?
>>
>
>
> No, use the exactly the same API as Apache2 logging.
>
> ap_log_error(APLOG_MARK, APLOG_INFO, rv, server,
> "whatever message");
>
> I'll rewrite the logging using simple fprintf to stdio/stderr, preserving
> actual API, so we don't need the wrapers.
>
> And, since we don't have a server_rec stucture I'll make a dummy one in
> httpd_wrapper.h
> Think it would ease a lot.
>
> I'll have something later today (httpd_wrapper.h and httpd_wrapper.c)
> offering a apache2 API to console apps, mimicking libhttpd (only what's
> needed).
>
> You can work in the meantime on build infrastructure.
> I prefer not having a actual lib produced, cause it will have to fit in one
> or two files. We can for start make couple of them, and later merge them
> into a single file, that will accompany the proxy_ajp.c.
Well we should make room on jtc to host ajplib/mod_ajp/ajp_proxy.
What about creating in jtc root :
ajp
ajp/ajplib
ajp/mod_ajp
ajp/proxy_ajp
?
---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org
RE: mod_ajp / ajplib
Posted by Mladen Turk <mt...@apache.org>.
Henri Gomez wrote:
> >
> > Well, I can extract the apache's logging functions in file
> that will
> > use stdout/stderr, so we'll have the same api.
> > The file will get complied together with test case, so
> there will be
> > no need to change something in the core of lib, and we
> willl not need
> > anything pluggable :).
> > The only difference would be:
> >
> > #ifdef AJP_TEST_CASE
> > #include "httpd_wrapper.h"
> > #else
> > ... Include the real apache headers
> > #endif
> >
> > Think that other needed ap_xxx api calls can be written in the same
> > way, finaly having something like 'dummy apache2 API lib'
> for testing
> > from command line.
> > If we need a request_rec struct for example, we'll make our own
> > surrogate and fill it only with the needed struct elements, etc...
>
> I could start with assumption we have ajp_log(xxxx) function
> in the lib like this ?
>
> ajp_log(ajp_env_t * env, int loglevel, char * fmt, ...) ?
>
No, use the exactly the same API as Apache2 logging.
ap_log_error(APLOG_MARK, APLOG_INFO, rv, server,
"whatever message");
I'll rewrite the logging using simple fprintf to stdio/stderr, preserving
actual API, so we don't need the wrapers.
And, since we don't have a server_rec stucture I'll make a dummy one in
httpd_wrapper.h
Think it would ease a lot.
I'll have something later today (httpd_wrapper.h and httpd_wrapper.c)
offering a apache2 API to console apps, mimicking libhttpd (only what's
needed).
You can work in the meantime on build infrastructure.
I prefer not having a actual lib produced, cause it will have to fit in one
or two files. We can for start make couple of them, and later merge them
into a single file, that will accompany the proxy_ajp.c.
MT.
Re: mod_ajp / ajplib
Posted by Henri Gomez <hg...@apache.org>.
Mladen Turk wrote:
>
>
> Henri Gomez wrote:
>
>>It seems we all agreed on the need to make an ajplib using
>>APR to provide a fully functionnal AJP client lib.
>>
>>This library will be used by :
>>
>>- mod_ajp (at least to have some sort of test framework)
>>
>
>
> Well, it's discussable if we decide to import the mod_proxy code to our
> source tree, and roll out our own version of mod_proxy calling it
> mod_proxy_on_the_steroids :).
>
>
>>- proxy_ajp (to provide something usefull for mod_proxy
>> and inclusion in HTTPD, I still wonder if it will be
>> in 2.0 and/or 2.1 ?
>>
>>Could we discuss now what should be included in such library,
>>structures, functions and others ?
>>
>
>
> The starting point for lib should be opened apr_socket_t. The way how it's
> get opened to a particular backend depends on framework.
> For start we can make our own simply directly opening apr_socket (or couple
> of them) from command line, something like apr/aprutil test framework?
>
>
>
>>I start to write some code by extracting part of jk2 and
>>wonder for example about logging.
>>
>>I'd like to have a pluggable logging function, something
>>which will be by default using stdout/stderr, but which could
>>be overrided to use Apache2 logging functions.
>>
>
>
> Well, I can extract the apache's logging functions in file that will use
> stdout/stderr, so we'll have the same api.
> The file will get complied together with test case, so there will be no need
> to change something in the core of lib, and we willl not need anything
> pluggable :).
> The only difference would be:
>
> #ifdef AJP_TEST_CASE
> #include "httpd_wrapper.h"
> #else
> ... Include the real apache headers
> #endif
>
> Think that other needed ap_xxx api calls can be written in the same way,
> finaly having something like 'dummy apache2 API lib' for testing from
> command line.
> If we need a request_rec struct for example, we'll make our own surrogate
> and fill it only with the needed struct elements, etc...
I could start with assumption we have ajp_log(xxxx) function in the lib
like this ?
ajp_log(ajp_env_t * env, int loglevel, char * fmt, ...) ?
The idea could be to have :
ajp_env_t * ajp_init()
ajp_env_t * env;
myenv = ajp_init();
ajp_setlogfunc(myenv, myfunc)
or
myenv->logfunc = myfunc;
or
myenv = ajp_init(myfunc)
---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org
RE: mod_ajp / ajplib
Posted by Mladen Turk <mt...@apache.org>.
Henri Gomez wrote:
>
> It seems we all agreed on the need to make an ajplib using
> APR to provide a fully functionnal AJP client lib.
>
> This library will be used by :
>
> - mod_ajp (at least to have some sort of test framework)
>
Well, it's discussable if we decide to import the mod_proxy code to our
source tree, and roll out our own version of mod_proxy calling it
mod_proxy_on_the_steroids :).
> - proxy_ajp (to provide something usefull for mod_proxy
> and inclusion in HTTPD, I still wonder if it will be
> in 2.0 and/or 2.1 ?
>
> Could we discuss now what should be included in such library,
> structures, functions and others ?
>
The starting point for lib should be opened apr_socket_t. The way how it's
get opened to a particular backend depends on framework.
For start we can make our own simply directly opening apr_socket (or couple
of them) from command line, something like apr/aprutil test framework?
> I start to write some code by extracting part of jk2 and
> wonder for example about logging.
>
> I'd like to have a pluggable logging function, something
> which will be by default using stdout/stderr, but which could
> be overrided to use Apache2 logging functions.
>
Well, I can extract the apache's logging functions in file that will use
stdout/stderr, so we'll have the same api.
The file will get complied together with test case, so there will be no need
to change something in the core of lib, and we willl not need anything
pluggable :).
The only difference would be:
#ifdef AJP_TEST_CASE
#include "httpd_wrapper.h"
#else
... Include the real apache headers
#endif
Think that other needed ap_xxx api calls can be written in the same way,
finaly having something like 'dummy apache2 API lib' for testing from
command line.
If we need a request_rec struct for example, we'll make our own surrogate
and fill it only with the needed struct elements, etc...
MT.