You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Colm MacCarthaigh <co...@stdlib.net> on 2005/10/21 23:10:51 UTC

APR version of support/logresolve.c

support/logresolve doesn't support IPv6 addresses, which is a pain,
because while logresolve is not a brilliant log resolver, it's useful
for putting at the end of brief command lines, grepping things and so
on.

Anyway;

	http://people.apache.org/~colm/logresolve.c

is an APR version, it's also a lot shorter than the current version.

This version of logresolve is not 100% compatible with the current
one. It has different statistical output. stats look like;

	logresolve Statistics:
	Entries: 66022
	    With name   : 0
	    Resolves    : 5
	    - No reverse : 3
	Cache hits      : 66017
	Cache size      : 5  

Compared to;

	logresolve Statistics:
	Entries: 66022
    	    With name   : 589
	    Resolves    : 65433
	    - Not found : 2
	Cache hits      : 65430
	Cache size      : 3
	Cache buckets   :     IP number * hostname
	  128        127.0.0.1 - localhost.localdomain
	  172      193.1.228.6 : Host not found
	  232     193.1.228.66 : Host not found

Bolting on the existing method wouldn't really fly when using APR, it
would eat far too much memory (an average of 22 bytes per line in the
log). 

Apart from that, it's functionally identical, and the changes should be
well within minor-version-bump territory. It does introduce a dependency 
on APR 1.3 though, so no plans to backport it to 2.2.x any time soon.

Unless there are any objections, I'd like to commit this sometime in the
next few days.

-- 
Colm MacCárthaigh                        Public Key: colm+pgp@stdlib.net

Re: APR version of support/logresolve.c

Posted by Colm MacCarthaigh <co...@stdlib.net>.
On Mon, Oct 24, 2005 at 06:16:14PM +0200, Joost de Heer wrote:
> >Looks good; some nits:
> >
> >- odd style in places, some "if("/"while(" without enough whitespace
> >and declarations with too much whitespace:
> >  apr_file_t         * etc;
> 
> Is there an indent command line overview for 'ASF approved coding'?

Yes, it's at;

	http://httpd.apache.org/dev/styleguide.html

It doesn't cover quite everything though. There are two common
multi-mine comment formats, for example.

-- 
Colm MacCárthaigh                        Public Key: colm+pgp@stdlib.net

Re: APR version of support/logresolve.c

Posted by Sander Temme <sc...@apache.org>.
On Oct 24, 2005, at 9:16 AM, Joost de Heer wrote:


>> Looks good; some nits:
>> - odd style in places, some "if("/"while(" without enough whitespace
>> and declarations with too much whitespace:
>>   apr_file_t         * etc;
>>
>>
>
> Is there an indent command line overview for 'ASF approved coding'?
>

We have:

http://httpd.apache.org/dev/styleguide.html

There are also .indent.pro files in most of the httpd tree, and even  
some emacs-style macros.

Of course these resources may not agree with each other... it's  
generally best to not put indentation changes and code changes in the  
same patch.

S.

-- 
sander@temme.net              http://www.temme.net/sander/
PGP FP: 51B4 8727 466A 0BC3 69F4  B7B8 B2BE BC40 1529 24AF



Re: APR version of support/logresolve.c

Posted by Joost de Heer <jo...@sanguis.xs4all.nl>.
> Looks good; some nits:
> 
> - odd style in places, some "if("/"while(" without enough whitespace
> and declarations with too much whitespace:
>   apr_file_t         * etc;

Is there an indent command line overview for 'ASF approved coding'?

Joost

Re: APR version of support/logresolve.c

Posted by Colm MacCarthaigh <co...@stdlib.net>.
On Mon, Oct 24, 2005 at 12:58:21PM +0100, Joe Orton wrote:
> - odd style in places, some "if("/"while(" without enough whitespace

Ahh that old habit.

> and declarations with too much whitespace:
>   apr_file_t         * etc;

This comes directly from the old logresolve.c.  Didn't want to change
absolutely everything ;-) But I'll make consistent and less wasteful.

> - apr_hash_* can use APR_HASH_KEY_STRING rather than strlen(key)
> - odd casts to/from (const void *) in hash handling which shouldn't
> be necessary?

No, they're not. I've forgotten why I even have them. Thanks for
spotting them.

-- 
Colm MacCárthaigh                        Public Key: colm+pgp@stdlib.net

Re: APR version of support/logresolve.c

Posted by Joe Orton <jo...@redhat.com>.
On Fri, Oct 21, 2005 at 10:10:51PM +0100, Colm MacCarthaigh wrote:
> support/logresolve doesn't support IPv6 addresses, which is a pain,
> because while logresolve is not a brilliant log resolver, it's useful
> for putting at the end of brief command lines, grepping things and so
> on.
> 
> Anyway;
> 
> 	http://people.apache.org/~colm/logresolve.c
> 
> is an APR version, it's also a lot shorter than the current version.

Looks good; some nits:

- odd style in places, some "if("/"while(" without enough whitespace
and declarations with too much whitespace:
  apr_file_t         * etc;

- apr_hash_* can use APR_HASH_KEY_STRING rather than strlen(key)
- odd casts to/from (const void *) in hash handling which shouldn't
be necessary?

joe

Re: APR version of support/logresolve.c

Posted by Dirk-Willem van Gulik <di...@webweaving.org>.

On Fri, 21 Oct 2005, Colm MacCarthaigh wrote:

> 	http://people.apache.org/~colm/logresolve.c

I'd love to see this going in !

Dw.