httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Justin Erenkrantz <jerenkra...@apache.org>
Subject Re: cvs commit: apache-1.3/src/main alloc.c http_log.c
Date Sun, 08 Dec 2002 20:00:39 GMT
--On Sunday, December 8, 2002 7:09 PM +0000 jim@apache.org wrote:

>   @@ -1691,6 +1693,18 @@
>        c->child_cleanup = child_cleanup;
>        c->next = p->cleanups;
>        p->cleanups = c;
>   +    if(magic_cleanup) {
>   +	if(!magic_cleanup(data))
>   +	   ap_log_error(APLOG_MARK, APLOG_WARNING, NULL,
>   +		 "exec() may not be safe");
>   +    }
>   +}

Your editor seems to have been tab-happy.

>   +API_EXPORT(void) ap_note_cleanups_for_fd_ex(pool *p, int fd, int
> domagic)
>   +{
>   +    if (domagic) {
>   +        ap_register_cleanup_ex(p, (void *) (long) fd,
> fd_cleanup, fd_cleanup,
>   +			 fd_magic_cleanup);
>   +    } else {
>   +	/* basically ap_register_cleanup but save the possible
>   +	   overhead of an extraneous function call */
>   +        ap_register_cleanup_ex(p, (void *) (long) fd,
> fd_cleanup, fd_cleanup,
>   +			 NULL);
>   +    }
>   +}

Would it be better to simplify as:

ap_register_cleanup_ex(p, (void *) (long) fd, fd_cleanup, fd_cleanup, 
domagic ? fd_magic_cleanup : NULL);

(Appears several other places, too.)

>    API_EXPORT(void) ap_kill_cleanups_for_socket(pool *p, int sock)
>   @@ -2603,19 +2681,19 @@
>
>        if (pipe_out) {
>    	*pipe_out = ap_bcreate(p, B_RD);
>   -	ap_note_cleanups_for_fd(p, fd_out);
>   +	ap_note_cleanups_for_fd_ex(p, fd_out, 0);

Why switch this?  Wouldn't it have been the same thing, or are you 
trying to save extra function calls whereever possible?  -- justin

Mime
View raw message