You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by tr...@locus.apache.org on 2000/12/04 20:24:13 UTC

cvs commit: httpd-2.0/modules/proxy proxy_http.c

trawick     00/12/04 11:24:11

  Modified:    include  http_connection.h
               server   connection.c
               server/mpm/beos beos.c
               server/mpm/dexter dexter.c
               server/mpm/mpmt_beos mpmt_beos.c
               server/mpm/mpmt_pthread mpmt_pthread.c
               server/mpm/perchild perchild.c
               server/mpm/prefork prefork.c
               server/mpm/spmt_os2 spmt_os2.c
               server/mpm/winnt mpm_winnt.c
               modules/proxy proxy_http.c
  Log:
  Get rid of ap_new_apr_connection().  ap_new_connection() now has
  fewer parameters: the local and remote socket addresses were removed
  from the parameter list because all required information is available
  via the APR socket.
  
  I haven't tested the most important part -- the WinNT MPM changes
  -- but it compiles and it looks okay :)  If the WinNT MPM works on
  Win98 these days let me know.
  
  Revision  Changes    Path
  1.28      +1 -16     httpd-2.0/include/http_connection.h
  
  Index: http_connection.h
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/include/http_connection.h,v
  retrieving revision 1.27
  retrieving revision 1.28
  diff -u -r1.27 -r1.28
  --- http_connection.h	2000/11/28 03:01:10	1.27
  +++ http_connection.h	2000/12/04 19:23:13	1.28
  @@ -72,25 +72,10 @@
    * @param p Pool to allocate data structures out of
    * @param server The server to create the connection for
    * @param inout The socket to use for all communication with the client
  - * @param remaddr The remote address
  - * @param addr The server's local address
    * @param id ID of this connection; unique at any point in time.
    */
   conn_rec *ap_new_connection(apr_pool_t *p, server_rec *server, 
  -                            apr_socket_t *inout,
  -			    const struct sockaddr_in *remaddr,
  -			    const struct sockaddr_in *saddr, long id);
  -
  -/**
  - * Create a new connection using APR primitives.  This is basically a
  - * wrapper around ap_new_connection
  - * @param p Pool to allocate data structures out of.
  - * @param server The server to create the connection for
  - * @param conn_socket The socket we are creating the connection on.
  - * @param id ID of this connection; unique at any point in time.
  - */
  -conn_rec *ap_new_apr_connection(apr_pool_t *p, server_rec *server, 
  -                                apr_socket_t *conn_socket, long id);
  +                            apr_socket_t *inout, long id);
   
   /**
    * This is the protocol module driver.  This calls all of the
  
  
  
  1.65      +3 -18     httpd-2.0/server/connection.c
  
  Index: connection.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/server/connection.c,v
  retrieving revision 1.64
  retrieving revision 1.65
  diff -u -r1.64 -r1.65
  --- connection.c	2000/12/01 18:49:51	1.64
  +++ connection.c	2000/12/04 19:23:18	1.65
  @@ -269,9 +269,7 @@
   */
   
   conn_rec *ap_new_connection(apr_pool_t *p, server_rec *server, 
  -                            apr_socket_t *inout,
  -			    const struct sockaddr_in *remaddr,
  -			    const struct sockaddr_in *saddr, long id)
  +                            apr_socket_t *inout, long id)
   {
       conn_rec *conn = (conn_rec *) apr_pcalloc(p, sizeof(conn_rec));
       apr_sockaddr_t *sa;
  @@ -284,29 +282,16 @@
       conn->notes = apr_make_table(p, 5);
   
       conn->pool = p;
  -    conn->local_addr = *saddr;
       apr_get_sockaddr(&sa, APR_LOCAL, inout);
  +    conn->local_addr = sa->sa.sin;
       apr_get_ipaddr(&conn->local_ip, sa);
       conn->base_server = server;
       conn->client_socket = inout;
   
  -    conn->remote_addr = *remaddr;
       apr_get_sockaddr(&sa, APR_REMOTE, inout);
  +    conn->remote_addr = sa->sa.sin;
       apr_get_ipaddr(&conn->remote_ip, sa);   
       conn->id = id;
   
       return conn;
  -}
  -
  -
  -
  -conn_rec *ap_new_apr_connection(apr_pool_t *p, server_rec *server, 
  -                                apr_socket_t *conn_socket, long id)
  -{
  -    apr_sockaddr_t *sa_local, *sa_remote;
  -
  -    apr_get_sockaddr(&sa_local, APR_LOCAL, conn_socket);
  -    apr_get_sockaddr(&sa_remote, APR_REMOTE, conn_socket);
  -    return ap_new_connection(p, server, conn_socket, 
  -                             &sa_remote->sa.sin, &sa_local->sa.sin, id);
   }
  
  
  
  1.25      +1 -2      httpd-2.0/server/mpm/beos/beos.c
  
  Index: beos.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/server/mpm/beos/beos.c,v
  retrieving revision 1.24
  retrieving revision 1.25
  diff -u -r1.24 -r1.25
  --- beos.c	2000/10/18 19:12:09	1.24
  +++ beos.c	2000/12/04 19:23:24	1.25
  @@ -320,8 +320,7 @@
   	    return;
       }
       
  -    current_conn = ap_new_apr_connection(p, ap_server_conf, sock, 
  -                                         conn_id);
  +    current_conn = ap_new_connection(p, ap_server_conf, sock, conn_id);
   
       ap_process_connection(current_conn);
       ap_lingering_close(current_conn);
  
  
  
  1.132     +1 -2      httpd-2.0/server/mpm/dexter/dexter.c
  
  Index: dexter.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/server/mpm/dexter/dexter.c,v
  retrieving revision 1.131
  retrieving revision 1.132
  diff -u -r1.131 -r1.132
  --- dexter.c	2000/12/01 21:31:44	1.131
  +++ dexter.c	2000/12/04 19:23:32	1.132
  @@ -414,8 +414,7 @@
   
       ap_sock_disable_nagle(sock);
   
  -    current_conn = ap_new_apr_connection(p, ap_server_conf, sock,
  -                                         conn_id);
  +    current_conn = ap_new_connection(p, ap_server_conf, sock, conn_id);
   
       ap_process_connection(current_conn);
       ap_lingering_close(current_conn);
  
  
  
  1.53      +1 -2      httpd-2.0/server/mpm/mpmt_beos/mpmt_beos.c
  
  Index: mpmt_beos.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/server/mpm/mpmt_beos/mpmt_beos.c,v
  retrieving revision 1.52
  retrieving revision 1.53
  diff -u -r1.52 -r1.53
  --- mpmt_beos.c	2000/10/18 19:12:11	1.52
  +++ mpmt_beos.c	2000/12/04 19:23:38	1.53
  @@ -299,8 +299,7 @@
       long conn_id = my_child_num * HARD_THREAD_LIMIT + my_thread_num;
       int csd;
   
  -    current_conn = ap_new_apr_connection(p, ap_server_conf, sock, 
  -                                         conn_id);
  +    current_conn = ap_new_connection(p, ap_server_conf, sock, conn_id);
   
       ap_process_connection(current_conn);
       ap_lingering_close(current_conn);
  
  
  
  1.127     +1 -2      httpd-2.0/server/mpm/mpmt_pthread/mpmt_pthread.c
  
  Index: mpmt_pthread.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/server/mpm/mpmt_pthread/mpmt_pthread.c,v
  retrieving revision 1.126
  retrieving revision 1.127
  diff -u -r1.126 -r1.127
  --- mpmt_pthread.c	2000/12/01 21:31:47	1.126
  +++ mpmt_pthread.c	2000/12/04 19:23:42	1.127
  @@ -412,8 +412,7 @@
       (void) ap_update_child_status(my_child_num, my_thread_num,  
   				  SERVER_BUSY_READ, (request_rec *) NULL);
   
  -    current_conn = ap_new_apr_connection(p, ap_server_conf, sock,
  -                                         conn_id);
  +    current_conn = ap_new_connection(p, ap_server_conf, sock, conn_id);
   
       ap_process_connection(current_conn);
       ap_lingering_close(current_conn);
  
  
  
  1.26      +1 -2      httpd-2.0/server/mpm/perchild/perchild.c
  
  Index: perchild.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/server/mpm/perchild/perchild.c,v
  retrieving revision 1.25
  retrieving revision 1.26
  diff -u -r1.25 -r1.26
  --- perchild.c	2000/11/10 19:01:32	1.25
  +++ perchild.c	2000/12/04 19:23:47	1.26
  @@ -453,8 +453,7 @@
           ap_sock_disable_nagle(sock);
       }
   
  -    current_conn = ap_new_apr_connection(p, ap_server_conf, sock,
  -                                         conn_id);
  +    current_conn = ap_new_connection(p, ap_server_conf, sock, conn_id);
   
       ap_process_connection(current_conn);
       ap_lingering_close(current_conn);
  
  
  
  1.139     +2 -2      httpd-2.0/server/mpm/prefork/prefork.c
  
  Index: prefork.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/server/mpm/prefork/prefork.c,v
  retrieving revision 1.138
  retrieving revision 1.139
  diff -u -r1.138 -r1.139
  --- prefork.c	2000/12/02 07:08:12	1.138
  +++ prefork.c	2000/12/04 19:23:53	1.139
  @@ -1042,8 +1042,8 @@
   	(void) ap_update_child_status(my_child_num, SERVER_BUSY_READ,
   				   (request_rec *) NULL);
   
  -	current_conn = ap_new_apr_connection(ptrans, ap_server_conf, csd,
  -					 my_child_num);
  +	current_conn = ap_new_connection(ptrans, ap_server_conf, csd, 
  +                                         my_child_num);
   
   	ap_process_connection(current_conn);
           ap_lingering_close(current_conn);
  
  
  
  1.66      +2 -2      httpd-2.0/server/mpm/spmt_os2/spmt_os2.c
  
  Index: spmt_os2.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/server/mpm/spmt_os2/spmt_os2.c,v
  retrieving revision 1.65
  retrieving revision 1.66
  diff -u -r1.65 -r1.66
  --- spmt_os2.c	2000/11/09 00:37:06	1.65
  +++ spmt_os2.c	2000/12/04 19:24:00	1.66
  @@ -964,8 +964,8 @@
   	(void) ap_update_child_status(THREAD_GLOBAL(child_num), SERVER_BUSY_READ,
   				   (request_rec *) NULL);
   
  -	current_conn = ap_new_apr_connection(ptrans, ap_server_conf, csd,
  -                                             THREAD_GLOBAL(child_num));
  +	current_conn = ap_new_connection(ptrans, ap_server_conf, csd,
  +                                         THREAD_GLOBAL(child_num));
   
   	ap_process_connection(current_conn);
           ap_lingering_close(current_conn);
  
  
  
  1.116     +8 -1      httpd-2.0/server/mpm/winnt/mpm_winnt.c
  
  Index: mpm_winnt.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/server/mpm/winnt/mpm_winnt.c,v
  retrieving revision 1.115
  retrieving revision 1.116
  diff -u -r1.115 -r1.116
  --- mpm_winnt.c	2000/11/29 18:18:58	1.115
  +++ mpm_winnt.c	2000/12/04 19:24:04	1.116
  @@ -1121,6 +1121,7 @@
   static void worker_main(int child_num)
   {
       PCOMP_CONTEXT context = NULL;
  +    apr_os_sock_info_t sockinfo;
   
       while (1) {
           conn_rec *c;
  @@ -1137,7 +1138,13 @@
           if (!context)
               break;
           sock_disable_nagle(context->accept_socket);
  -        apr_put_os_sock(&context->sock, &context->accept_socket, context->ptrans);
  +
  +        sockinfo.os_sock = &context->accept_socket;
  +        sockinfo.local   = context->sa_server;
  +        sockinfo.remote  = context->sa_client;
  +        sockinfo.family  = APR_INET;
  +        sockinfo.type    = SOCK_STREAM;
  +        apr_make_os_sock(&context->sock, &sockinfo, context->ptrans);
   
           c = ap_new_connection(context->ptrans, server_conf, context->sock,
                                 (struct sockaddr_in *) context->sa_client,
  
  
  
  1.26      +1 -1      httpd-2.0/modules/proxy/proxy_http.c
  
  Index: proxy_http.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/modules/proxy/proxy_http.c,v
  retrieving revision 1.25
  retrieving revision 1.26
  diff -u -r1.25 -r1.26
  --- proxy_http.c	2000/11/19 14:27:43	1.25
  +++ proxy_http.c	2000/12/04 19:24:10	1.26
  @@ -276,7 +276,7 @@
   				desthost, NULL));
       }
   
  -    origin = ap_new_apr_connection(r->pool, r->server, sock, 0);
  +    origin = ap_new_connection(r->pool, r->server, sock, 0);
       ap_add_output_filter("CORE", NULL, NULL, origin);
   
       clear_connection(r->pool, r->headers_in);	/* Strip connection-based headers */