incubator-mod_ftp-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "William A. Rowe, Jr." <wr...@rowe-clan.net>
Subject Re: svn commit: r487455 - /incubator/mod_ftp/trunk/modules/ftp/ftp_commands.c
Date Fri, 15 Dec 2006 06:25:59 GMT
Sorry I hadn't committed this hours ago... my firewall (who left that on
since the last hotel /blush) had baffled my attempts to test.

I'd really like to scope that sub-pool to avoid creeping memory consumption
between PORT/PASV requests, but we can study this later.

Bill

wrowe@apache.org wrote:
> Author: wrowe
> Date: Thu Dec 14 21:45:36 2006
> New Revision: 487455
> 
> URL: http://svn.apache.org/viewvc?view=rev&rev=487455
> Log:
> Scope error resolved; retain the sockaddr data from command to
> command (this was actually a regression from the pre-2.2 port
> code.)
> 
> Better yet would be a connection sub-pool which we can throw 
> away upon the next PASV/PORT/EPSV/EPRT command.
> 
> Modified:
>     incubator/mod_ftp/trunk/modules/ftp/ftp_commands.c
> 
> Modified: incubator/mod_ftp/trunk/modules/ftp/ftp_commands.c
> URL: http://svn.apache.org/viewvc/incubator/mod_ftp/trunk/modules/ftp/ftp_commands.c?view=diff&rev=487455&r1=487454&r2=487455
> ==============================================================================
> --- incubator/mod_ftp/trunk/modules/ftp/ftp_commands.c (original)
> +++ incubator/mod_ftp/trunk/modules/ftp/ftp_commands.c Thu Dec 14 21:45:36 2006
> @@ -1416,11 +1416,11 @@
>  
>      if (fsc->pasv_bindaddr) {
>          apr_sockaddr_info_get(&sa, fsc->pasv_bindaddr, APR_INET,
> -                              0, 0, r->pool);
> +                              0, 0, c->pool);
>      }
>      else if (c->local_addr->family == APR_INET) {
>          apr_sockaddr_info_get(&sa, c->local_ip, APR_INET,
> -                              0, 0, r->pool);
> +                              0, 0, c->pool);
>      }
>      else {
>          /* XXX: this code above doesn't correspond to fsc->pasv_addr
> @@ -1428,7 +1428,7 @@
>           * address will be 0,0,0,0 not an explicit address.  Bleh
>           */
>          apr_sockaddr_info_get(&sa, NULL, APR_INET,
> -                              0, 0, r->pool);
> +                              0, 0, c->pool);
>      }
>  
>      found_port = 0;
> @@ -1491,10 +1491,10 @@
>  
>      apr_socket_addr_get(&sa, APR_LOCAL, s);
>      if (fsc->pasv_bindaddr) {
> -        a = apr_pstrdup(r->pool, fsc->pasv_bindaddr);
> +        a = apr_pstrdup(c->pool, fsc->pasv_bindaddr);
>      }
>      else if (fsc->pasv_addr) {
> -        a = apr_pstrdup(r->pool, fsc->pasv_addr);
> +        a = apr_pstrdup(c->pool, fsc->pasv_addr);
>      }
>      else {
>          apr_sockaddr_ip_get(&a, sa);
> @@ -1571,7 +1571,7 @@
>          return FTP_REPLY_SYNTAX_ERROR;   
>      }
>  
> -    ip_addr = apr_psprintf(r->pool, "%d.%d.%d.%d",
> +    ip_addr = apr_psprintf(c->pool, "%d.%d.%d.%d",
>                             val[0], val[1], val[2], val[3]);
>  
>      port = ((val[4] << 8) + val[5]);
> @@ -1637,11 +1637,11 @@
>  
>      if (c->local_addr->family == APR_INET) {
>          apr_sockaddr_info_get(&sa, c->local_ip, APR_INET,
> -                              sa->port, 0, r->pool);
> +                              sa->port, 0, c->pool);
>      }
>      else {
>          apr_sockaddr_info_get(&sa, NULL, APR_INET,
> -                              sa->port, 0, r->pool);
> +                              sa->port, 0, c->pool);
>      }
>      apr_socket_opt_set(s, APR_SO_REUSEADDR, 1);
>      rv = apr_socket_bind(s, sa);
> @@ -1660,7 +1660,7 @@
>  
>      apr_socket_addr_get(&fc->clientsa, APR_LOCAL, s);
>      apr_sockaddr_info_get(&fc->clientsa, ip_addr, APR_INET,
> -                          port, 0, r->pool);
> +                          port, 0, c->pool);
>  
>      fc->response_notes = apr_psprintf(r->pool, FTP_MSG_SUCCESS, r->method);
>      fc->passive_created = -1; /* Redundant but just for clarity */
> 
> 
> 

Mime
View raw message