httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gst...@locus.apache.org
Subject cvs commit: apache-2.0/src/main http_protocol.c util_filter.c
Date Thu, 09 Nov 2000 10:21:13 GMT
gstein      00/11/09 02:21:12

  Modified:    src/main http_protocol.c util_filter.c
  Log:
  minor tweaks, cleanup, comments.
  
  Revision  Changes    Path
  1.239     +14 -9     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.238
  retrieving revision 1.239
  diff -u -r1.238 -r1.239
  --- http_protocol.c	2000/11/09 03:33:24	1.238
  +++ http_protocol.c	2000/11/09 10:21:12	1.239
  @@ -201,7 +201,6 @@
       apr_off_t range_end;
       char *current;
       const char *bound_head;
  -    const char *ct = make_content_type(r, r->content_type);
   
       if (!ctx) {
           int num_ranges = ap_set_byterange(r);
  @@ -210,9 +209,12 @@
               ap_remove_output_filter(f);
               return ap_pass_brigade(f->next, bb);
           }
  +
           ctx = f->ctx = apr_pcalloc(r->pool, sizeof(*ctx));
  -        ctx->num_ranges = ap_set_byterange(r);
  -        
  +        ctx->num_ranges = num_ranges;
  +
  +        /* create a brigade in case we never call ap_save_brigade() */
  +        ctx->bb = ap_brigade_create(r->pool);
       }
   
       /* We can't actually deal with byte-ranges until we have the whole brigade
  @@ -224,16 +226,18 @@
           return APR_SUCCESS;
       }
   
  -    /* compute this once (it is an invariant) and store it away */
  -    bound_head = apr_pstrcat(r->pool, CRLF "--", r->boundary,
  -                                  CRLF "Content-type: ", ct,
  -                                  CRLF "Content-range: bytes ", 
  -                                  NULL);
  +    /* compute this once (it is an invariant) */
  +    bound_head = apr_pstrcat(r->pool,
  +                             CRLF "--", r->boundary,
  +                             CRLF "Content-type: ",
  +                             make_content_type(r, r->content_type),
  +                             CRLF "Content-range: bytes ", 
  +                             NULL);
   
       /* concat the passed brigade with our saved brigade */
       AP_BRIGADE_CONCAT(ctx->bb, bb);
       bb = ctx->bb;
  -    ctx->bb = NULL;     /* ### strictly necessary? */
  +    ctx->bb = NULL;     /* ### strictly necessary? call brigade_destroy? */
   
       /* this brigade holds what we will be sending */
       bsend = ap_brigade_create(r->pool);
  @@ -2319,6 +2323,7 @@
       apr_off_t range_end;
       int num_ranges;
   
  +    /* ### this test for r->clength is probably a Bad Thing. need to fix */
       if (!r->clength || r->assbackwards)
           return 0;
   
  
  
  
  1.38      +11 -6     apache-2.0/src/main/util_filter.c
  
  Index: util_filter.c
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/main/util_filter.c,v
  retrieving revision 1.37
  retrieving revision 1.38
  diff -u -r1.37 -r1.38
  --- util_filter.c	2000/10/25 10:47:51	1.37
  +++ util_filter.c	2000/11/09 10:21:12	1.38
  @@ -53,6 +53,7 @@
    */
   
   #include "httpd.h"
  +#include "http_log.h"
   #include "util_filter.h"
   
   /* ### make this visible for direct manipulation?
  @@ -108,8 +109,7 @@
   {
       ap_filter_func f;
       f.in_func = filter_func;
  -    register_filter(name, f, ftype, 
  -                    &registered_input_filters);
  +    register_filter(name, f, ftype, &registered_input_filters);
   }                                                                    
   
   AP_DECLARE(void) ap_register_output_filter(const char *name,
  @@ -118,8 +118,7 @@
   {
       ap_filter_func f;
       f.out_func = filter_func;
  -    register_filter(name, f, ftype, 
  -                    &registered_output_filters);
  +    register_filter(name, f, ftype, &registered_output_filters);
   }
   
   AP_DECLARE(void) ap_add_input_filter(const char *name, void *ctx, 
  @@ -150,9 +149,12 @@
                   fscan->next = f;
               }
   
  -            break;
  +            return;
           }
       }
  +
  +    ap_log_error(APLOG_MARK, APLOG_ERR|APLOG_NOERRNO, 0, NULL,
  +                 "an unknown input filter was not added: %s", name);
   }
   
   AP_DECLARE(void) ap_remove_output_filter(ap_filter_t *f)
  @@ -208,9 +210,12 @@
                   fscan->next = f;
               }
   
  -            break;
  +            return;
           }
       }
  +
  +    ap_log_error(APLOG_MARK, APLOG_ERR|APLOG_NOERRNO, 0, NULL,
  +                 "an unknown output filter was not added: %s", name);
   }
   
   /* 
  
  
  

Mime
View raw message