httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dean Gaudet <>
Subject Re: pre-patch: struct sockaddr_in error messages
Date Fri, 24 Oct 1997 23:08:56 GMT
Yes I want to remove HAVE_SNPRINTF.  And I'll even rename ap_snprintf if
that's what you guys want.  Given that *we* don't define HAVE_SNPRINTF
anywhere, this is safe.  ap_snprintf works on all of our architectures now
otherwise we'd have heard the problem reports I'm sure.  If it has a
problem on some architecture, then that's not an architecture we currently
support, and the port for it will have to fix the problem. 

There's no reason for us not to do things like this, and there's a lot of
reason to do stuff like this.  In my past experience, extending the
printf() family leads to more informative error messages because it's
trivial to format your internal structures in a consistent way.

I disagree with making this another flag to aplog_error for the exact same
reasons that I don't like aplog_error in the first place -- it assumes it
knows far more about what you're doing than you do.  What happens when I
want to print two addresses in an error message?  Say I want to print the
proxy local and remote addresses?  Or say I want to print
r->connection->local_addr?  What, add another 3 flags? 


On Fri, 24 Oct 1997, Marc Slemko wrote:

> On Thu, 23 Oct 1997, Dean Gaudet wrote:
> > We've got a few PRs on file asking for client addresses in various error
> > messages.  They're quite reasonable requests.  I'd hoped we'd get this
> > in way long ago as part of the error log cleanup.
> > 
> > This patch adds two extensions to ap_snprintf:
> >     %S takes a struct sockaddr_in and prints it a.b.c.d:port
> >     %A takes a struct sockaddr_in and prints it a.b.c.d
> Be warned that this breaks the concept of HAVE_SNPRINTF completely, and
> places that define it (eg. FreeBSD port) will fall over and die and print
> garbage.  If you do this, you need to yank out all the HAVE_SNPRINTF
> stuff.  That means if there ever is anywhere that has snprintf but ours 
> is broken for some reason, they are dead.

View raw message