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/10/04 00:08:48 UTC

cvs commit: apache-2.0/src/main http_protocol.c

trawick     00/10/03 15:08:42

  Modified:    src/main http_protocol.c
  Log:
  Change ap_send_fd() so that it returns a proper apr_status_t value
  instead of the number of bytes sent.
  
  default_handler() ignores the ap_send_fd() return code, but
  mod_file_cache doesn't.  When mod_file_cache's handler called
  ap_send_fd(), the client would get the desired file plus an
  error document (500 internal server error), which was delivered
  because mod_file_cache's handler returned an error since
  ap_send_fd() returned non-zero.
  
  Also in this commit is a hack to be able to compile when APACHE_XLATE
  is defined.
  
  Revision  Changes    Path
  1.135     +11 -4     apache-2.0/src/main/http_protocol.c
  
  Index: http_protocol.c
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/main/http_protocol.c,v
  retrieving revision 1.134
  retrieving revision 1.135
  diff -u -r1.134 -r1.135
  --- http_protocol.c	2000/10/02 00:47:28	1.134
  +++ http_protocol.c	2000/10/03 22:08:38	1.135
  @@ -890,7 +890,7 @@
       int length;
       ap_bucket_brigade *b;
       ap_bucket *e;
  -#ifdef APACHE_XLATE
  +#ifdef APACHE_XLATE_XXX
       /* When getline() is called, the HTTP protocol is in a state
        * where we MUST be reading "plain text" protocol stuff,
        * (Request line, MIME headers, Chunk sizes) regardless of
  @@ -988,7 +988,7 @@
   	    break;       /* if not, input line exceeded buffer size */
   	}
       }
  -#ifdef APACHE_XLATE
  +#ifdef APACHE_XLATE_XXX
       /* restore translation handle */
       AP_POP_INPUTCONVERSION_STATE(in);
   #endif /*APACHE_XLATE*/
  @@ -2566,6 +2566,7 @@
   {
       ap_bucket_brigade *bb = NULL;
       ap_bucket *b;
  +    apr_status_t rv;
   
       bb = ap_brigade_create(r->pool);
       b = ap_bucket_create_file(fd, offset, len);
  @@ -2576,9 +2577,15 @@
       b = ap_bucket_create_eos();
       AP_BRIGADE_INSERT_TAIL(bb, b);
   #endif
  -    ap_pass_brigade(r->output_filters, bb);
  +    rv = ap_pass_brigade(r->output_filters, bb);
  +    if (rv != APR_SUCCESS) {
  +        *nbytes = 0; /* no way to tell how many were actually sent */
  +    }
  +    else {
  +        *nbytes = len;
  +    }
   
  -    return len;
  +    return rv;
   }
   #if 0
   /* Leave the old implementation around temporarily for reference purposes */