httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From grega...@locus.apache.org
Subject cvs commit: apache-2.0/src/main http_protocol.c
Date Wed, 18 Oct 2000 15:21:35 GMT
gregames    00/10/18 08:21:34

  Modified:    src/include http_core.h
               src/main http_protocol.c
  Log:
  Add a core_request_config so we have a safe semi-hidden place to save core data
  that lives across function calls during a single request.  Change getline() to
  take a request_rec parm (rather than a conn_rec) so we can access the
  core_request_config.
  
  This is in preparation for adding look-ahead functionality to getline(), so it
  can support header line folding once again.  I'm committing these changes first
  so the core_request_config can be used elsewhere (i.e. ap_get_client_block).
  
  Revision  Changes    Path
  1.29      +7 -0      apache-2.0/src/include/http_core.h
  
  Index: http_core.h
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/include/http_core.h,v
  retrieving revision 1.28
  retrieving revision 1.29
  diff -u -r1.28 -r1.29
  --- http_core.h	2000/10/17 01:35:11	1.28
  +++ http_core.h	2000/10/18 15:21:30	1.29
  @@ -318,6 +318,13 @@
   
   extern AP_DECLARE_DATA module core_module;
   
  +/* Per-request configuration */
  +
  +typedef struct {
  +    /* bucket brigade used by getline for look-ahead */
  +    struct ap_bucket_brigade *bb;
  +} core_request_config;
  +
   /* Per-directory configuration */
   
   typedef unsigned char allow_options_t;
  
  
  
  1.188     +10 -6     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.187
  retrieving revision 1.188
  diff -u -r1.187 -r1.188
  --- http_protocol.c	2000/10/17 20:43:35	1.187
  +++ http_protocol.c	2000/10/18 15:21:32	1.188
  @@ -847,7 +847,7 @@
   };
   
   static long get_chunk_size(char *);
  -static int getline(char *s, int n, conn_rec *c, int fold);
  +static int getline(char *s, int n, request_rec *r, int fold);
   
   apr_status_t dechunk_filter(ap_filter_t *f, ap_bucket_brigade *bb,
                               apr_ssize_t length)
  @@ -871,7 +871,7 @@
                */
               char line[30];
               
  -            if ((rv = getline(line, sizeof(line), f->c, 0)) < 0) {
  +            if ((rv = getline(line, sizeof(line), f->r, 0)) < 0) {
                   return rv;
               }
               switch(ctx->state) {
  @@ -1031,7 +1031,7 @@
    *       then the actual input line exceeded the buffer length,
    *       and it would be a good idea for the caller to puke 400 or 414.
    */
  -static int getline(char *s, int n, conn_rec *c, int fold)
  +static int getline(char *s, int n, request_rec *r, int fold)
   {
       char *pos = s;
       char *last_char;
  @@ -1040,6 +1040,7 @@
       int retval;
       int total = 0;
       apr_ssize_t length;
  +    conn_rec *c = r->connection;
       ap_bucket_brigade *b;
       ap_bucket *e;
   
  @@ -1200,7 +1201,7 @@
        */
       ap_bsetflag(conn->client, B_SAFEREAD, 1); 
       ap_bflush(conn->client);
  -    while ((len = getline(l, sizeof(l), conn, 0)) <= 0) {
  +    while ((len = getline(l, sizeof(l), r, 0)) <= 0) {
           if (len < 0) {             /* includes EOF */
   	    ap_bsetflag(conn->client, B_SAFEREAD, 0);
   	    /* this is a hack to make sure that request time is set,
  @@ -1267,7 +1268,6 @@
   static void get_mime_headers(request_rec *r)
   {
       char field[DEFAULT_LIMIT_REQUEST_FIELDSIZE + 2]; /* getline's two extra */
  -    conn_rec *c = r->connection;
       char *value;
       char *copy;
       int len;
  @@ -1281,7 +1281,7 @@
        * Read header lines until we get the empty separator line, a read error,
        * the connection closes (EOF), reach the server limit, or we timeout.
        */
  -    while ((len = getline(field, sizeof(field), c, 1)) > 0) {
  +    while ((len = getline(field, sizeof(field), r, 1)) > 0) {
   
           if (r->server->limit_req_fields &&
               (++fields_read > r->server->limit_req_fields)) {
  @@ -1339,6 +1339,7 @@
       apr_pool_t *p;
       const char *expect;
       int access_status;
  +    core_request_config *req_cfg;
   
       apr_create_pool(&p, conn->pool);
       r = apr_pcalloc(p, sizeof(request_rec));
  @@ -1361,6 +1362,9 @@
       r->notes           = apr_make_table(r->pool, 5);
   
       r->request_config  = ap_create_request_config(r->pool);
  +    req_cfg = apr_pcalloc(r->pool, sizeof(core_request_config));
  +    ap_set_module_config(r->request_config, &core_module, req_cfg);
  +                    
       r->per_dir_config  = r->server->lookup_defaults;
   
       r->sent_bodyct     = 0;                      /* bytect isn't for body */
  
  
  

Mime
View raw message