Pointless memset(...) in httpAccept()

From: David Luyer <luyer@dont-contact.us>
Date: Wed, 9 Dec 1998 13:24:02 +0800

    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) {
            if (!ignoreErrno(errno))
                debug(50, 1) ("httpAccept: FD %d: accept failure: %s\n",
                    sock, xstrerror());
            break;
        }

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.

David.
Received on Tue Jul 29 2003 - 13:15:54 MDT

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