fielding    97/07/14 01:50:28

  Modified:    src       CHANGES http_protocol.c
  Log:
  A very large one-line change.  If finalize_request_protocol were to
  be mistakenly called twice, it would send two chunked terminators.
  To prevent that, we just needed to clear r->chunked at the same time
  we clear the B_CHUNK flag.  Also added comments to explain the function.
  
  Revision  Changes    Path
  1.334     +10 -7     apache/src/CHANGES
  
  Index: CHANGES
  ===================================================================
  RCS file: /export/home/cvs/apache/src/CHANGES,v
  retrieving revision 1.333
  retrieving revision 1.334
  diff -C3 -r1.333 -r1.334
  *** CHANGES   1997/07/13 19:01:06     1.333
  --- CHANGES   1997/07/14 08:50:25     1.334
  ***************
  *** 1,11 ****
    Changes with Apache 1.3
    
  !   *) Make modules DLLs, dynamically loaded, using LoadModule/LoadFile
  !      on Win32.
  !      Note that module DLLs must be compiled with the multithreaded DLL
  !      version of the runtime library. [Alexei Kosut and Ben Laurie]
  ! 
  !   *) Sequent port re-added and SONY NEWS-OS port included.
    
      *) Automatic indexing removed from mod_dir and placed into mod_autoindex.
         This allows the admin to completely remove automatic indexing
  --- 1,9 ----
    Changes with Apache 1.3
    
  !   *) On Win32, modules can now be dynamically loaded DLLs using the
  !      LoadModule/LoadFile directives. Note that module DLLs must be
  !      compiled with the multithreaded DLL version of the runtime library.
  !      [Alexei Kosut and Ben Laurie]
    
      *) Automatic indexing removed from mod_dir and placed into mod_autoindex.
         This allows the admin to completely remove automatic indexing
  ***************
  *** 97,102 ****
  --- 95,103 ----
      *) API: A new handler response DONE which informs apache that the
         request has been handled and it can finish off quickly, similar to
         how it handles errors. [Rob Hartill]
  + 
  +   *) Turn off chunked encoding after sending terminating chunk/footer
  +      so that we can't do it twice by accident. [Roy Fielding]
      
      *) mod_expire also issues Cache-Control: max-age headers.
         [Rob Hartill]
  ***************
  *** 111,117 ****
         When used together, these cause mod_dir to emit HEIGHT and WIDTH
         attributes in the FancyIndexing IMG tags.  [Ken Coar]
    
  !   *) PORT: Added NT support
         [Ben Laurie and Ambarish Malpani <[EMAIL PROTECTED]>]
    
    Changes with Apache 1.2.1
  --- 112,120 ----
         When used together, these cause mod_dir to emit HEIGHT and WIDTH
         attributes in the FancyIndexing IMG tags.  [Ken Coar]
    
  !   *) PORT: Sequent and SONY NEWS-OS support added.
  ! 
  !   *) PORT: Added Windows NT support
         [Ben Laurie and Ambarish Malpani <[EMAIL PROTECTED]>]
    
    Changes with Apache 1.2.1
  
  
  
  1.135     +14 -6     apache/src/http_protocol.c
  
  Index: http_protocol.c
  ===================================================================
  RCS file: /export/home/cvs/apache/src/http_protocol.c,v
  retrieving revision 1.134
  retrieving revision 1.135
  diff -C3 -r1.134 -r1.135
  *** http_protocol.c   1997/07/13 19:01:12     1.134
  --- http_protocol.c   1997/07/14 08:50:26     1.135
  ***************
  *** 1250,1265 ****
        if (r->chunked) bsetflag(r->connection->client, B_CHUNK, 1);
    }
    
    void finalize_request_protocol (request_rec *r)
    {
  -     /* Turn off chunked encoding */
  - 
        if (r->chunked && !r->connection->aborted) {
  !         soft_timeout("send ending chunk", r);
            bsetflag(r->connection->client, B_CHUNK, 0);
  !     bputs("0\015\012", r->connection->client);
  !     /* If we had footer "headers", we'd send them now */
  !     bputs("\015\012", r->connection->client);
            kill_timeout(r);
        }
    }
  --- 1250,1273 ----
        if (r->chunked) bsetflag(r->connection->client, B_CHUNK, 1);
    }
    
  + /* finalize_request_protocol must be called by a module after it sends
  +  * a response body.  It's sole purpose is to send the terminating
  +  * protocol information for any wrappers around the response message body
  +  * (i.e., transfer encodings).  It should have been named finalize_response.
  +  */
    void finalize_request_protocol (request_rec *r)
    {
        if (r->chunked && !r->connection->aborted) {
  !         /*
  !          * Turn off chunked encoding --- we can only do this once.
  !          */
  !         r->chunked = 0;
            bsetflag(r->connection->client, B_CHUNK, 0);
  ! 
  !         soft_timeout("send ending chunk", r);
  !         bputs("0\015\012", r->connection->client);
  !         /* If we had footer "headers", we'd send them now */
  !         bputs("\015\012", r->connection->client);
            kill_timeout(r);
        }
    }
  
  
  

Reply via email to