Return-Path: Delivered-To: apmail-apr-dev-archive@www.apache.org Received: (qmail 15446 invoked from network); 22 Aug 2004 04:57:50 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 22 Aug 2004 04:57:50 -0000 Received: (qmail 97920 invoked by uid 500); 22 Aug 2004 04:57:48 -0000 Delivered-To: apmail-apr-dev-archive@apr.apache.org Received: (qmail 97880 invoked by uid 500); 22 Aug 2004 04:57:48 -0000 Mailing-List: contact dev-help@apr.apache.org; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Delivered-To: mailing list dev@apr.apache.org Received: (qmail 97865 invoked by uid 99); 22 Aug 2004 04:57:47 -0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Date: Sun, 22 Aug 2004 00:57:41 -0400 (EDT) From: Cliff Woolley X-X-Sender: jcw5q@cobra.cs.Virginia.EDU To: Anthony Wells cc: dev@apr.apache.org, apache-modules@covalent.net Subject: Re: Using APR In-Reply-To: Message-ID: References: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N 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