httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dean Gaudet <>
Subject Re: layered I/O (was: cvs commit: ...)
Date Wed, 29 Mar 2000 19:54:30 GMT
On Tue, 28 Mar 2000, Greg Stein wrote:

> > r->output = BUFF.
> Um. How do you create the layering? This seems to be a single layer.

here let me expand on the example i started in a message to roy.

	typedef struct iol_compress {
		ap_iol iol;
		ap_iol *source;
	} iol_compress;

	static ap_status_t compress_read(ap_iol *viol, const char *buf,
		ap_size_t size, ap_ssize_t *nbytes)
		iol_compress *iol = (iol_compress *)viol;

		read bytes from iol->source;
		compress them into buf;

	ap_iol *compress_new(ap_iol *source)
		iol_compress *iol;

		iol = malloc(sizeof(iol_compress));
		iol->iol.methods = &compress_methods;
		iol->source = source;
		return (ap_iol *)iol;

that is to say, the layer is created by writing an iol which actually
expects an iol, or a BUFF as one of its initializers.  take a peek at
iol_socket.c, it's almost like this, except it expects an ap_socket_t *...
which is really just another layer.

as far as i can tell this implicit linkage is really bothering people --
they want explicit *next, *prev pointers in the stack of handlers.  i
don't see the point honestly -- they both achieve the same thing.


View raw message