tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hgo...@apache.org
Subject cvs commit: jakarta-tomcat-connectors/jk/native2/common jk_channel_apr_socket.c
Date Tue, 30 Sep 2003 13:42:02 GMT
hgomez      2003/09/30 06:42:02

  Modified:    jk/native2/server/apache2 mod_jk2.c jk_service_apache2.c
                        jk_apache2.h
               jk/native2/common jk_channel_apr_socket.c
  Log:
  Update for APR 1.0 (Apache 2.1)
  
  Provided by GŁnter Knauf <eflash at gmx.net>
  
  Revision  Changes    Path
  1.64      +7 -7      jakarta-tomcat-connectors/jk/native2/server/apache2/mod_jk2.c
  
  Index: mod_jk2.c
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/server/apache2/mod_jk2.c,v
  retrieving revision 1.63
  retrieving revision 1.64
  diff -u -r1.63 -r1.64
  --- mod_jk2.c	25 Sep 2003 15:23:23 -0000	1.63
  +++ mod_jk2.c	30 Sep 2003 13:42:02 -0000	1.64
  @@ -242,9 +242,9 @@
       if (s->is_virtual && s->server_hostname != NULL &&
           (uriEnv->virtual==NULL  || !strchr(uriEnv->virtual, ':') ||
           uriEnv->port != s->port)) {
  -        tmp_virtual  = (char *) ap_pcalloc(cmd->pool,
  +        tmp_virtual  = (char *) apr_pcalloc(cmd->pool,
                           sizeof(char *) * (strlen(s->server_hostname) + 8 )) ;
  -        tmp_full_url = (char *) ap_pcalloc(cmd->pool,
  +        tmp_full_url = (char *) apr_pcalloc(cmd->pool,
                           sizeof(char *) * (strlen(s->server_hostname) +
                           strlen(uriEnv->uri)+8 )) ; 
           /* do not pass the hostname:0/ scheme */
  @@ -310,7 +310,7 @@
       /* Original patch: a * sizeof( char * ) - that's weird, we only use a chars, not char*
          Maybe I wrote too much java...
       */
  -    tmp = (char *) ap_pcalloc(p, a); 
  +    tmp = (char *) apr_pcalloc(p, a); 
       sprintf(tmp, "%s-%d", path, dirCounter++);
       /* I changed the default to /, otherwise it complains */
   
  @@ -538,7 +538,7 @@
       int i;
       
       for( i=0; i<10; i++ ) {
  -        tmpPool=apr_pool_get_parent( gPool );
  +        tmpPool=apr_pool_parent_get( gPool );
           if( tmpPool == NULL ) {
               /* fprintf(stderr, "XXX Found Root pool %#lx\n", gPool ); */
               break;
  @@ -890,11 +890,11 @@
       if( uriEnv != NULL ) {
       
           /* First find just the name of the file, no directory */
  -        r->filename = (char *)apr_filename_of_pathname(r->uri);
  +        r->filename = (char *)apr_filepath_name_get(r->uri);
   
           /* Only if sub-request for a directory, most likely from mod_dir */
           if (r->main && r->main->filename &&
  -            !*apr_filename_of_pathname(r->main->filename)){
  +            !*apr_filepath_name_get(r->main->filename)){
   
               /* The filename from the main request will be set to what should
                * be picked up, aliases included. Tomcat will need to know about
  
  
  
  1.36      +3 -3      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.35
  retrieving revision 1.36
  diff -u -r1.35 -r1.36
  --- jk_service_apache2.c	25 Sep 2003 15:23:23 -0000	1.35
  +++ jk_service_apache2.c	30 Sep 2003 13:42:02 -0000	1.36
  @@ -116,7 +116,7 @@
                * 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_update_mtime(r, apr_date_parse_http(val));
               ap_set_last_modified(r);
           }
   
  @@ -162,7 +162,7 @@
                * 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_update_mtime(r, apr_date_parse_http(val));
               ap_set_last_modified(r);
               apr_table_set(r->headers_out, name, val);
           } else {     
  
  
  
  1.13      +8 -2      jakarta-tomcat-connectors/jk/native2/server/apache2/jk_apache2.h
  
  Index: jk_apache2.h
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/server/apache2/jk_apache2.h,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- jk_apache2.h	25 Sep 2003 15:23:23 -0000	1.12
  +++ jk_apache2.h	30 Sep 2003 13:42:02 -0000	1.13
  @@ -65,7 +65,6 @@
   #ifndef JK_APACHE2_H
   #define JK_APACHE2_H
   
  -#include "apu_compat.h"
   #include "ap_config.h"
   #include "apr_lib.h"
   #include "apr_date.h"
  @@ -91,6 +90,13 @@
   #include "jk_workerEnv.h"
   #include "jk_uriMap.h"
   #include "jk_requtil.h"
  +
  +/* changed with apr 1.0 */
  +#include "apr_version.h"
  +#if (APR_MAJOR_VERSION < 1) 
  +#define apr_filepath_name_get apr_filename_of_pathname
  +#define apr_pool_parent_get apr_pool_get_parent
  +#endif
   
   extern module AP_MODULE_DECLARE_DATA jk2_module;
   
  
  
  
  1.31      +10 -6     jakarta-tomcat-connectors/jk/native2/common/jk_channel_apr_socket.c
  
  Index: jk_channel_apr_socket.c
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/common/jk_channel_apr_socket.c,v
  retrieving revision 1.30
  retrieving revision 1.31
  diff -u -r1.30 -r1.31
  --- jk_channel_apr_socket.c	3 Apr 2003 16:05:53 -0000	1.30
  +++ jk_channel_apr_socket.c	30 Sep 2003 13:42:02 -0000	1.31
  @@ -77,6 +77,7 @@
   #include "apr_network_io.h"
   #include "apr_errno.h"
   #include "apr_general.h"
  +#include "apr_version.h"
   
   
   #define DEFAULT_HOST "127.0.0.1"
  @@ -223,7 +224,10 @@
       int connected = 0;
   
       while (remote_sa && !connected) {
  -        if ((ret = apr_socket_create(&sock, remote_sa->family, SOCK_STREAM,
  +        if ((ret = apr_socket_create(&sock, remote_sa->family, SOCK_STREAM, 
  +#if (APR_MAJOR_VERSION > 0) 
  +                                     APR_PROTO_TCP,
  +#endif
                                        (apr_pool_t *)env->globalPool->_private))
                                       != APR_SUCCESS) {
               if (remote_sa->next) {
  @@ -256,7 +260,7 @@
   
           /* make the connection out of the socket */
           do { 
  -            ret = apr_connect(sock, remote_sa);
  +            ret = apr_socket_connect(sock, remote_sa);
           } while (APR_STATUS_IS_EINTR(ret));
           
           /* if an error occurred, loop round and try again */
  @@ -289,7 +293,7 @@
       /* enable the use of keep-alive packets on TCP connection */
       if(keepalive) {
           int set = 1;
  -        if((ret = apr_setsocketopt(sock, APR_SO_KEEPALIVE, set)) != APR_SUCCESS ) {
  +        if((ret = apr_socket_opt_set(sock, APR_SO_KEEPALIVE, set)) != APR_SUCCESS ) {
               apr_socket_close(sock);
               env->l->jkLog(env, env->l, JK_LOG_ERROR,
                             "channelApr.open() keepalive failed %d %s\n",
  @@ -301,7 +305,7 @@
       /* Disable the Nagle algorithm if ndelay is set */
       if(ndelay) {
           int set = 1;
  -        if((ret = apr_setsocketopt(sock, APR_TCP_NODELAY, set)) != APR_SUCCESS ) {
  +        if((ret = apr_socket_opt_set(sock, APR_TCP_NODELAY, set)) != APR_SUCCESS ) {
               apr_socket_close(sock);
               env->l->jkLog(env, env->l, JK_LOG_ERROR,
                             "channelApr.open() nodelay failed %d %s\n",
  @@ -378,7 +382,7 @@
       do {
           apr_size_t written = length;
   
  -        stat = apr_send(sock, b, &written);
  +        stat = apr_socket_send(sock, b, &written);
           if (stat!= APR_SUCCESS) {
               env->l->jkLog(env, env->l, JK_LOG_ERROR,
                   "jk2_channel_apr_send send failed %d %s\n",
  @@ -420,7 +424,7 @@
       length = (apr_size_t)len;
       while (rdlen < len) {
   
  -        stat =  apr_recv(sock, b + rdlen, &length);
  +        stat =  apr_socket_recv(sock, b + rdlen, &length);
   
           if (stat == APR_EOF)
               return -1; /* socket closed. */
  
  
  

Mime
View raw message