httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael Vergoz ...@binarysec.com>
Subject Re: Questions from a newbie
Date Sun, 03 Jul 2005 07:13:07 GMT
Hi Jem,

Le Dimanche 3 Juillet 2005 05:18, Jem Berkes a écrit :
> I'm just getting into module development for the first time (thanks to
> impetus provided by Google's Summer of Code)... I've got a test
> environment with 2.1.6-alpha and have succeeded in writing minimal modules
> and getting them working on a live server. But I have a few nagging
> questions that I hope someone can help me with.
>
> 1) ap_hook_* functions... obviously, there are lots of these that are used
> to register hooks. Where can I find a reference list of the available
> functions? I'm looking through code of modules, and it leaves me
> wondering, how would I know what hook possibilities exist?

Look at include/http_request.h
Every AP_DECLARE_HOOK are a hook prototype.
AP_DECLARE_HOOK(int,type_checker,(request_rec *r)) == apr_hook_type_checker()

>
> 2) I'm having trouble navigating and finding facilities I need. Let's say
> I was looking for something that turns out to be satisfied by ap_fwrite(),
> in the API for filters. Where should I start, to lead myself to finding
> that function? I thought apr.apache.org but Google shows no mention of
> ap_fwrite within that site.
There is no ap_fwrite() on Apache. Try apr_file_write(apr_file_t *thefile, 
const void *buf, apr_size_t *nbytes)

>
> 3) I can understand how a module can tie into Apache's normal processing
> to intercept connections, requests, etc. But what is the structure and
> mechanism by which one module can make use of another module? I can use C
> functions but there must be some kind of standardized interface for
> inter-modular calls?
>
> For example, for SMTP support we are contemplating the protocol unit
> (mod_smtpd) passing on mail to a module that specifically delivers mail.
> How do those two entities communicate with each other? 

There is many ways to do this (pipe, fifo, socket, shared memory, ....)
Also you can use an external module procedure because Apache use RTLD_GLOBAL 
when it load modules. 
Fake example:
Function mod_blah_fct() in mod_blah.so
Function mod_blih_fct() that use mod_blah_fct() (in mod_blih.so)

that is transparency because RTLD_GLOBAL.

> would get a potentially large chunk of data (const char* ?) from mod_smtpd
> and deliver the mail via procmail, etc. This is a loose binding by the way
> since all received mails do not necessarily have to be delivered.

You should ask mod_smtpd devels for more informations. 

>
> - Jem Berkes

-- 
Michael Vergoz
BinarySEC - R&D.
http://www.binarysec.com/


Mime
View raw message