You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@apr.apache.org by Justin Erenkrantz <je...@ebuilt.com> on 2001/05/16 18:21:48 UTC

Moving stuff from server/util_* into apr-util?

Hi gang,

I keep running into files (server/util_date.c, server/util_uri.c) that
can be extremely useful outside of httpd-2.0.  What would people think
about trying to move some of that code inside of apr-util?

mod_mbox has a private copy of util_date.c because it doesn't rely on
being inside of the httpd-2.0 tree - think of the standalone APR-based
programs that generate the index (I also added some fixes and made the
date parsing more featureful).  mod_mbox.c has to be in httpd-2.0, but
the other mod_mbox code should probably live in apr-util (if it is ever
committed into CVS).  I've now come across a use for util_uri.c outside
of httpd-2.0 (we're writing a load test tool here).  Again, I've created
a private copy of the files and de-httpdified it.  It isn't too painful,
but I'm starting to see the same pattern over and over again.

A lot of work would have to be done to move this stuff into apr-util
(try to remove any of the dependencies on the httpd-2.0 structures,
symbol renames, API changes, build changes, etc.), but I think it is
feasible.  I can do this in my local tree without problems, but since I
don't have commit access, my work would go to waste unless someone with
commit access in both APR and httpd-2.0 thinks this change (and all of
the patches to implement this are of sufficient quality) is a good idea
and would commit the changes.  This isn't something I want to start
unless we agree this is the way to go.

This would lead to some big patches (symbol renames, etc.), but I think
that in the long run a bunch of those files should probably be kicked
into apr-util - it just seems the "Right Thing" to do though.  And, not
everything would be feasible to move in (util_filter.c?), but there are
probably enough things that are isolated enough to make this migration
worthwhile.

Maybe I'm wrong and there are lots of reasons this hasn't been done
before...  -- justin


Re: Moving stuff from server/util_* into apr-util?

Posted by rb...@covalent.net.
On Thu, 17 May 2001, Justin Erenkrantz wrote:

> On Thu, May 17, 2001 at 10:17:45AM -0700, Doug MacEachern wrote:
> > i think the only reason it hasn't been done is because it will be somewhat
> > painful.  maybe it would be worthwhile to first come up with a list of
> > canidate functions/structures to move from httpd to apr-util.
>
> Here are the three files that I definitely believe should be moved:
> util_date.c (don't know what dir this would belong in)
> util_uri.c (uri_delims.h, gen_uri_delims.c, etc. go into apr-util/uri)
> util_md5.c (sha is already in apr-util/crypto)
>
> I'm not sure about (bits and pieces, perhaps):
> util.c
> util_ebcdic.c
> util_cfgtree.c
> util_debug.c
>
> I definitely know that these can't be moved (and should probably be
> renamed perhaps):
> util_filter.c
> util_script.c
> util_xml.c
>
> What do you think?
>
> I think the best way to do this is one file at a time.  Add it into
> apr-util, switch the symbols in all affected files (perl or
> apu_compat.h?), then remove the old version in httpd-2.0.  And, you are
> right, this certainly won't be pretty.
>
> Roy said he might have time to do this, but I'm not so sure about
> that.  =)
>
> The problem is that I really don't know how to submit patches for this.
> I can submit files that will go into apr-util, but this may be better
> off for someone with commit access to just sit down for a few hours and
> get this right.  This just touches so many files - sending so many
> patches (what I would have to do) gets burdensome and confusing.  But, I
> can do that if no one with commit access has the time.

If we are going to do this, then any function in these files can't refer
to request_rec's.  Please submit the files to the list, one at a time.  I
can commit them for you, and then we can begin to migrate the Apache calls
from the current files to the new ones.  Once the Apache calls are
migrated, we can remove the old files.

Ryan

_______________________________________________________________________________
Ryan Bloom                        	rbb@apache.org
406 29th St.
San Francisco, CA 94131
-------------------------------------------------------------------------------


Re: Moving stuff from server/util_* into apr-util?

Posted by rb...@covalent.net.
On Thu, 17 May 2001, Justin Erenkrantz wrote:

> On Thu, May 17, 2001 at 10:17:45AM -0700, Doug MacEachern wrote:
> > i think the only reason it hasn't been done is because it will be somewhat
> > painful.  maybe it would be worthwhile to first come up with a list of
> > canidate functions/structures to move from httpd to apr-util.
>
> Here are the three files that I definitely believe should be moved:
> util_date.c (don't know what dir this would belong in)
> util_uri.c (uri_delims.h, gen_uri_delims.c, etc. go into apr-util/uri)
> util_md5.c (sha is already in apr-util/crypto)
>
> I'm not sure about (bits and pieces, perhaps):
> util.c
> util_ebcdic.c
> util_cfgtree.c
> util_debug.c
>
> I definitely know that these can't be moved (and should probably be
> renamed perhaps):
> util_filter.c
> util_script.c
> util_xml.c
>
> What do you think?
>
> I think the best way to do this is one file at a time.  Add it into
> apr-util, switch the symbols in all affected files (perl or
> apu_compat.h?), then remove the old version in httpd-2.0.  And, you are
> right, this certainly won't be pretty.
>
> Roy said he might have time to do this, but I'm not so sure about
> that.  =)
>
> The problem is that I really don't know how to submit patches for this.
> I can submit files that will go into apr-util, but this may be better
> off for someone with commit access to just sit down for a few hours and
> get this right.  This just touches so many files - sending so many
> patches (what I would have to do) gets burdensome and confusing.  But, I
> can do that if no one with commit access has the time.

If we are going to do this, then any function in these files can't refer
to request_rec's.  Please submit the files to the list, one at a time.  I
can commit them for you, and then we can begin to migrate the Apache calls
from the current files to the new ones.  Once the Apache calls are
migrated, we can remove the old files.

Ryan

_______________________________________________________________________________
Ryan Bloom                        	rbb@apache.org
406 29th St.
San Francisco, CA 94131
-------------------------------------------------------------------------------


Re: Moving stuff from server/util_* into apr-util?

Posted by Justin Erenkrantz <je...@ebuilt.com>.
On Thu, May 17, 2001 at 10:17:45AM -0700, Doug MacEachern wrote:
> i think the only reason it hasn't been done is because it will be somewhat
> painful.  maybe it would be worthwhile to first come up with a list of
> canidate functions/structures to move from httpd to apr-util.

Here are the three files that I definitely believe should be moved:
util_date.c (don't know what dir this would belong in)
util_uri.c (uri_delims.h, gen_uri_delims.c, etc. go into apr-util/uri)
util_md5.c (sha is already in apr-util/crypto)

I'm not sure about (bits and pieces, perhaps):
util.c
util_ebcdic.c
util_cfgtree.c
util_debug.c

I definitely know that these can't be moved (and should probably be
renamed perhaps):
util_filter.c
util_script.c
util_xml.c

What do you think?  

I think the best way to do this is one file at a time.  Add it into 
apr-util, switch the symbols in all affected files (perl or 
apu_compat.h?), then remove the old version in httpd-2.0.  And, you are 
right, this certainly won't be pretty.

Roy said he might have time to do this, but I'm not so sure about 
that.  =)

The problem is that I really don't know how to submit patches for this.
I can submit files that will go into apr-util, but this may be better
off for someone with commit access to just sit down for a few hours and
get this right.  This just touches so many files - sending so many 
patches (what I would have to do) gets burdensome and confusing.  But, I
can do that if no one with commit access has the time.

Thanks.  -- justin


Re: Moving stuff from server/util_* into apr-util?

Posted by Justin Erenkrantz <je...@ebuilt.com>.
On Thu, May 17, 2001 at 10:17:45AM -0700, Doug MacEachern wrote:
> i think the only reason it hasn't been done is because it will be somewhat
> painful.  maybe it would be worthwhile to first come up with a list of
> canidate functions/structures to move from httpd to apr-util.

Here are the three files that I definitely believe should be moved:
util_date.c (don't know what dir this would belong in)
util_uri.c (uri_delims.h, gen_uri_delims.c, etc. go into apr-util/uri)
util_md5.c (sha is already in apr-util/crypto)

I'm not sure about (bits and pieces, perhaps):
util.c
util_ebcdic.c
util_cfgtree.c
util_debug.c

I definitely know that these can't be moved (and should probably be
renamed perhaps):
util_filter.c
util_script.c
util_xml.c

What do you think?  

I think the best way to do this is one file at a time.  Add it into 
apr-util, switch the symbols in all affected files (perl or 
apu_compat.h?), then remove the old version in httpd-2.0.  And, you are 
right, this certainly won't be pretty.

Roy said he might have time to do this, but I'm not so sure about 
that.  =)

The problem is that I really don't know how to submit patches for this.
I can submit files that will go into apr-util, but this may be better
off for someone with commit access to just sit down for a few hours and
get this right.  This just touches so many files - sending so many 
patches (what I would have to do) gets burdensome and confusing.  But, I
can do that if no one with commit access has the time.

Thanks.  -- justin


Re: Moving stuff from server/util_* into apr-util?

Posted by Doug MacEachern <do...@covalent.net>.
On Wed, 16 May 2001, Justin Erenkrantz wrote:

> Hi gang,
> 
> I keep running into files (server/util_date.c, server/util_uri.c) that
> can be extremely useful outside of httpd-2.0.  What would people think
> about trying to move some of that code inside of apr-util?

i would very much like to see this happen.
apr-util/STATUS has this item:
 * populate src/uri from Apache

but there is plenty more that would be useful, such as the date stuff.
 
> mod_mbox has a private copy of util_date.c because it doesn't rely on
> being inside of the httpd-2.0 tree - think of the standalone APR-based
> programs that generate the index (I also added some fixes and made the
> date parsing more featureful).  mod_mbox.c has to be in httpd-2.0, but
> the other mod_mbox code should probably live in apr-util (if it is ever
> committed into CVS).  I've now come across a use for util_uri.c outside
> of httpd-2.0 (we're writing a load test tool here).  Again, I've created
> a private copy of the files and de-httpdified it.  It isn't too painful,
> but I'm starting to see the same pattern over and over again.

i'm in the same boat (private copy of util_uri.c and util_date.c), would
be thrilled to get out of it.
 
> A lot of work would have to be done to move this stuff into apr-util
> (try to remove any of the dependencies on the httpd-2.0 structures,
> symbol renames, API changes, build changes, etc.), but I think it is
> feasible.  I can do this in my local tree without problems, but since I
> don't have commit access, my work would go to waste unless someone with
> commit access in both APR and httpd-2.0 thinks this change (and all of
> the patches to implement this are of sufficient quality) is a good idea
> and would commit the changes.  This isn't something I want to start
> unless we agree this is the way to go.

i am willing to help test/commit/etc.
 
> This would lead to some big patches (symbol renames, etc.), but I think
> that in the long run a bunch of those files should probably be kicked
> into apr-util - it just seems the "Right Thing" to do though.  And, not
> everything would be feasible to move in (util_filter.c?), but there are
> probably enough things that are isolated enough to make this migration
> worthwhile.

i agree, the effort should be well worth it for the long run.

> Maybe I'm wrong and there are lots of reasons this hasn't been done
> before...  -- justin

i think the only reason it hasn't been done is because it will be somewhat
painful.  maybe it would be worthwhile to first come up with a list of
canidate functions/structures to move from httpd to apr-util.


Re: Moving stuff from server/util_* into apr-util?

Posted by Doug MacEachern <do...@covalent.net>.
On Wed, 16 May 2001, Justin Erenkrantz wrote:

> Hi gang,
> 
> I keep running into files (server/util_date.c, server/util_uri.c) that
> can be extremely useful outside of httpd-2.0.  What would people think
> about trying to move some of that code inside of apr-util?

i would very much like to see this happen.
apr-util/STATUS has this item:
 * populate src/uri from Apache

but there is plenty more that would be useful, such as the date stuff.
 
> mod_mbox has a private copy of util_date.c because it doesn't rely on
> being inside of the httpd-2.0 tree - think of the standalone APR-based
> programs that generate the index (I also added some fixes and made the
> date parsing more featureful).  mod_mbox.c has to be in httpd-2.0, but
> the other mod_mbox code should probably live in apr-util (if it is ever
> committed into CVS).  I've now come across a use for util_uri.c outside
> of httpd-2.0 (we're writing a load test tool here).  Again, I've created
> a private copy of the files and de-httpdified it.  It isn't too painful,
> but I'm starting to see the same pattern over and over again.

i'm in the same boat (private copy of util_uri.c and util_date.c), would
be thrilled to get out of it.
 
> A lot of work would have to be done to move this stuff into apr-util
> (try to remove any of the dependencies on the httpd-2.0 structures,
> symbol renames, API changes, build changes, etc.), but I think it is
> feasible.  I can do this in my local tree without problems, but since I
> don't have commit access, my work would go to waste unless someone with
> commit access in both APR and httpd-2.0 thinks this change (and all of
> the patches to implement this are of sufficient quality) is a good idea
> and would commit the changes.  This isn't something I want to start
> unless we agree this is the way to go.

i am willing to help test/commit/etc.
 
> This would lead to some big patches (symbol renames, etc.), but I think
> that in the long run a bunch of those files should probably be kicked
> into apr-util - it just seems the "Right Thing" to do though.  And, not
> everything would be feasible to move in (util_filter.c?), but there are
> probably enough things that are isolated enough to make this migration
> worthwhile.

i agree, the effort should be well worth it for the long run.

> Maybe I'm wrong and there are lots of reasons this hasn't been done
> before...  -- justin

i think the only reason it hasn't been done is because it will be somewhat
painful.  maybe it would be worthwhile to first come up with a list of
canidate functions/structures to move from httpd to apr-util.