--- proxy_ftp.c.orig 2004-03-22 11:36:51.397510760 +0100 +++ proxy_ftp.c 2004-03-22 11:37:16.980621536 +0100 @@ -793,6 +793,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; @@ -847,13 +848,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_pstrcat(p,"URI cannot be parsed: ", *url, + NULL)); + } + 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, ';');