dgaudet     97/12/26 10:21:47

  Modified:    .        STATUS
               src      CHANGES
               src/main buff.c
  Log:
  Fix problem with chunking and bputc().
  Don't use large_write() when nbytes == 1... otherwise we have really bad
  performance at end of buffer with bputc().
  
  Reviewed by:  Rasmus Lerdorf, Jim Jagielski
  
  Revision  Changes    Path
  1.31      +5 -4      apachen/STATUS
  
  Index: STATUS
  ===================================================================
  RCS file: /export/home/cvs/apachen/STATUS,v
  retrieving revision 1.30
  retrieving revision 1.31
  diff -u -r1.30 -r1.31
  --- STATUS    1997/12/26 18:16:14     1.30
  +++ STATUS    1997/12/26 18:21:43     1.31
  @@ -54,9 +54,14 @@
       * Dean's [PATCH] ap_snprintf should be more sane (fwd)
       * Jim's/Ken's move of main/util_snprintf.c to ap/ap_snprintf.c
       * [PATCH] Re: [BUGFIXES] Wrong GID for PID file and UMASK for logs
  +    * Dean's [PATCH] fix Rasmus' chunking error
   
   Available:
   
  +    * [PATCH] PR#1366: fix result of send_fd_length
  +     <[EMAIL PROTECTED]>
  +     Status: Dean +1, Dirk +1
  +
       * Jim's [PATCH] ap_cpystrn() function (replace strncpy)
        <[EMAIL PROTECTED]>
        Status: Jim +1
  @@ -68,10 +73,6 @@
       * Ken's [PATCH] for PR#1195 (" in realm names)
        <[EMAIL PROTECTED]>
        Status: Ken +1, Dean +1, Jim +1
  -
  -    * Dean's [PATCH] fix Rasmus' chunking error
  -     <[EMAIL PROTECTED]>
  -     Status: Dean +1, Rasmus +1, Jim +1
   
       * Dean's [PATCH] mod_status cleanups
        <[EMAIL PROTECTED]>
  
  
  
  1.544     +6 -0      apachen/src/CHANGES
  
  Index: CHANGES
  ===================================================================
  RCS file: /export/home/cvs/apachen/src/CHANGES,v
  retrieving revision 1.543
  retrieving revision 1.544
  diff -u -r1.543 -r1.544
  --- CHANGES   1997/12/26 18:16:15     1.543
  +++ CHANGES   1997/12/26 18:21:44     1.544
  @@ -1,5 +1,11 @@
   Changes with Apache 1.3b4
   
  +  *) The large_write() changes tickled a bug in bputc(), this would
  +     show up as certain modules not working with Internet Explorer 4.0.
  +     Fix this bug, and also fix a performance bug related to bputc()
  +     causing a large_write() -- don't do large_write() unless there's
  +     at least two bytes to write.  [Dean Gaudet]
  +
     *) Move the gid switching code into the child so that log files
        and pid files are opened with the root gid.
        [Gregory A Lundberg <[EMAIL PROTECTED]>]
  
  
  
  1.53      +13 -3     apachen/src/main/buff.c
  
  Index: buff.c
  ===================================================================
  RCS file: /export/home/cvs/apachen/src/main/buff.c,v
  retrieving revision 1.52
  retrieving revision 1.53
  diff -u -r1.52 -r1.53
  --- buff.c    1997/12/23 02:03:54     1.52
  +++ buff.c    1997/12/26 18:21:46     1.53
  @@ -807,9 +807,16 @@
   API_EXPORT(int) bflsbuf(int c, BUFF *fb)
   {
       char ss[1];
  +    int rc;
   
       ss[0] = c;
  -    return bwrite(fb, ss, 1);
  +    rc = bwrite(fb, ss, 1);
  +    /* We do start_chunk() here so that the bputc macro can be smaller
  +     * and faster
  +     */
  +    if (rc == 1 && (fb->flags & B_CHUNK))
  +     start_chunk(fb);
  +    return rc;
   }
   
   /*
  @@ -1056,9 +1063,12 @@
   #ifndef NO_WRITEV
   /*
    * Detect case where we're asked to write a large buffer, and combine our
  - * current buffer with it in a single writev()
  + * current buffer with it in a single writev().  Note we don't consider
  + * the case nbyte == 1 because modules which use rputc() loops will cause
  + * us to use writev() too frequently.  In those cases we really should just
  + * start a new buffer.
    */
  -    if (fb->outcnt > 0 && nbyte + fb->outcnt >= fb->bufsiz) {
  +    if (fb->outcnt > 0 && nbyte > 1 && nbyte + fb->outcnt >= fb->bufsiz) {
        return large_write(fb, buf, nbyte);
       }
   #endif
  
  
  

Reply via email to