You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Jem Berkes <jb...@pc9.org> on 2005/07/03 05:16:24 UTC
Questions from a newbie
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?
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.
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? A mod_smtp_deliver
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.
Re: Questions from a newbie
Posted by Jem Berkes <jb...@users.pc9.org>.
> ... The other solution (letting mod_smtpd read the whole
> thing into a buffer and then passing the buffer) seems way too memory
> hungry for me.
I was trying to figure that out too. It seems like a bad idea to read the
whole thing into memory because the buffer could easily require several
tens of megabytes.
Re: Questions from a newbie
Posted by Rian Hunter <ri...@MIT.EDU>.
Jem Berkes wrote:
> 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? A
> mod_smtp_deliver 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.
I was thinking of calling the handlers, and letting the handlers read
from the input_filters list in the request_rec, check out the
ap_rgetline function. Does this sound like a bad idea to you? any
security issues? The other solution (letting mod_smtpd read the whole
thing into a buffer and then passing the buffer) seems way too memory
hungry for me.
-rian