FreeBSD Bugzilla – Attachment 237426 Details for
Bug 154988
[libfetch] [patch] lib/libfetch/ftp.c add LIST feature
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
revised patch
patch3.txt (text/plain), 1.60 KB, created by
Craig Leres
on 2022-10-17 22:31:53 UTC
(
hide
)
Description:
revised patch
Filename:
MIME Type:
Creator:
Craig Leres
Created:
2022-10-17 22:31:53 UTC
Size:
1.60 KB
patch
obsolete
>Index: lib/libfetch/ftp.c >=================================================================== >--- lib/libfetch/ftp.c (revision 7) >+++ lib/libfetch/ftp.c (working copy) >@@ -780,7 +780,11 @@ > /* make the server initiate the transfer */ > if (verbose) > fetch_info("initiating transfer"); >- e = ftp_cmd(conn, "%s %.*s", oper, filenamelen, filename); >+ if (*filename != '\0') >+ e = ftp_cmd(conn, "%s %.*s", oper, >+ filenamelen, filename); >+ else >+ e = ftp_cmd(conn, "%s", oper); > if (e != FTP_CONNECTION_ALREADY_OPEN && e != FTP_OPEN_DATA_CONNECTION) > goto ouch; > >@@ -871,7 +875,11 @@ > /* make the server initiate the transfer */ > if (verbose) > fetch_info("initiating transfer"); >- e = ftp_cmd(conn, "%s %.*s", oper, filenamelen, filename); >+ if (*filename != '\0') >+ e = ftp_cmd(conn, "%s %.*s", oper, >+ filenamelen, filename); >+ else >+ e = ftp_cmd(conn, "%s", oper); > if (e != FTP_CONNECTION_ALREADY_OPEN && e != FTP_OPEN_DATA_CONNECTION) > goto ouch; > >@@ -1105,6 +1113,7 @@ > { > conn_t *conn; > int oflag; >+ char *cp; > > /* check if we should use HTTP instead */ > if (purl && (strcmp(purl->scheme, SCHEME_HTTP) == 0 || >@@ -1130,6 +1139,18 @@ > if (ftp_cwd(conn, url->doc) == -1) > goto errsock; > >+ cp = url->doc + strlen(url->doc) - 1; >+ if (cp >= url->doc && *cp == '/') { >+ /* list directory */ >+ if (us) { >+ us->size = -1; >+ us->atime = us->mtime = 0; >+ } >+ /* list the directory */ >+ return ftp_transfer(conn, "LIST", url->doc, O_RDONLY, >+ url->offset, flags); >+ } >+ > /* stat file */ > if (us && ftp_stat(conn, url->doc, us) == -1 > && fetchLastErrCode != FETCH_PROTO
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 154988
:
193904
| 237426