]> git.evergreen-ils.org Git - OpenSRF.git/commit
Patch from Scott McKellar for declaration cleanup and improved error handling:
authormiker <miker@9efc2488-bf62-4759-914b-345cdb29e865>
Sun, 8 Jul 2007 17:40:23 +0000 (17:40 +0000)
committermiker <miker@9efc2488-bf62-4759-914b-345cdb29e865>
Sun, 8 Jul 2007 17:40:23 +0000 (17:40 +0000)
commitbeb8640692213b037a84a77ea68d7e9e59552111
tree155911c44903fa0eb81e1459b617ef29d6cd0bec
parent7309ce7b0cb8a186f35e359e63af26c525bcf391
Patch from Scott McKellar for declaration cleanup and improved error handling:

1. I added the const qualifier to several function parameters.

2. I replaced inet_addr() with inet_aton().

According to the man page, inet_addr() is obsolete.  It reports an
error by returning -1, which however is a valid IP address
(255.255.255.255).  inet_aton reports errors in a more robust way.

3. I check the return value from inet_aton().  If the input address is
invalid, I log a message and return -1.

Without such a check, an invalid listener address leads to a server
that is completely unresponsive.  The user has no way to know what's
wrong unless he spots the mistake himself in the relevant
configuration file.

git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@1013 9efc2488-bf62-4759-914b-345cdb29e865
include/opensrf/socket_bundle.h
src/libopensrf/socket_bundle.c