Re: Pointless memset(...) in httpAccept()

From: Henrik Nordstrom <hno@dont-contact.us>
Date: Thu, 10 Dec 1998 23:40:25 +0100

David Luyer wrote:
>
> while (max-- && !httpAcceptDefer()) {
> memset(&peer, '\0', sizeof(struct sockaddr_in));
> memset(&me, '\0', sizeof(struct sockaddr_in));
> if ((fd = comm_accept(sock, &peer, &me)) < 0) {

> The values of 'peer' and 'me' will be completely overwritten
> in comm_accept if comm_accept returns >= 0, and if it is <= 0
> then they are not used in httpAccept(). So the memset()s are a
> waste of cycles.

Surroround them with
#if DEBUG
or something similar, but keep them.

/Henrik
Received on Tue Jul 29 2003 - 13:15:55 MDT

This archive was generated by hypermail pre-2.1.9 : Tue Dec 09 2003 - 16:12:01 MST