You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Rasmus Lerdorf <ra...@lerdorf.on.ca> on 1998/01/17 15:47:15 UTC

[PATCH] new_connection -> ap_new_connection name change

I floated this a while ago and got a number of +1's to the concept, but I
didn't see it as part of the latest STATUS.  I guess it was because I
didn't float a patch but only the concept.  So, here is the patch:

Index: http_main.c
===================================================================
RCS file: /export/home/cvs/apachen/src/main/http_main.c,v
retrieving revision 1.268
diff -u -r1.268 http_main.c
--- http_main.c 1998/01/13 23:11:11     1.268
+++ http_main.c 1998/01/17 14:40:54
@@ -2409,7 +2409,7 @@
  */
 
 
-conn_rec *new_connection(pool *p, server_rec *server, BUFF *inout,
+conn_rec *ap_new_connection(pool *p, server_rec *server, BUFF *inout,
                         const struct sockaddr_in *remaddr,
                         const struct sockaddr_in *saddr,
                         int child_num)
@@ -3085,7 +3085,7 @@
 #endif
        bpushfd(conn_io, csd, dupped_csd);
 
-       current_conn = new_connection(ptrans, server_conf, conn_io,
+       current_conn = ap_new_connection(ptrans, server_conf, conn_io,
                                      (struct sockaddr_in *) &sa_client,
                                      (struct sockaddr_in *) &sa_server,
                                      my_child_num);
@@ -3757,7 +3757,7 @@
        cio->fd = fileno(stdout);
 #endif
        cio->fd_in = fileno(stdin);
-       conn = new_connection(ptrans, server_conf, cio,
+       conn = ap_new_connection(ptrans, server_conf, cio,
                              (struct sockaddr_in *) &sa_client,
                              (struct sockaddr_in *) &sa_server, -1);
        r = read_request(conn);
@@ -4107,7 +4107,7 @@
 #endif
        bpushfd(conn_io, csd, dupped_csd);
 
-       current_conn = new_connection(ptrans, server_conf, conn_io,
+       current_conn = ap_new_connection(ptrans, server_conf, conn_io,
                                      (struct sockaddr_in *) &sa_client,
                                      (struct sockaddr_in *) &sa_server,
                                      child_num);


Re: [PATCH] new_connection -> ap_new_connection name change

Posted by Ben Laurie <be...@algroup.co.uk>.
Rodent of Unusual Size wrote:
> 
> Ben Laurie wrote:
> >
> > Or even one (or more) leading underscores, e.g. _ap_new_connection(),
> > which is more obvious to the naked eye.
> 
> Unfortunately, that starts looking like macro invocations.

It does? Not through my glasses! Anyway, I'm not passionate about it.
Whatever.

Cheers,

Ben.

-- 
Ben Laurie            |Phone: +44 (181) 735 0686|Apache Group member
Freelance Consultant  |Fax:   +44 (181) 735 0689|http://www.apache.org
and Technical Director|Email: ben@algroup.co.uk |Apache-SSL author
A.L. Digital Ltd,     |http://www.algroup.co.uk/Apache-SSL
London, England.      |"Apache: TDG" http://www.ora.com/catalog/apache

Re: [PATCH] new_connection -> ap_new_connection name change

Posted by Rodent of Unusual Size <Ke...@Golux.Com>.
Ben Laurie wrote:
> 
> Or even one (or more) leading underscores, e.g. _ap_new_connection(),
> which is more obvious to the naked eye.

Unfortunately, that starts looking like macro invocations.

#ken	P-)}

Re: [PATCH] new_connection -> ap_new_connection name change

Posted by Gregory A Lundberg <lu...@vr.net>.
On Sun, 18 Jan 1998, Ben Laurie wrote:

> Or even one (or more) leading underscores, e.g. _ap_new_connection(),
> which is more obvious to the naked eye.

Watch ANSI/ISO standards compliance for this one, though.

----

Gregory A Lundberg		Senior Partner, VRnet Company
1441 Elmdale Drive              email: lundberg@vr.net [205.133.13.8]
Kettering, OH 45409-1615 USA    voice: +1 (937) 299-7653


Re: [PATCH] new_connection -> ap_new_connection name change

Posted by Ben Laurie <be...@algroup.co.uk>.
Rodent of Unusual Size wrote:
> 
> Ben Laurie wrote:
> >
> > The only problem I have with this is that httpd_ does not obviously mean
> > that the thing is private to apache. How about ap_private_?
> 
> Too long.  How about taking a page from Digital's naming conventions and
> using two underbars for private names?  E.g., ap__new_connection()?
> One underbar means it's a public interface, two means it's private and
> youre on your own if you use it.

Or even one (or more) leading underscores, e.g. _ap_new_connection(),
which is more obvious to the naked eye.

Cheers,

Ben.

-- 
Ben Laurie            |Phone: +44 (181) 735 0686|Apache Group member
Freelance Consultant  |Fax:   +44 (181) 735 0689|http://www.apache.org
and Technical Director|Email: ben@algroup.co.uk |Apache-SSL author
A.L. Digital Ltd,     |http://www.algroup.co.uk/Apache-SSL
London, England.      |"Apache: TDG" http://www.ora.com/catalog/apache

Re: [PATCH] new_connection -> ap_new_connection name change

Posted by Rodent of Unusual Size <Ke...@Golux.Com>.
Ben Laurie wrote:
> 
> The only problem I have with this is that httpd_ does not obviously mean
> that the thing is private to apache. How about ap_private_?

Too long.  How about taking a page from Digital's naming conventions and
using two underbars for private names?  E.g., ap__new_connection()?
One underbar means it's a public interface, two means it's private and
youre on your own if you use it.

#ken	P-)}

Re: [PATCH] new_connection -> ap_new_connection name change

Posted by Ben Laurie <be...@algroup.co.uk>.
Doug MacEachern wrote:
> 
> Rodent of Unusual Size wrote:
> 
> > Rasmus Lerdorf wrote:
> > >
> > > Ok, how about just making it static then?  If it will never be used
> > > outside of that file that should take care of it.
> >
> > If it's never used anywhere else then that's definitely the
> > preferred solution to my mind.  +1 - but I can't verify the
> > source at this moment.
> 
> Please don't!!!  The DCE module (discussed a while back, which uses dce
> rpc, not tcp, sfio, etc.), calls new_connection() in it's
> -DSTANDALONE_MAIN function.  Rename is little trouble, but static'izing
> new_connection() would be a nightmare.  I vote for httpd_new_connection,
> or something like that.

The only problem I have with this is that httpd_ does not obviously mean
that the thing is private to apache. How about ap_private_?

Cheers,

Ben.

-- 
Ben Laurie            |Phone: +44 (181) 735 0686|Apache Group member
Freelance Consultant  |Fax:   +44 (181) 735 0689|http://www.apache.org
and Technical Director|Email: ben@algroup.co.uk |Apache-SSL author
A.L. Digital Ltd,     |http://www.algroup.co.uk/Apache-SSL
London, England.      |"Apache: TDG" http://www.ora.com/catalog/apache

Re: [PATCH] new_connection -> ap_new_connection name change

Posted by Doug MacEachern <do...@telebusiness.co.nz>.
Dean Gaudet wrote:

> Could STANDALONE_MAIN be changed to #include another .c file?  I really
> hate not being able to stick static on things that are of file scope.

actually, when I first started to integrate the DCE-Web stuff withapache,
this is what I did.  But, I'd never seen a real program that
#include'd a .c file, so I figured it was considered bad practice or
something.  But, that was just a guess.  So, if it's okay with you,
it's okay with me.-Doug

> Dean
>
> On Sun, 18 Jan 1998, Doug MacEachern wrote:
>
> > Rodent of Unusual Size wrote:
> >
> > > Rasmus Lerdorf wrote:
> > > >
> > > > Ok, how about just making it static then?  If it will never be used
> > > > outside of that file that should take care of it.
> > >
> > > If it's never used anywhere else then that's definitely the
> > > preferred solution to my mind.  +1 - but I can't verify the
> > > source at this moment.
> >
> > Please don't!!!  The DCE module (discussed a while back, which uses dce
> > rpc, not tcp, sfio, etc.), calls new_connection() in it's
> > -DSTANDALONE_MAIN function.  Rename is little trouble, but static'izing
> > new_connection() would be a nightmare.  I vote for httpd_new_connection,
> > or something like that.
> >
> > -Doug
> >
> >




Re: [PATCH] new_connection -> ap_new_connection name change

Posted by Dean Gaudet <dg...@arctic.org>.
Could STANDALONE_MAIN be changed to #include another .c file?  I really
hate not being able to stick static on things that are of file scope. 

Dean

On Sun, 18 Jan 1998, Doug MacEachern wrote:

> Rodent of Unusual Size wrote:
> 
> > Rasmus Lerdorf wrote:
> > >
> > > Ok, how about just making it static then?  If it will never be used
> > > outside of that file that should take care of it.
> >
> > If it's never used anywhere else then that's definitely the
> > preferred solution to my mind.  +1 - but I can't verify the
> > source at this moment.
> 
> Please don't!!!  The DCE module (discussed a while back, which uses dce
> rpc, not tcp, sfio, etc.), calls new_connection() in it's
> -DSTANDALONE_MAIN function.  Rename is little trouble, but static'izing
> new_connection() would be a nightmare.  I vote for httpd_new_connection,
> or something like that.
> 
> -Doug
> 
> 


Re: [PATCH] new_connection -> ap_new_connection name change

Posted by Doug MacEachern <do...@telebusiness.co.nz>.
Rodent of Unusual Size wrote:

> Rasmus Lerdorf wrote:
> >
> > Ok, how about just making it static then?  If it will never be used
> > outside of that file that should take care of it.
>
> If it's never used anywhere else then that's definitely the
> preferred solution to my mind.  +1 - but I can't verify the
> source at this moment.

Please don't!!!  The DCE module (discussed a while back, which uses dce
rpc, not tcp, sfio, etc.), calls new_connection() in it's
-DSTANDALONE_MAIN function.  Rename is little trouble, but static'izing
new_connection() would be a nightmare.  I vote for httpd_new_connection,
or something like that.

-Doug


Re: [PATCH] new_connection -> ap_new_connection name change

Posted by Rodent of Unusual Size <Ke...@Golux.Com>.
Rasmus Lerdorf wrote:
> 
> Ok, how about just making it static then?  If it will never be used
> outside of that file that should take care of it.

If it's never used anywhere else then that's definitely the
preferred solution to my mind.  +1 - but I can't verify the
source at this moment.

#ken	P-)}

Re: [PATCH] new_connection -> ap_new_connection name change

Posted by Rasmus Lerdorf <ra...@lerdorf.on.ca>.
> I'm +1 on the concept, but -0 on the specific implementation.  I think using
> the "ap_" prefix here is asking for confusion; we've been using it to
> identify a) Apache rewrites of library routines that may not be universal
> (e.g., ap_snprintf) and b) routines written for Apache that have wider
> application than just in the httpd core (e.g., ap_escape_quotes, ap_cpystrn).
> new_connection() is a core httpd routine that won't ever find application
> outside of the server proper (nothing in src/support will ever call it,
> for instance), and it isn't a rewrite of any standard lib routine.  So
> I don't think the "ap_new_connection" name is appropriate.

Ok, how about just making it static then?  If it will never be used
outside of that file that should take care of it.

-Rasmus


Re: [PATCH] new_connection -> ap_new_connection name change

Posted by Rodent of Unusual Size <Ke...@Golux.Com>.
Rasmus Lerdorf wrote:
> 
> I floated this a while ago and got a number of +1's to the concept, but I
> didn't see it as part of the latest STATUS.  I guess it was because I
> didn't float a patch but only the concept.  So, here is the patch:

I'm +1 on the concept, but -0 on the specific implementation.  I think using
the "ap_" prefix here is asking for confusion; we've been using it to
identify a) Apache rewrites of library routines that may not be universal
(e.g., ap_snprintf) and b) routines written for Apache that have wider
application than just in the httpd core (e.g., ap_escape_quotes, ap_cpystrn).
new_connection() is a core httpd routine that won't ever find application
outside of the server proper (nothing in src/support will ever call it,
for instance), and it isn't a rewrite of any standard lib routine.  So
I don't think the "ap_new_connection" name is appropriate.

It does seem as though we need a nomenclaturefor Apache-httpd-private
names that we can apply when we run into collisions like this (and
the MD5 stuff a few months ago).  I don't think "ap_" is it; maybe
"httpd_"?  Something that identifies them as being particular and
specific to the Apache httpd itself.

#ken	P-)}