httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gst...@apache.org
Subject cvs commit: httpd-2.0/modules/http http_protocol.c
Date Wed, 24 Jan 2001 01:42:41 GMT
gstein      01/01/23 17:42:41

  Modified:    modules/http http_protocol.c
  Log:
  fix the (error) return values for the ap_r* functions.
  
  Submitted by: Jeff Trawick
  
  Revision  Changes    Path
  1.273     +16 -13    httpd-2.0/modules/http/http_protocol.c
  
  Index: http_protocol.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/modules/http/http_protocol.c,v
  retrieving revision 1.272
  retrieving revision 1.273
  diff -u -u -r1.272 -r1.273
  --- http_protocol.c	2001/01/24 01:31:00	1.272
  +++ http_protocol.c	2001/01/24 01:42:41	1.273
  @@ -3075,10 +3075,11 @@
       char c2 = (char)c;
   
       if (r->connection->aborted) {
  -	return EOF;
  +	return -1;
       }
   
  -    (void) buffer_output(r, &c2, 1);
  +    if (buffer_output(r, &c2, 1) != APR_SUCCESS)
  +        return -1;
   
       return c;
   }
  @@ -3088,11 +3089,10 @@
       apr_size_t len;
   
       if (r->connection->aborted)
  -        return EOF;
  -    if (*str == '\0')
  -        return 0;
  +        return -1;
   
  -    (void) buffer_output(r, str, len = strlen(str));
  +    if (buffer_output(r, str, len = strlen(str)) != APR_SUCCESS)
  +        return -1;
   
       return len;
   }
  @@ -3100,9 +3100,10 @@
   AP_DECLARE(int) ap_rwrite(const void *buf, int nbyte, request_rec *r)
   {
       if (r->connection->aborted)
  -        return EOF;
  +        return -1;
   
  -    (void) buffer_output(r, buf, nbyte);
  +    if (buffer_output(r, buf, nbyte) != APR_SUCCESS)
  +        return -1;
   
       return nbyte;
   }
  @@ -3113,11 +3114,12 @@
       apr_size_t written;
   
       if (r->connection->aborted)
  -        return EOF;
  +        return -1;
   
       /* ### fix this mechanism to allow more than 4K of output */
       written = apr_vsnprintf(buf, sizeof(buf), fmt, va);
  -    (void) buffer_output(r, buf, written);
  +    if (buffer_output(r, buf, written) != APR_SUCCESS)
  +        return -1;
   
       return written;
   }
  @@ -3128,7 +3130,7 @@
       int n;
   
       if (r->connection->aborted)
  -        return EOF;
  +        return -1;
   
       va_start(va, fmt);
       n = ap_vrprintf(r, fmt, va);
  @@ -3145,7 +3147,7 @@
       apr_size_t written;
   
       if (r->connection->aborted)
  -        return EOF;
  +        return -1;
   
       /* ### TODO: if the total output is large, put all the strings
          ### into a single brigade, rather than flushing each time we
  @@ -3176,7 +3178,8 @@
       bb = apr_brigade_create(r->pool);
       b = apr_bucket_create_flush();
       APR_BRIGADE_INSERT_TAIL(bb, b);
  -    ap_pass_brigade(r->output_filters, bb);
  +    if (ap_pass_brigade(r->output_filters, bb) != APR_SUCCESS)
  +        return -1;
       return 0;
   }
   
  
  
  

Mime
View raw message