httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From traw...@apache.org
Subject cvs commit: httpd-2.0/modules/proxy proxy_ftp.c
Date Sat, 03 Jul 2004 12:48:02 GMT
trawick     2004/07/03 05:48:02

  Modified:    .        Tag: APACHE_2_0_BRANCH CHANGES STATUS
               modules/proxy Tag: APACHE_2_0_BRANCH proxy_ftp.c
  Log:
  backport this from 2.1-dev:
  
    Small fix to allow reverse proxying to an ftp server. Previously
    an attempt to do this would try and connect to 0.0.0.0, regardless
    of the server specified.
  
  PR:            24922
  Submitted by:  Pascal Terjan <pterjan@linuxfr.org>
  Reviewed by:   minfrin, nd, jim, trawick
  
  (note: this commit includes minor style-only repairs to the
  original patch; see r1.144 of proxy_ftp.c)
  
  Revision  Changes    Path
  No                   revision
  No                   revision
  1.988.2.310 +5 -0      httpd-2.0/CHANGES
  
  Index: CHANGES
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/CHANGES,v
  retrieving revision 1.988.2.309
  retrieving revision 1.988.2.310
  diff -u -r1.988.2.309 -r1.988.2.310
  --- CHANGES	2 Jul 2004 12:37:27 -0000	1.988.2.309
  +++ CHANGES	3 Jul 2004 12:48:00 -0000	1.988.2.310
  @@ -1,5 +1,10 @@
   Changes with Apache 2.0.51
   
  +  *) Small fix to allow reverse proxying to an ftp server. Previously
  +     an attempt to do this would try and connect to 0.0.0.0, regardless
  +     of the server specified. PR 24922
  +     [Pascal Terjan <pterjan@linuxfr.org>]
  +
     *) Add the NOTICE file to the rpm spec file in compliance with the
        Apache v2.0 license. [Graham Leggett]
    
  
  
  
  1.751.2.946 +1 -8      httpd-2.0/STATUS
  
  Index: STATUS
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/STATUS,v
  retrieving revision 1.751.2.945
  retrieving revision 1.751.2.946
  diff -u -r1.751.2.945 -r1.751.2.946
  --- STATUS	2 Jul 2004 17:42:54 -0000	1.751.2.945
  +++ STATUS	3 Jul 2004 12:48:00 -0000	1.751.2.946
  @@ -128,13 +128,6 @@
          docs/manual/mod/mod_ldap.xml r1.12
          +1 minfrin, bnicholes, trawick
   
  -    *) Small fix to allow reverse proxying to an ftp server. Previously
  -       an attempt to do this would try and connect to 0.0.0.0, regardless
  -       of the server specified.
  -         modules/proxy/proxy_ftp.c r1.143
  -       PR 24922 [Pascal Terjan <pterjan@linuxfr.org>]
  -       +1: minfrin, nd, jim
  -
       *) Prevent Win32 pool corruption at startup
            server/mpm/winnt/child.c: r1.36 
          +1: ake, trawick, nd, stoddard
  
  
  
  No                   revision
  No                   revision
  1.130.2.9 +18 -6     httpd-2.0/modules/proxy/proxy_ftp.c
  
  Index: proxy_ftp.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/modules/proxy/proxy_ftp.c,v
  retrieving revision 1.130.2.8
  retrieving revision 1.130.2.9
  diff -u -r1.130.2.8 -r1.130.2.9
  --- proxy_ftp.c	2 Jun 2004 22:40:23 -0000	1.130.2.8
  +++ proxy_ftp.c	3 Jul 2004 12:48:01 -0000	1.130.2.9
  @@ -754,6 +754,7 @@
       char buffer[MAX_STRING_LEN];
       char *ftpmessage = NULL;
       char *path, *strp, *type_suffix, *cwd = NULL;
  +    apr_uri_t uri; 
       char *user = NULL;
   /*    char *account = NULL; how to supply an account in a URL? */
       const char *password = NULL;
  @@ -808,13 +809,24 @@
       if (r->method_number != M_GET)
           return HTTP_NOT_IMPLEMENTED;
   
  -
       /* We break the URL into host, port, path-search */
  -    connectname = r->parsed_uri.hostname;
  -    connectport = (r->parsed_uri.port != 0)
  -        ? r->parsed_uri.port
  -        : apr_uri_port_of_scheme("ftp");
  -    path = apr_pstrdup(p, r->parsed_uri.path);
  +    if (r->parsed_uri.hostname == NULL) {
  +        if (APR_SUCCESS != apr_uri_parse(p, url, &uri)) {
  +            return ap_proxyerror(r, HTTP_BAD_REQUEST,
  +                apr_psprintf(p, "URI cannot be parsed: %s", url));
  +        }
  +        connectname = uri.hostname;
  +        connectport = uri.port;
  +        path = apr_pstrdup(p, uri.path);
  +    }
  +    else {
  +        connectname = r->parsed_uri.hostname;
  +        connectport = r->parsed_uri.port;
  +        path = apr_pstrdup(p, r->parsed_uri.path);
  +    }
  +    if (connectport == 0) {
  +        connectport = apr_uri_port_of_scheme("ftp");
  +    }
       path = (path != NULL && path[0] != '\0') ? &path[1] : "";
   
       type_suffix = strchr(path, ';');
  
  
  

Mime
View raw message