You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Kevin Mallory <km...@spidercache.com> on 2001/11/29 22:35:42 UTC

RE: Request for Patch to 1.3.x

Does anyone have any objections to adding this capability??

-----Original Message-----
From: Greg Stein [mailto:gstein@lyra.org] 
Sent: Sunday, October 28, 2001 10:28 PM
To: dev@httpd.apache.org
Cc: Kevin Mallory
Subject: Re: Request for Patch to 1.3.x


On Wed, Oct 03, 2001 at 11:19:34AM -0700, Kevin Mallory wrote:
>...

[ patch allows custom caching mechanisms ]

>...
> The patch simply adds a new callback (the 'filter callback') into the

>handling in buff.c's routine writev_it_all() and buff_write().
>  
> When not registered, there is no performance impact to users. This 
> filter callback makes it possible for SpiderCache to correctly 
> intercept the request as it is being processed, thus allowing our 
> product to perform dynamic page caching.

+1 on including this patch.

I see no bad effects, and it has definite utility.

Cheers,
-g


>...
> *** orig_buff.c	Tue Aug 21 17:45:34 2001
> --- spidercache_buff.c	Tue Aug 21 17:45:35 2001
> ***************
> *** 356,361 ****
> --- 356,365 ----
>   {
>       int rv;
>   
> +     if (fb->filter_callback != NULL) {
> +         fb->filter_callback(fb, buf, nbyte);
> +     }
> +    
>   #if defined(WIN32) || defined(NETWARE)
>       if (fb->flags & B_SOCKET) {
>   	rv = sendwithtimeout(fb->fd, buf, nbyte, 0);
> ***************
> *** 438,443 ****
> --- 442,450 ----
>   		       (size_t) SF_UNBOUND, 1, SF_WRITE);
>   #endif
>   
> +     fb->callback_data = NULL;
> +     fb->filter_callback = NULL;
> + 
>       return fb;
>   }
>   
> ***************
> *** 1077,1082 ****
> --- 1084,1095 ----
>   static int writev_it_all(BUFF *fb, struct iovec *vec, int nvec)
>   {
>       int i, rv;
> +     
> +     if (fb->filter_callback != NULL) {
> +         for (i = 0; i < nvec; i++) {
> +             fb->filter_callback(fb, vec[i].iov_base,
vec[i].iov_len);
> +         }
> +     }
>   
>       /* while it's nice an easy to build the vector and crud, it's
painful
>        * to deal with a partial writev()


> *** orig_buff.h	Tue Aug 21 17:45:34 2001
> --- spidercache_buff.h	Tue Aug 21 17:45:35 2001
> ***************
> *** 129,134 ****
> --- 129,138 ----
>       Sfio_t *sf_in;
>       Sfio_t *sf_out;
>   #endif
> + 
> +     void *callback_data;
> +     void (*filter_callback)(BUFF *, const void *, int );
> + 	
>   };
>   
>   #ifdef B_SFIO


-- 
Greg Stein, http://www.lyra.org/


Re: Request for Patch to 1.3.x

Posted by Jim Jagielski <ji...@jaguNET.com>.
I admit that I let this slide, but it does seem a very useful
concept for 1.3 :) :)

+1 as well.

At 6:04 PM -0500 11/29/01, Bill Stoddard wrote:
>It's kinda crufty, but so are a lot of other things in 1.3. It is a small patch which is
>goodness and I appreciate what it is used for.
>
>If it is useful enough for you to be still interested in it after a month, I'll add my +1
>to Gregs :-)
>
>+1
>

-- 
===========================================================================
   Jim Jagielski   [|]   jim@jaguNET.com   [|]   http://www.jaguNET.com/
      "A society that will trade a little liberty for a little order
                   will lose both and deserve neither"

Re: Request for Patch to 1.3.x

Posted by Bill Stoddard <bi...@wstoddard.com>.
It's kinda crufty, but so are a lot of other things in 1.3. It is a small patch which is
goodness and I appreciate what it is used for.

If it is useful enough for you to be still interested in it after a month, I'll add my +1
to Gregs :-)

+1

Bill

----- Original Message -----
From: "Kevin Mallory" <km...@spidercache.com>
To: "'Greg Stein'" <gs...@lyra.org>; <de...@httpd.apache.org>
Sent: Thursday, November 29, 2001 4:35 PM
Subject: RE: Request for Patch to 1.3.x


> Does anyone have any objections to adding this capability??
>
> -----Original Message-----
> From: Greg Stein [mailto:gstein@lyra.org]
> Sent: Sunday, October 28, 2001 10:28 PM
> To: dev@httpd.apache.org
> Cc: Kevin Mallory
> Subject: Re: Request for Patch to 1.3.x
>
>
> On Wed, Oct 03, 2001 at 11:19:34AM -0700, Kevin Mallory wrote:
> >...
>
> [ patch allows custom caching mechanisms ]
>
> >...
> > The patch simply adds a new callback (the 'filter callback') into the
>
> >handling in buff.c's routine writev_it_all() and buff_write().
> >
> > When not registered, there is no performance impact to users. This
> > filter callback makes it possible for SpiderCache to correctly
> > intercept the request as it is being processed, thus allowing our
> > product to perform dynamic page caching.
>
> +1 on including this patch.
>
> I see no bad effects, and it has definite utility.
>
> Cheers,
> -g
>
>
> >...
> > *** orig_buff.c Tue Aug 21 17:45:34 2001
> > --- spidercache_buff.c Tue Aug 21 17:45:35 2001
> > ***************
> > *** 356,361 ****
> > --- 356,365 ----
> >   {
> >       int rv;
> >
> > +     if (fb->filter_callback != NULL) {
> > +         fb->filter_callback(fb, buf, nbyte);
> > +     }
> > +
> >   #if defined(WIN32) || defined(NETWARE)
> >       if (fb->flags & B_SOCKET) {
> >   rv = sendwithtimeout(fb->fd, buf, nbyte, 0);
> > ***************
> > *** 438,443 ****
> > --- 442,450 ----
> >          (size_t) SF_UNBOUND, 1, SF_WRITE);
> >   #endif
> >
> > +     fb->callback_data = NULL;
> > +     fb->filter_callback = NULL;
> > +
> >       return fb;
> >   }
> >
> > ***************
> > *** 1077,1082 ****
> > --- 1084,1095 ----
> >   static int writev_it_all(BUFF *fb, struct iovec *vec, int nvec)
> >   {
> >       int i, rv;
> > +
> > +     if (fb->filter_callback != NULL) {
> > +         for (i = 0; i < nvec; i++) {
> > +             fb->filter_callback(fb, vec[i].iov_base,
> vec[i].iov_len);
> > +         }
> > +     }
> >
> >       /* while it's nice an easy to build the vector and crud, it's
> painful
> >        * to deal with a partial writev()
>
>
> > *** orig_buff.h Tue Aug 21 17:45:34 2001
> > --- spidercache_buff.h Tue Aug 21 17:45:35 2001
> > ***************
> > *** 129,134 ****
> > --- 129,138 ----
> >       Sfio_t *sf_in;
> >       Sfio_t *sf_out;
> >   #endif
> > +
> > +     void *callback_data;
> > +     void (*filter_callback)(BUFF *, const void *, int );
> > +
> >   };
> >
> >   #ifdef B_SFIO
>
>
> --
> Greg Stein, http://www.lyra.org/
>


Re: Request for Patch to 1.3.x

Posted by Bill Stoddard <bi...@wstoddard.com>.
Just committed and bumped the minor magic number to account for fields added to the end of
buff.h. Please review.

Bill

----- Original Message -----
From: "Kevin Mallory" <km...@spidercache.com>
To: "'Greg Stein'" <gs...@lyra.org>; <de...@httpd.apache.org>
Sent: Thursday, November 29, 2001 4:35 PM
Subject: RE: Request for Patch to 1.3.x


> Does anyone have any objections to adding this capability??
>
> -----Original Message-----
> From: Greg Stein [mailto:gstein@lyra.org]
> Sent: Sunday, October 28, 2001 10:28 PM
> To: dev@httpd.apache.org
> Cc: Kevin Mallory
> Subject: Re: Request for Patch to 1.3.x
>
>
> On Wed, Oct 03, 2001 at 11:19:34AM -0700, Kevin Mallory wrote:
> >...
>
> [ patch allows custom caching mechanisms ]
>
> >...
> > The patch simply adds a new callback (the 'filter callback') into the
>
> >handling in buff.c's routine writev_it_all() and buff_write().
> >
> > When not registered, there is no performance impact to users. This
> > filter callback makes it possible for SpiderCache to correctly
> > intercept the request as it is being processed, thus allowing our
> > product to perform dynamic page caching.
>
> +1 on including this patch.
>
> I see no bad effects, and it has definite utility.
>
> Cheers,
> -g
>
>
> >...
> > *** orig_buff.c Tue Aug 21 17:45:34 2001
> > --- spidercache_buff.c Tue Aug 21 17:45:35 2001
> > ***************
> > *** 356,361 ****
> > --- 356,365 ----
> >   {
> >       int rv;
> >
> > +     if (fb->filter_callback != NULL) {
> > +         fb->filter_callback(fb, buf, nbyte);
> > +     }
> > +
> >   #if defined(WIN32) || defined(NETWARE)
> >       if (fb->flags & B_SOCKET) {
> >   rv = sendwithtimeout(fb->fd, buf, nbyte, 0);
> > ***************
> > *** 438,443 ****
> > --- 442,450 ----
> >          (size_t) SF_UNBOUND, 1, SF_WRITE);
> >   #endif
> >
> > +     fb->callback_data = NULL;
> > +     fb->filter_callback = NULL;
> > +
> >       return fb;
> >   }
> >
> > ***************
> > *** 1077,1082 ****
> > --- 1084,1095 ----
> >   static int writev_it_all(BUFF *fb, struct iovec *vec, int nvec)
> >   {
> >       int i, rv;
> > +
> > +     if (fb->filter_callback != NULL) {
> > +         for (i = 0; i < nvec; i++) {
> > +             fb->filter_callback(fb, vec[i].iov_base,
> vec[i].iov_len);
> > +         }
> > +     }
> >
> >       /* while it's nice an easy to build the vector and crud, it's
> painful
> >        * to deal with a partial writev()
>
>
> > *** orig_buff.h Tue Aug 21 17:45:34 2001
> > --- spidercache_buff.h Tue Aug 21 17:45:35 2001
> > ***************
> > *** 129,134 ****
> > --- 129,138 ----
> >       Sfio_t *sf_in;
> >       Sfio_t *sf_out;
> >   #endif
> > +
> > +     void *callback_data;
> > +     void (*filter_callback)(BUFF *, const void *, int );
> > +
> >   };
> >
> >   #ifdef B_SFIO
>
>
> --
> Greg Stein, http://www.lyra.org/
>