/ Zope / Apsis / Pound Mailing List / Archive / 2006 / 2006-08 / Improve correctness and code quality for Pound

[ << ] [ >> ]

[ Pound 2.1 and fail-over host? / "Steve ... ] [ Check multi-threading implementation for ... ]

Improve correctness and code quality for Pound
SF Markus Elfring <elfring(at)users.sourceforge.net>
2006-08-31 17:57:42 [ FULL ]

I  have looked at the source code from the package 
I have detected several open 
issues that should be corrected.

1. "pound.c":
1.1 The return values from calls to the functions "pthread_mutex_..." 
are ignored. Please complete your error handling.

1.2 Can the parameter "file" be omitted from the function "l_lock"? (It 
is currently not used there.)

1.3 Would you like to prefer an unsigned integral type for index "n"?

1.4 The function "logmsg" is called by your signal handler "h_term". It 
calls several functions that do not belong to the list of 
async-*signal*-safe functions.
(See section "2.4.3 *Signal* Actions" from the document " 2.4 *Signal* 

How do you think about to delete the line for the log message?

1.5 The instruction "sleep(2)" in the function "main" looks like an 
incomplete approach for me. Can this wait be avoided if the service 
threads will notify (e. g. use of condition variables) the main thread 
that they are ready for real work?

2. "svc.c":
2.1 How do you think about the topic 
I suggest to add the key word "const" to the type specifiers of 
parameters like the following.
- priority, fmt (function "logmsg")
- header (function "check_header")

2.2 Please do not ignore return values. Would you like to try the tool 
"http://splint.org/" for such checking?

2.3 I have got doubts that the function "thr_resurect" is completely 
thread-safe because of different lock scopes.

Markus Elfring

Re: [Pound Mailing List] Improve correctness and code quality for Pound
Ted Dunning <tdunning(at)veoh.com>
2006-08-31 19:05:54 [ FULL ]
I am sure that the pound implementors would be much happier to receive
suggested patches rather than directives.  Remember, they are GIVING you
software.  Giving something back would be a nice thing to do.

On 8/31/06 8:57 AM, "SF Markus Elfring"