httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From traw...@apache.org
Subject cvs commit: httpd-2.0/modules/metadata mod_mime_magic.c
Date Mon, 19 Mar 2001 16:08:00 GMT
trawick     01/03/19 08:08:00

  Modified:    .        CHANGES
               modules/metadata mod_mime_magic.c
  Log:
  Fix a problem in mod_mime_magic where file descriptor 2 would be
  inadvertently closed.  This logic was in the uncompress child in 1.3
  but was in the parent in 2.0.
  
  uncompress_child() was renamed to create_uncompress_child() to reflect
  a change in use since 1.3.
  
  A note was added about missing 1.3 logic for doing something with the
  stderr of the uncompress process.
  
  Revision  Changes    Path
  1.137     +3 -0      httpd-2.0/CHANGES
  
  Index: CHANGES
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/CHANGES,v
  retrieving revision 1.136
  retrieving revision 1.137
  diff -u -r1.136 -r1.137
  --- CHANGES	2001/03/18 02:33:19	1.136
  +++ CHANGES	2001/03/19 16:07:56	1.137
  @@ -1,5 +1,8 @@
   Changes with Apache 2.0.15-dev
   
  +  *) Get rid of an inadvertent close of file descriptor 2 in
  +     mod_mime_magic.  [Greg Ames, Jeff Trawick]
  +
     *) Add a hook, create_request.  This hook allows modules to modify
        a request while it is being created.  This hook is called for all
        request_rec's, main request, sub request, and internal redirect.
  
  
  
  1.43      +9 -7      httpd-2.0/modules/metadata/mod_mime_magic.c
  
  Index: mod_mime_magic.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/modules/metadata/mod_mime_magic.c,v
  retrieving revision 1.42
  retrieving revision 1.43
  diff -u -r1.42 -r1.43
  --- mod_mime_magic.c	2001/02/16 04:26:41	1.42
  +++ mod_mime_magic.c	2001/03/19 16:07:59	1.43
  @@ -2147,8 +2147,8 @@
       int method;
   };
   
  -static int uncompress_child(struct uncompress_parms *parm, apr_pool_t *cntxt,
  -                            apr_file_t **pipe_in)
  +static int create_uncompress_child(struct uncompress_parms *parm, apr_pool_t *cntxt,
  +                                   apr_file_t **pipe_in)
   {
       int rc = 1;
       const char *new_argv[4];
  @@ -2158,6 +2158,12 @@
       apr_procattr_t *procattr;
       apr_proc_t *procnew;
   
  +    /* XXX missing 1.3 logic: 
  +     *
  +     * what happens when !compr[parm->method].silent?
  +     * Should we create the err pipe, read it, and copy to the log?
  +     */
  +        
       env = (const char *const *)ap_create_environment(child_context, r->subprocess_env);
   
       if ((apr_procattr_create(&procattr, child_context) != APR_SUCCESS) ||
  @@ -2175,10 +2181,6 @@
           new_argv[2] = r->filename;
           new_argv[3] = NULL;
   
  -        if (compr[parm->method].silent) {
  -            close(STDERR_FILENO);
  -        }
  -
           procnew = apr_pcalloc(child_context, sizeof(*procnew));
           rc = apr_proc_create(procnew, compr[parm->method].argv[0],
                                  new_argv, env, procattr, child_context);
  @@ -2216,7 +2218,7 @@
       if (apr_pool_create(&sub_context, r->pool) != APR_SUCCESS)
           return -1;
   
  -    if ((rv = uncompress_child(&parm, sub_context, &pipe_out)) != APR_SUCCESS)
{
  +    if ((rv = create_uncompress_child(&parm, sub_context, &pipe_out)) != APR_SUCCESS)
{
   	ap_log_rerror(APLOG_MARK, APLOG_ERR, rv, r,
   		    MODNAME ": couldn't spawn uncompress process: %s", r->uri);
   	return -1;
  
  
  

Mime
View raw message