httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From minf...@apache.org
Subject cvs commit: httpd-2.0 CHANGES
Date Fri, 21 May 2004 22:05:32 GMT
minfrin     2004/05/21 15:05:32

  Modified:    modules/proxy proxy_ftp.c
               .        CHANGES
  Log:
  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>
  
  Revision  Changes    Path
  1.143     +17 -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.142
  retrieving revision 1.143
  diff -u -r1.142 -r1.143
  --- proxy_ftp.c	19 May 2004 16:15:53 -0000	1.142
  +++ proxy_ftp.c	21 May 2004 22:05:31 -0000	1.143
  @@ -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,23 @@
       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, ';');
  
  
  
  1.1487    +5 -0      httpd-2.0/CHANGES
  
  Index: CHANGES
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/CHANGES,v
  retrieving revision 1.1486
  retrieving revision 1.1487
  diff -u -r1.1486 -r1.1487
  --- CHANGES	21 May 2004 20:05:16 -0000	1.1486
  +++ CHANGES	21 May 2004 22:05:31 -0000	1.1487
  @@ -2,6 +2,11 @@
   
     [Remove entries to the current 2.0 section below, when backported]
   
  +  *) 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>]
  +
     *) Fix a potential segfault if the bind password in the LDAP cache
        is NULL. PR 26686 [Jari Ahonen <jah@progress.com>]
   
  
  
  

Mime
View raw message