You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modules-dev@httpd.apache.org by Brian McQueen <mc...@gmail.com> on 2006/10/14 06:55:57 UTC

Re: brigade to stream

This went to the wrong list.  It should've gone to modules-dev.

Anyway, I have a better plan than the first one I proposed, so you can
read my bad plan below, and then my improved solution here.  If the
library I want to use accepts a single large buffer, then I could
probably tweek it to accept an iovec without breaking a sweat.  I
could even submit a patch to the guys who make the library (some open
source thing).  I bet they'd even like that.  Then I'd be able to use
the brigade to iovec thing and it would all fit together very well.

Brian

On 10/13/06, Brian McQueen <mc...@gmail.com> wrote:
> I have a library function that reads from a file descriptor, and I'd
> like to jam it into a filter.  I've been thinking that GNU libc has
> some cool features where one can define custom streams.  If one
> defines a read, write, seek, close and a position data structure, GNU
> libc lets you open a stream via those tools, producing a FILE *.
> Maybe that would allow me to read from a brigade as if it  were a FILE
> * and I could pass it on to this library function.  Of course its very
> platform specific, but that is an overrated virtue anyway.  What do
> you all think of the specific idea, and do you have any better way for
> me to get access to this library?  I could give the library a buffer
> too, but the buffer would be way too large, so I want something more
> stream oriented.  I'd like to be able to hand off a brigade to the
> library, but of course nobody else has brigades.
>
> Brian
>

Re: brigade to stream

Posted by Nick Kew <ni...@webthing.com>.
On Saturday 14 October 2006 05:55, Brian McQueen wrote:
> This went to the wrong list.  It should've gone to modules-dev.

Don't recollect it elsewhere.  Maybe I ignored it [wherever].

> Anyway, I have a better plan than the first one I proposed, so you can
> read my bad plan below, and then my improved solution here.  If the
> library I want to use accepts a single large buffer, then I could
> probably tweek it to accept an iovec without breaking a sweat.  I

Is this an input or an output filter?

I'm not sure I've understood your problem description, so I may be
addressing entirely the wrong problem.  But it seems to me that:
 * For an input filter it's straightforward
 * For an output filter it depends entirely on how the library behaves
   when it encounters end-of-input data midstream.  If it's happy to
   suspend gracefully and restart when there's more data, then fine.
   If not, then you've got a problem.

With that proviso, either scheme should be feasible.

-- 
Nick Kew

Application Development with Apache - the Apache Modules Book
http://www.prenhallprofessional.com/title/0132409674