httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From traw...@locus.apache.org
Subject cvs commit: apache-2.0/src/main http_log.c
Date Tue, 20 Jun 2000 19:36:56 GMT
trawick     00/06/20 12:36:54

  Modified:    src      CHANGES
               src/lib/apr/file_io/os2 pipe.c
               src/lib/apr/file_io/unix filedup.c fileio.h open.c pipe.c
               src/lib/apr/include apr_file_io.h
               src/lib/apr/threadproc/beos proc.c
               src/lib/apr/threadproc/os2 proc.c
               src/lib/apr/threadproc/unix proc.c
               src/lib/apr/threadproc/win32 proc.c
               src/main http_log.c
  Log:
  ap_create_pipe was changed to return a pipe with both handles
  blocking (previously, both handles were non-blocking).
  
  ap_set_pipe_timeout() is now the only way to manipulate the
  blocking state of the pipe.  Pass -1 for timeout to make it
  blocking; pass 0 for timeout to make it non-blocking.
  
  ap_block_pipe() is gone.
  
  A few minor bugs were fixed along the way.
  
  OS-specific notes:
  
  non-Unix in general:
  
  Only Unix/BeOS currently has the optimization to keep track of the blocking
  state.  This is used to avoid syscalls as well as to handle ap_put_os_file(),
  which is a case where we don't know the blocking state of the handle we are
  given.
  
  OS/2:
  
  ap_set_pipe_timeout() with timeout value > 0: The code didn't play with
  the blocking state before and it doesn't still.  I did add logic for special
  timeout values 0 and -1 to play with the blocking state.
  
  ap_create_pipe():  old logic didn't do anything with the blocking state
  of the second handle; it still doesn't; hopefully it is blocking
  
  pre-BONE BEOS:
  
  old code to make a pipe non-blocking was a no-op; now it returns
  APR_ENOTIMPL
  
  BONE: old code to make a pipe non-blocking; it passed &zero as the
  parm to FIONBIO instead of &one; this bug was fixed
  
  Win32:
  
  The pipe was always created blocking before; no change
  
  previously, ap_setprocattr_io() ignored the blocking flag; now it
  respects it like other platforms and calls ap_set_pipe_timeout(p,0)
  on appropriate pipe handles (Bill Stoddard was just working in
  ap_set_pipe_timeout(), so I presume this is golden)
  
  Revision  Changes    Path
  1.163     +5 -0      apache-2.0/src/CHANGES
  
  Index: CHANGES
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/CHANGES,v
  retrieving revision 1.162
  retrieving revision 1.163
  diff -u -r1.162 -r1.163
  --- CHANGES	2000/06/20 19:30:26	1.162
  +++ CHANGES	2000/06/20 19:36:17	1.163
  @@ -1,4 +1,9 @@
   Changes with Apache 2.0a5
  +  *) ap_create_pipe() now leaves pipes in blocking state.  (This helps 
  +     reduce the number of syscalls on Unix.)  ap_set_pipe_timeout() is
  +     now the way that the blocking state of a pipe is manipulated.
  +     ap_block_pipe() is gone.  [Jeff Trawick]
  +
     *) Correct the problem where the only local host name that the IP stack
        can discover are 'undotted' private names.  If no fully qualified
        domain name can be identified, the default ServerName will be set to
  
  
  
  1.22      +7 -7      apache-2.0/src/lib/apr/file_io/os2/pipe.c
  
  Index: pipe.c
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/lib/apr/file_io/os2/pipe.c,v
  retrieving revision 1.21
  retrieving revision 1.22
  diff -u -r1.21 -r1.22
  --- pipe.c	2000/06/17 17:04:16	1.21
  +++ pipe.c	2000/06/20 19:36:21	1.22
  @@ -68,7 +68,7 @@
       char pipename[50];
   
       sprintf(pipename, "/pipe/%d.%d", getpid(), id++);
  -    rc = DosCreateNPipe(pipename, filedes, NP_ACCESS_INBOUND, NP_NOWAIT|1, 4096, 4096,
0);
  +    rc = DosCreateNPipe(pipename, filedes, NP_ACCESS_INBOUND, 1, 4096, 4096, 0);
   
       if (rc)
           return APR_OS2_STATUS(rc);
  @@ -146,13 +146,13 @@
   {
       if (thepipe->pipe == 1) {
           thepipe->timeout = timeout;
  +        if (thepipe->timeout == 0) {
  +            return APR_OS2_STATUS(DosSetNPHState (thepipe->filedes, NP_NOWAIT));
  +        }
  +        else if (thepipe->timeout == -1) {
  +            return APR_OS2_STATUS(DosSetNPHState (thepipe->filedes, NP_WAIT));
  +        }
           return APR_SUCCESS;
       }
       return APR_EINVAL;
  -}
  -
  -
  -ap_status_t ap_block_pipe(ap_file_t *thepipe)
  -{
  -    return APR_OS2_STATUS(DosSetNPHState (thepipe->filedes, NP_WAIT));
   }
  
  
  
  1.23      +1 -0      apache-2.0/src/lib/apr/file_io/unix/filedup.c
  
  Index: filedup.c
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/lib/apr/file_io/unix/filedup.c,v
  retrieving revision 1.22
  retrieving revision 1.23
  diff -u -r1.22 -r1.23
  --- filedup.c	2000/06/18 02:38:51	1.22
  +++ filedup.c	2000/06/20 19:36:21	1.23
  @@ -84,6 +84,7 @@
   #endif
           (*new_file)->buffer = ap_palloc(p, APR_FILE_BUFSIZE);
       }
  +    (*new_file)->blocking = old_file->blocking; /* this is the way dup() works */
       ap_register_cleanup((*new_file)->cntxt, (void *)(*new_file), ap_unix_file_cleanup,
                           ap_null_cleanup);
       return APR_SUCCESS;
  
  
  
  1.22      +1 -0      apache-2.0/src/lib/apr/file_io/unix/fileio.h
  
  Index: fileio.h
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/lib/apr/file_io/unix/fileio.h,v
  retrieving revision 1.21
  retrieving revision 1.22
  diff -u -r1.21 -r1.22
  --- fileio.h	2000/06/13 16:30:39	1.21
  +++ fileio.h	2000/06/20 19:36:24	1.22
  @@ -117,6 +117,7 @@
       int pipe;
       ap_interval_time_t timeout;
       int buffered;
  +    enum {BLK_UNKNOWN, BLK_OFF, BLK_ON } blocking;
       int ungetchar;    /* Last char provided by an unget op. (-1 = no char)*/
   
       /* Stuff for buffered mode */
  
  
  
  1.58      +3 -0      apache-2.0/src/lib/apr/file_io/unix/open.c
  
  Index: open.c
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/lib/apr/file_io/unix/open.c,v
  retrieving revision 1.57
  retrieving revision 1.58
  diff -u -r1.57 -r1.58
  --- open.c	2000/06/18 16:28:55	1.57
  +++ open.c	2000/06/20 19:36:24	1.58
  @@ -107,6 +107,7 @@
   
       (*new)->fname = ap_pstrdup(cont, fname);
   
  +    (*new)->blocking = BLK_ON;
       (*new)->buffered = (flag & APR_BUFFERED) > 0;
   
       if ((*new)->buffered) {
  @@ -211,6 +212,7 @@
       }
       (*file)->eof_hit = 0;
       (*file)->buffered = 0;
  +    (*file)->blocking = BLK_UNKNOWN; /* in case it is a pipe */
       (*file)->timeout = -1;
       (*file)->filedes = *dafile;
       /* buffer already NULL; 
  @@ -247,6 +249,7 @@
       (*thefile)->filedes = STDERR_FILENO;
       (*thefile)->cntxt = cont;
       (*thefile)->buffered = 0;
  +    (*thefile)->blocking = BLK_UNKNOWN;
       (*thefile)->fname = NULL;
       (*thefile)->eof_hit = 0;
   
  
  
  
  1.35      +54 -36    apache-2.0/src/lib/apr/file_io/unix/pipe.c
  
  Index: pipe.c
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/lib/apr/file_io/unix/pipe.c,v
  retrieving revision 1.34
  retrieving revision 1.35
  diff -u -r1.34 -r1.35
  --- pipe.c	2000/06/17 17:04:16	1.34
  +++ pipe.c	2000/06/20 19:36:25	1.35
  @@ -54,6 +54,42 @@
   
   #include "fileio.h"
   
  +static ap_status_t pipeblock(ap_file_t *thepipe)
  +{
  +#if !BEOS /* this code won't work on BeOS */
  +      int fd_flags;
  +
  +      fd_flags = fcntl(thepipe->filedes, F_GETFL, 0);
  +  #if defined(O_NONBLOCK)
  +      fd_flags &= ~O_NONBLOCK;
  +  #elif defined(~O_NDELAY)
  +      fd_flags &= ~O_NDELAY;
  +  #elif defined(FNDELAY)
  +      fd_flags &= ~O_FNDELAY;
  +  #else 
  +      /* XXXX: this breaks things, but an alternative isn't obvious...*/
  +      return APR_ENOTIMPL;
  +  #endif
  +    if (fcntl(thepipe->filedes, F_SETFL, fd_flags) == -1) {
  +        return errno;
  +    }
  +
  +#else
  +
  +#if BEOS_BONE /* This only works on BONE or beyond */
  +    int on = 0;
  +    if (ioctl(thepipe->filedes, FIONBIO, &on, sizeof(on)) < 0)
  +        return errno;
  +#else /* BEOS_BONE */
  +    return APR_ENOTIMPL;
  +#endif /* BEOS_BONE */
  + 
  +#endif /* !BEOS_R5 */
  +
  +    thepipe->blocking = BLK_ON;
  +    return APR_SUCCESS;
  +}
  +
   static ap_status_t pipenonblock(ap_file_t *thepipe)
   {
   #if !BEOS /* this code won't work on BeOS */
  @@ -67,7 +103,7 @@
         fd_flags |= O_FNDELAY;
     #else
         /* XXXX: this breaks things, but an alternative isn't obvious...*/
  -      return -1;
  +      return APR_ENOTIMPL;
     #endif
         if (fcntl(thepipe->filedes, F_SETFL, fd_flags) == -1) {
             return errno;
  @@ -76,12 +112,16 @@
   #else /* !BEOS */
   
   #if BEOS_BONE /* This only works on BONE and later...*/
  -    int on = 0;
  +    int on = 1;
       if (ioctl(thepipe->filedes, FIONBIO, &on, sizeof(on)) < 0)
           return errno;
  +#else /* BEOS_BONE */
  +    return APR_ENOTIMPL;
   #endif /* BEOS_BONE */
   
   #endif /* !BEOS */
  +
  +    thepipe->blocking = BLK_OFF;
       return APR_SUCCESS;
   }
   
  @@ -89,6 +129,16 @@
   {
       if (thepipe->pipe == 1) {
           thepipe->timeout = timeout;
  +        if (timeout >= 0) {
  +            if (thepipe->blocking != BLK_OFF) { /* blocking or unknown state */
  +                return pipenonblock(thepipe);
  +            }
  +        }
  +        else {
  +            if (thepipe->blocking != BLK_ON) { /* non-blocking or unknown state */
  +                return pipeblock(thepipe);
  +            }
  +        }
           return APR_SUCCESS;
       }
       return APR_EINVAL;
  @@ -108,6 +158,7 @@
       (*in)->pipe = 1;
       (*in)->fname = ap_pstrdup(cont, "PIPE");
       (*in)->buffered = 0;
  +    (*in)->blocking = BLK_ON;
       (*in)->timeout = -1;
       (*in)->ungetchar = -1;
   #if APR_HAS_THREADS
  @@ -120,14 +171,12 @@
       (*out)->pipe = 1;
       (*out)->fname = ap_pstrdup(cont, "PIPE");
       (*out)->buffered = 0;
  +    (*out)->blocking = BLK_ON;
       (*out)->timeout = -1;
   #if APR_HAS_THREADS
       (*in)->thlock = NULL;
   #endif
   
  -    pipenonblock(*in);
  -    pipenonblock(*out);
  -
       return APR_SUCCESS;
   }
   
  @@ -142,36 +191,5 @@
       return APR_SUCCESS;
   } 
   
  -ap_status_t ap_block_pipe(ap_file_t *thepipe)
  -{
  -#if !BEOS /* this code won't work on BeOS */
  -      int fd_flags;
  -
  -      fd_flags = fcntl(thepipe->filedes, F_GETFL, 0);
  -  #if defined(O_NONBLOCK)
  -      fd_flags &= ~O_NONBLOCK;
  -  #elif defined(~O_NDELAY)
  -      fd_flags &= ~O_NDELAY;
  -  #elif defined(FNDELAY)
  -      fd_flags &= ~O_FNDELAY;
  -  #else 
  -      /* XXXX: this breaks things, but an alternative isn't obvious...*/
  -      return -1;
  -  #endif
  -    if (fcntl(thepipe->filedes, F_SETFL, fd_flags) == -1) {
  -        return errno;
  -    }
  -
  -#else
  -
  -#if BEOS_BONE /* This only works on BONE or beyond */
  -    int on = 0;
  -    if (ioctl(thepipe->filedes, FIONBIO, &on, sizeof(on)) < 0)
  -        return errno;
  -#endif /* BEOS_BONE */
  - 
  -#endif /* !BEOS_R5 */
  -    return APR_SUCCESS;
  -}
       
   
  
  
  
  1.57      +1 -13     apache-2.0/src/lib/apr/include/apr_file_io.h
  
  Index: apr_file_io.h
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/lib/apr/include/apr_file_io.h,v
  retrieving revision 1.56
  retrieving revision 1.57
  diff -u -r1.56 -r1.57
  --- apr_file_io.h	2000/06/19 00:45:40	1.56
  +++ apr_file_io.h	2000/06/20 19:36:33	1.57
  @@ -572,7 +572,7 @@
   
   =head1 ap_status_t ap_set_pipe_timeout(ap_file_t *thepipe, ap_interval_time_t timeout)
   
  -B<Set the timeout value for a pipe.>
  +B<Set the timeout value for a pipe or manipulate the blocking state.>
   
       arg 1) The pipe we are setting a timeout on.
       arg 2) The timeout value in microseconds.  Values < 0 mean wait forever, 0
  @@ -581,18 +581,6 @@
   =cut
    */
   ap_status_t ap_set_pipe_timeout(ap_file_t *thepipe, ap_interval_time_t timeout);
  -
  -/*
  -
  -=head1 ap_status_t ap_block_pipe(ap_file_t *thepipe)
  -
  -B<Set a pipe to use blocking I/O.>
  -
  -    arg 1) The pipe to operate on.
  -
  -=cut
  - */
  -ap_status_t ap_block_pipe(ap_file_t *thepipe);
   
   /*accessor and general file_io functions. */
   
  
  
  
  1.28      +24 -12    apache-2.0/src/lib/apr/threadproc/beos/proc.c
  
  Index: proc.c
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/lib/apr/threadproc/beos/proc.c,v
  retrieving revision 1.27
  retrieving revision 1.28
  diff -u -r1.27 -r1.28
  --- proc.c	2000/06/17 11:11:40	1.27
  +++ proc.c	2000/06/20 19:36:36	1.28
  @@ -92,12 +92,16 @@
           }
           switch (in) {
           case APR_FULL_BLOCK:
  -            ap_block_pipe(attr->child_in);
  -            ap_block_pipe(attr->parent_in);
  +            break;
           case APR_PARENT_BLOCK:
  -            ap_block_pipe(attr->parent_in);
  +            ap_set_pipe_timeout(attr->child_in, 0);
  +            break;
           case APR_CHILD_BLOCK:
  -            ap_block_pipe(attr->child_in);
  +            ap_set_pipe_timeout(attr->parent_in, 0);
  +            break;
  +        default:
  +            ap_set_pipe_timeout(attr->child_in, 0);
  +            ap_set_pipe_timeout(attr->parent_in, 0);
           }
       } 
       if (out) {
  @@ -107,12 +111,16 @@
           }
           switch (out) {
           case APR_FULL_BLOCK:
  -            ap_block_pipe(attr->child_out);
  -            ap_block_pipe(attr->parent_out);
  +            break;
           case APR_PARENT_BLOCK:
  -            ap_block_pipe(attr->parent_out);
  +            ap_set_pipe_timeout(attr->child_out, 0);
  +            break;
           case APR_CHILD_BLOCK:
  -            ap_block_pipe(attr->child_out);
  +            ap_set_pipe_timeout(attr->parent_out, 0);
  +            break;
  +        default:
  +            ap_set_pipe_timeout(attr->child_out, 0);
  +            ap_set_pipe_timeout(attr->parent_out, 0);
           }
       } 
       if (err) {
  @@ -122,12 +130,16 @@
           }
           switch (err) {
           case APR_FULL_BLOCK:
  -            ap_block_pipe(attr->child_err);
  -            ap_block_pipe(attr->parent_err);
  +            break;
           case APR_PARENT_BLOCK:
  -            ap_block_pipe(attr->parent_err);
  +            ap_set_pipe_timeout(attr->child_err, 0);
  +            break;
           case APR_CHILD_BLOCK:
  -            ap_block_pipe(attr->child_err);
  +            ap_set_pipe_timeout(attr->parent_err, 0);
  +            break;
  +        default:
  +            ap_set_pipe_timeout(attr->child_err, 0);
  +            ap_set_pipe_timeout(attr->parent_err, 0);
           }
       } 
       return APR_SUCCESS;
  
  
  
  1.25      +24 -12    apache-2.0/src/lib/apr/threadproc/os2/proc.c
  
  Index: proc.c
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/lib/apr/threadproc/os2/proc.c,v
  retrieving revision 1.24
  retrieving revision 1.25
  diff -u -r1.24 -r1.25
  --- proc.c	2000/05/25 03:05:27	1.24
  +++ proc.c	2000/06/20 19:36:42	1.25
  @@ -103,12 +103,16 @@
           }
           switch (in) {
           case APR_FULL_BLOCK:
  -            ap_block_pipe(attr->child_in);
  -            ap_block_pipe(attr->parent_in);
  +            break;
           case APR_PARENT_BLOCK:
  -            ap_block_pipe(attr->parent_in);
  +            ap_set_pipe_timeout(attr->child_in, 0);
  +            break;
           case APR_CHILD_BLOCK:
  -            ap_block_pipe(attr->child_in);
  +            ap_set_pipe_timeout(attr->parent_in, 0);
  +            break;
  +        default:
  +            ap_set_pipe_timeout(attr->child_in, 0);
  +            ap_set_pipe_timeout(attr->parent_in, 0);
           }
       } 
       if (out) {
  @@ -118,12 +122,16 @@
           }
           switch (out) {
           case APR_FULL_BLOCK:
  -            ap_block_pipe(attr->child_out);
  -            ap_block_pipe(attr->parent_out);
  +            break;
           case APR_PARENT_BLOCK:
  -            ap_block_pipe(attr->parent_out);
  +            ap_set_pipe_timeout(attr->child_out, 0);
  +            break;
           case APR_CHILD_BLOCK:
  -            ap_block_pipe(attr->child_out);
  +            ap_set_pipe_timeout(attr->parent_out, 0);
  +            break;
  +        default:
  +            ap_set_pipe_timeout(attr->child_out, 0);
  +            ap_set_pipe_timeout(attr->parent_out, 0);
           }
       } 
       if (err) {
  @@ -133,12 +141,16 @@
           }
           switch (err) {
           case APR_FULL_BLOCK:
  -            ap_block_pipe(attr->child_err);
  -            ap_block_pipe(attr->parent_err);
  +            break;
           case APR_PARENT_BLOCK:
  -            ap_block_pipe(attr->parent_err);
  +            ap_set_pipe_timeout(attr->child_err, 0);
  +            break;
           case APR_CHILD_BLOCK:
  -            ap_block_pipe(attr->child_err);
  +            ap_set_pipe_timeout(attr->parent_err, 0);
  +            break;
  +        default:
  +            ap_set_pipe_timeout(attr->child_err, 0);
  +            ap_set_pipe_timeout(attr->parent_err, 0);
           }
       } 
       return APR_SUCCESS;
  
  
  
  1.32      +24 -12    apache-2.0/src/lib/apr/threadproc/unix/proc.c
  
  Index: proc.c
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/lib/apr/threadproc/unix/proc.c,v
  retrieving revision 1.31
  retrieving revision 1.32
  diff -u -r1.31 -r1.32
  --- proc.c	2000/06/20 19:16:11	1.31
  +++ proc.c	2000/06/20 19:36:44	1.32
  @@ -78,12 +78,16 @@
           }
           switch (in) {
           case APR_FULL_BLOCK:
  -            ap_block_pipe(attr->child_in);
  -            ap_block_pipe(attr->parent_in);
  +            break;
           case APR_PARENT_BLOCK:
  -            ap_block_pipe(attr->parent_in);
  +            ap_set_pipe_timeout(attr->child_in, 0);
  +            break;
           case APR_CHILD_BLOCK:
  -            ap_block_pipe(attr->child_in);
  +            ap_set_pipe_timeout(attr->parent_in, 0);
  +            break;
  +        default:
  +            ap_set_pipe_timeout(attr->child_in, 0);
  +            ap_set_pipe_timeout(attr->parent_in, 0);
           }
       } 
       if (out) {
  @@ -93,12 +97,16 @@
           }
           switch (out) {
           case APR_FULL_BLOCK:
  -            ap_block_pipe(attr->child_out);
  -            ap_block_pipe(attr->parent_out);
  +            break;
           case APR_PARENT_BLOCK:
  -            ap_block_pipe(attr->parent_out);
  +            ap_set_pipe_timeout(attr->child_out, 0);
  +            break;
           case APR_CHILD_BLOCK:
  -            ap_block_pipe(attr->child_out);
  +            ap_set_pipe_timeout(attr->parent_out, 0);
  +            break;
  +        default:
  +            ap_set_pipe_timeout(attr->child_out, 0);
  +            ap_set_pipe_timeout(attr->parent_out, 0);
           }
       } 
       if (err) {
  @@ -108,12 +116,16 @@
           }
           switch (err) {
           case APR_FULL_BLOCK:
  -            ap_block_pipe(attr->child_err);
  -            ap_block_pipe(attr->parent_err);
  +            break;
           case APR_PARENT_BLOCK:
  -            ap_block_pipe(attr->parent_err);
  +            ap_set_pipe_timeout(attr->child_err, 0);
  +            break;
           case APR_CHILD_BLOCK:
  -            ap_block_pipe(attr->child_err);
  +            ap_set_pipe_timeout(attr->parent_err, 0);
  +            break;
  +        default:
  +            ap_set_pipe_timeout(attr->child_err, 0);
  +            ap_set_pipe_timeout(attr->parent_err, 0);
           }
       } 
       return APR_SUCCESS;
  
  
  
  1.32      +39 -0     apache-2.0/src/lib/apr/threadproc/win32/proc.c
  
  Index: proc.c
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/lib/apr/threadproc/win32/proc.c,v
  retrieving revision 1.31
  retrieving revision 1.32
  diff -u -r1.31 -r1.32
  --- proc.c	2000/06/10 17:14:05	1.31
  +++ proc.c	2000/06/20 19:36:48	1.32
  @@ -97,17 +97,56 @@
                                      attr->cntxt)) != APR_SUCCESS) {
               return stat;
           }
  +        switch (in) {
  +        case APR_FULL_BLOCK:
  +            break;
  +        case APR_PARENT_BLOCK:
  +            ap_set_pipe_timeout(attr->child_in, 0);
  +            break;
  +        case APR_CHILD_BLOCK:
  +            ap_set_pipe_timeout(attr->parent_in, 0);
  +            break;
  +        default:
  +            ap_set_pipe_timeout(attr->child_in, 0);
  +            ap_set_pipe_timeout(attr->parent_in, 0);
  +        }
       }
       if (out) {
           if ((stat = ap_create_pipe(&attr->parent_out, &attr->child_out, 
                                      attr->cntxt)) != APR_SUCCESS) {
               return stat;
           }
  +        switch (out) {
  +        case APR_FULL_BLOCK:
  +            break;
  +        case APR_PARENT_BLOCK:
  +            ap_set_pipe_timeout(attr->child_out, 0);
  +            break;
  +        case APR_CHILD_BLOCK:
  +            ap_set_pipe_timeout(attr->parent_out, 0);
  +            break;
  +        default:
  +            ap_set_pipe_timeout(attr->child_out, 0);
  +            ap_set_pipe_timeout(attr->parent_out, 0);
  +        }
       }
       if (err) {
           if ((stat = ap_create_pipe(&attr->parent_err, &attr->child_err, 
                                      attr->cntxt)) != APR_SUCCESS) {
               return stat;
  +        }
  +        switch (err) {
  +        case APR_FULL_BLOCK:
  +            break;
  +        case APR_PARENT_BLOCK:
  +            ap_set_pipe_timeout(attr->child_err, 0);
  +            break;
  +        case APR_CHILD_BLOCK:
  +            ap_set_pipe_timeout(attr->parent_err, 0);
  +            break;
  +        default:
  +            ap_set_pipe_timeout(attr->child_err, 0);
  +            ap_set_pipe_timeout(attr->parent_err, 0);
           }
       } 
       return APR_SUCCESS;
  
  
  
  1.57      +0 -4      apache-2.0/src/main/http_log.c
  
  Index: http_log.c
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/main/http_log.c,v
  retrieving revision 1.56
  retrieving revision 1.57
  diff -u -r1.56 -r1.57
  --- http_log.c	2000/06/12 23:02:49	1.56
  +++ http_log.c	2000/06/20 19:36:50	1.57
  @@ -705,12 +705,8 @@
       pl->program = ap_pstrdup(p, program);
       pl->pid = NULL;
       if (ap_create_pipe(&ap_piped_log_read_fd(pl), &ap_piped_log_write_fd(pl), p)
!= APR_SUCCESS) {
  -	int save_errno = errno;
  -	errno = save_errno;
   	return NULL;
       }
  -    ap_block_pipe(ap_piped_log_read_fd(pl));
  -    ap_block_pipe(ap_piped_log_write_fd(pl));
       ap_register_cleanup(p, pl, piped_log_cleanup, piped_log_cleanup_for_exec);
       if (piped_log_spawn(pl) == -1) {
   	int save_errno = errno;
  
  
  

Mime
View raw message