apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Cliff Woolley <jwool...@virginia.edu>
Subject Re: Using APR
Date Sun, 22 Aug 2004 04:57:41 GMT
On Sat, 21 Aug 2004, Anthony Wells wrote:

> Currently, I am attempting to port an older Apache 1.3 module to Apache 2.0
> using the APR.  Unfortunately, the documentation for APR is rather sparse

The documentation, such as it is, is all in the header files.  Some parts
are definitely more verbose than others, but it could be a lot worse
overall...

> I'm trying to read in the content from the connection into a byte buffer
> that I have created in the apr_pool.

>From a module's point of view, a bucket brigade is definitely what you
want.  But very few modules should ever have to read from a the network
directly (unless they've opened a connection to say a database backend or
something).  Anyway, you can look in the httpd-2.0/modules/filters
directory for tons of examples on how to use bucket brigades.  You can
also look at the two ApacheCon talks that I've given on bucket brigades
(see http://www.cs.virginia.edu/~jcw5q/talks/).  You might also pick up a
copy of Ryan Bloom's book, Apache Server 2.0: The Complete Reference.
Other bits of example code can be found in the apr/test/ suite.

> I also looked at mmap but I don't think mmap actually does what the name
> implies???)

It does exactly what the name implies -- it takes a file handle and mmaps
the contents of that file into the process's memory address space.

Hope this helps,
Cliff

Mime
View raw message