You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by tr...@locus.apache.org on 2000/09/11 20:28:00 UTC

cvs commit: apache-2.0/src/lib/apr/file_io/win32 open.c

trawick     00/09/11 11:27:59

  Modified:    src      CHANGES
               src/lib/apr/file_io/unix open.c
               src/lib/apr/file_io/win32 open.c
  Log:
  apr_put_os_file() now sets up the unget byte appropriately on Unix
  and Win32.  Previously, the first read from an apr_file_t set up via
  apr_put_os_file() would return a '\0'.
  
  The recent mod_cgid updates exposed this problem with the use of
  apr_fgets() on a "file" created via apr_put_os_file().
  
  Revision  Changes    Path
  1.220     +4 -0      apache-2.0/src/CHANGES
  
  Index: CHANGES
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/CHANGES,v
  retrieving revision 1.219
  retrieving revision 1.220
  diff -u -r1.219 -r1.220
  --- CHANGES	2000/09/11 00:30:01	1.219
  +++ CHANGES	2000/09/11 18:27:54	1.220
  @@ -1,4 +1,8 @@
   Changes with Apache 2.0a7
  +  *) apr_put_os_file() now sets up the unget byte appropriately on Unix
  +     and Win32.  Previously, the first read from an apr_file_t set up via
  +     apr_put_os_file() would return a '\0'.  [Jeff Trawick]
  +
     *) Mod_cgid now creates a single element bucket brigade, with a pipe
        bucket, instead of using BUFF's and ap_r*.
        [Ryan Bloom]
  
  
  
  1.64      +2 -1      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.63
  retrieving revision 1.64
  diff -u -r1.63 -r1.64
  --- open.c	2000/08/02 05:25:51	1.63
  +++ open.c	2000/09/11 18:27:57	1.64
  @@ -216,7 +216,7 @@
   }
   
   apr_status_t apr_put_os_file(apr_file_t **file, apr_os_file_t *thefile,
  -                           apr_pool_t *cont)
  +                             apr_pool_t *cont)
   {
       int *dafile = thefile;
       
  @@ -228,6 +228,7 @@
       (*file)->buffered = 0;
       (*file)->blocking = BLK_UNKNOWN; /* in case it is a pipe */
       (*file)->timeout = -1;
  +    (*file)->ungetchar = -1; /* no char avail */
       (*file)->filedes = *dafile;
       /* buffer already NULL; 
        * don't get a lock (only for buffered files) 
  
  
  
  1.48      +2 -1      apache-2.0/src/lib/apr/file_io/win32/open.c
  
  Index: open.c
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/lib/apr/file_io/win32/open.c,v
  retrieving revision 1.47
  retrieving revision 1.48
  diff -u -r1.47 -r1.48
  --- open.c	2000/08/06 06:07:05	1.47
  +++ open.c	2000/09/11 18:27:58	1.48
  @@ -245,7 +245,7 @@
   }
   
   apr_status_t apr_put_os_file(apr_file_t **file, apr_os_file_t *thefile, 
  -                           apr_pool_t *cont)
  +                             apr_pool_t *cont)
   {
       if ((*file) == NULL) {
           if (cont == NULL) {
  @@ -255,6 +255,7 @@
           (*file)->cntxt = cont;
       }
       (*file)->filehand = *thefile;
  +    (*file)->ungetchar = -1; /* no char avail */
       return APR_SUCCESS;
   }