tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cos...@apache.org
Subject cvs commit: jakarta-tomcat-connectors/jk/native2/server/apache2 jk_service_apache2.c
Date Sat, 02 Mar 2002 06:35:41 GMT
costin      02/03/01 22:35:41

  Modified:    jk/native2/server/apache2 jk_service_apache2.c
  Log:
  There is something wrong with using APRTABLES, I suspect we're reusing
  a buffer too much.
  
  Reverted to jk maps until the rest is working, then I'll try again.
  
  Revision  Changes    Path
  1.11      +31 -5     jakarta-tomcat-connectors/jk/native2/server/apache2/jk_service_apache2.c
  
  Index: jk_service_apache2.c
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/server/apache2/jk_service_apache2.c,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- jk_service_apache2.c	28 Feb 2002 23:35:26 -0000	1.10
  +++ jk_service_apache2.c	2 Mar 2002 06:35:41 -0000	1.11
  @@ -59,7 +59,7 @@
    * Description: Apache 2 plugin for Jakarta/Tomcat                         
    * Author:      Gal Shachor <shachor@il.ibm.com>                           
    *                 Henri Gomez <hgomez@slib.fr>                            
  - * Version:     $Revision: 1.10 $                                           
  + * Version:     $Revision: 1.11 $                                           
    */
   
   #include "apu_compat.h"
  @@ -92,7 +92,7 @@
   
   #include "jk_apache2.h"
   
  -#define USE_APRTABLES 
  +/* #define USE_APRTABLES  */
   
   #define NULL_FOR_EMPTY(x)   ((x && !strlen(x)) ? NULL : x) 
   
  @@ -113,8 +113,31 @@
       }
       r->status = s->status;
       r->status_line = apr_psprintf(r->pool, "%d %s", s->status, s->msg);
  -
       headers=s->headers_out;
  +
  +#ifdef USE_APRTABLES
  +    {
  +        char *val= headers->get( env, headers, "Content-Type");
  +        if( val!=NULL ) {
  +            char *tmp = apr_pstrdup(r->pool, val);
  +            ap_content_type_tolower(tmp); 
  +            r->content_type = tmp;
  +        }
  +        val= headers->get( env, headers, "Last-Modified");
  +        if( val!=NULL ) {
  +            /*
  +             * If the script gave us a Last-Modified header, we can't just
  +             * pass it on blindly because of restrictions on future values.
  +             */
  +            ap_update_mtime(r, ap_parseHTTPdate(val));
  +            ap_set_last_modified(r);
  +        }
  +
  +        /* No other change required - headers is the same as req->headers_out,
  +           just with a different interface
  +        */
  +    }
  +#else
       numheaders = headers->size(env, headers);
       /* XXX As soon as we switch to jk_map_apache2, this will not be needed ! */
       env->l->jkLog(env, env->l, JK_LOG_INFO, 
  @@ -124,7 +147,9 @@
       for(h = 0 ; h < numheaders; h++) {
           char *name=headers->nameAt( env, headers, h );
           char *val=headers->valueAt( env, headers, h );
  -
  +        name=s->pool->pstrdup( env, s->pool, name );
  +        val=s->pool->pstrdup( env, s->pool, val );
  +        
           env->l->jkLog(env, env->l, JK_LOG_INFO, 
                         "service.head() %s: %s %d %d\n", name, val, h, headers->size(
env, headers ));
   
  @@ -156,7 +181,8 @@
                  apr_table_set(r->headers_out, name, val);
           }
       }
  -
  +#endif
  +    
       /* this NOP function was removed in apache 2.0 alpha14 */
       /* ap_send_http_header(r); */
       s->response_started = JK_TRUE;
  
  
  

--
To unsubscribe, e-mail:   <mailto:tomcat-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:tomcat-dev-help@jakarta.apache.org>


Mime
View raw message