ASF Bugzilla – Attachment 13844 Details for
Bug 27834
Proxyied FTP directories without / generate wrong links in listing
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch to add / (before ; if there is one)
mod_proxy_ftp_directory_without_slash.patch (text/plain), 2.35 KB, created by
Pascal Terjan
on 2004-12-27 21:28:26 UTC
(
hide
)
Description:
Patch to add / (before ; if there is one)
Filename:
MIME Type:
Creator:
Pascal Terjan
Created:
2004-12-27 21:28:26 UTC
Size:
2.35 KB
patch
obsolete
>--- httpd-2.0.52/modules/proxy/proxy_ftp.c 2004-12-27 21:09:57.963294904 +0100 >+++ httpd-2.0.52/modules/proxy/proxy_ftp.c.new 2004-12-27 21:10:31.572456860 +0100 >@@ -1504,33 +1504,25 @@ > size = ftpmessage; /* already pstrdup'ed: no copy necessary */ > } > else if (rc == 550) { /* Not a regular file */ >+ char *nuri; >+ char *ext; > ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, r->server, > "proxy: FTP: SIZE shows this is a directory"); >- dirlisting = 1; >- rc = proxy_ftp_command(apr_pstrcat(p, "CWD ", >- ftp_escape_globbingchars(p, path), CRLF, NULL), >- r, origin, bb, &ftpmessage); >- /* possible results: 250, 421, 500, 501, 502, 530, 550 */ >- /* 250 Requested file action okay, completed. */ >- /* 421 Service not available, closing control connection. */ >- /* 500 Syntax error, command unrecognized. */ >- /* 501 Syntax error in parameters or arguments. */ >- /* 502 Command not implemented. */ >- /* 530 Not logged in. */ >- /* 550 Requested action not taken. */ >- if (rc == -1 || rc == 421) { >- return ap_proxyerror(r, HTTP_BAD_GATEWAY, >- "Error reading from remote server"); >- } >- if (rc == 550) { >- return ap_proxyerror(r, HTTP_NOT_FOUND, ftpmessage); >- } >- if (rc != 250) { >- return ap_proxyerror(r, HTTP_BAD_GATEWAY, ftpmessage); >- } >- path = ""; >- len = 0; >- } >+ if ((ext = strstr(r->parsed_uri.path, ";")) != NULL) { >+ *ext++ = '\0'; >+ r->parsed_uri.path = apr_pstrcat(r->pool, r->parsed_uri.path, >+ "/;", ext, NULL); >+ } else { >+ r->parsed_uri.path = apr_pstrcat(r->pool, r->parsed_uri.path, >+ "/", NULL); >+ } >+ nuri = apr_uri_unparse(r->pool, >+ &r->parsed_uri, >+ APR_URI_UNP_REVEALPASSWORD); >+ >+ apr_table_set(r->headers_out, "Location", nuri); >+ return HTTP_MOVED_PERMANENTLY; >+ } > } > > cwd = ftp_get_PWD(r, origin, bb);
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 27834
:
10894
| 13844