C2 General

> -----Ursprüngliche Nachricht-----
> Von: Joe Orton <[email protected]>
> Gesendet: Dienstag, 23. Juli 2019 08:04
> An: [email protected]
> Betreff: Re: svn commit: r1863191 - in /httpd/httpd/trunk: docs/log-
> message-tags/next-number modules/generators/cgi_common.h
> modules/generators/mod_cgi.c modules/generators/mod_cgid.c
> 
> On Mon, Jul 22, 2019 at 09:08:48PM +0200, Rüdiger Plüm wrote:
> > On 07/17/2019 09:51 AM, [email protected] wrote:
> > > Copied: httpd/httpd/trunk/modules/generators/cgi_common.h (from
> r1863117, httpd/httpd/trunk/modules/generators/mod_cgi.c)
> > > URL:
> http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/generators/cgi_co
> mmon.h?p2=httpd/httpd/trunk/modules/generators/cgi_common.h&p1=httpd/htt
> pd/trunk/modules/generators/mod_cgi.c&r1=1863117&r2=1863191&rev=1863191&
> view=diff
> > >
> ========================================================================
> ======
> > > --- httpd/httpd/trunk/modules/generators/mod_cgi.c (original)
> > > +++ httpd/httpd/trunk/modules/generators/cgi_common.h Wed Jul 17
> 07:51:53 2019
> >
> > > @@ -598,11 +34,13 @@ static const apr_bucket_type_t bucket_ty
> > >  struct cgi_bucket_data {
> > >      apr_pollset_t *pollset;
> > >      request_rec *r;
> > > +    apr_interval_time_t timeout;
> > >  };
> > >
> > >  /* Create a CGI bucket using pipes from script stdout 'out'
> > >   * and stderr 'err', for request 'r'. */
> > >  static apr_bucket *cgi_bucket_create(request_rec *r,
> ...
> > Shouldn't that code go into something like cgi_util.c which is linked
> > to both modules leaving only the structure and prototype stuff in the
> > header file? Or is this too much of a hassle since it creates some
> > sort of CGI-API as the symbols in cgi_util.c cannot be static but need
> > to be exported?
> 
> Yeah I pondered that a bit, this is definitely the least hassle and
> there is no real benefit to creating some static library to link it in
> both places anyway.  Building it shared - e.g. moving it into httpd
> itself? - is possible but since nobody links both modules at the same
> time anyway, there is no real win to be found here except shaving a few
> Kb off the install size.

I do link both at the same time since I want to offer all MPM's (prefork, 
worker and event)
and still use mod_cgi with prefork and mod_cgid with worker and event,
but I agree that the benefits might not be that large. It was more
that I stumbled across this rather non typical approach for httpd that made
me wonder and ask the question.

> 
> The whole of mod_cgid is the result of a massive copy and paste so,
> putting code in the .h felt wrong but probably least bad solution!

Fair enough.

Regards

Rüdiger

Reply via email to