FreeBSD Bugzilla – Attachment 10569 Details for
Bug 21144
[PATCH] fetch(1): don't bonk if ftp SIZE isn't supproted; add LIST feature
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
file.diff
file.diff (text/plain), 2.50 KB, created by
Craig Leres
on 2000-09-09 09:00:01 UTC
(
hide
)
Description:
file.diff
Filename:
MIME Type:
Creator:
Craig Leres
Created:
2000-09-09 09:00:01 UTC
Size:
2.50 KB
patch
obsolete
>diff -c -r1.1 ftp.c >*** ftp.c 2000/09/08 09:48:25 1.1 >--- ftp.c 2000/09/09 07:17:17 >*************** >*** 451,457 **** > /* make the server initiate the transfer */ > if (verbose) > _fetch_info("initiating transfer"); >! e = _ftp_cmd(cd, "%s %s", oper, _ftp_filename(file)); > if (e != FTP_OPEN_DATA_CONNECTION) > goto ouch; > >--- 451,460 ---- > /* make the server initiate the transfer */ > if (verbose) > _fetch_info("initiating transfer"); >! if (*_ftp_filename(file) != '\0') >! e = _ftp_cmd(cd, "%s %s", oper, _ftp_filename(file)); >! else >! e = _ftp_cmd(cd, "%s", oper); > if (e != FTP_OPEN_DATA_CONNECTION) > goto ouch; > >*************** >*** 541,547 **** > /* make the server initiate the transfer */ > if (verbose) > _fetch_info("initiating transfer"); >! e = _ftp_cmd(cd, "%s %s", oper, _ftp_filename(file)); > if (e != FTP_OPEN_DATA_CONNECTION) > goto ouch; > >--- 544,553 ---- > /* make the server initiate the transfer */ > if (verbose) > _fetch_info("initiating transfer"); >! if (*_ftp_filename(file) != '\0') >! e = _ftp_cmd(cd, "%s %s", oper, _ftp_filename(file)); >! else >! e = _ftp_cmd(cd, "%s", oper); > if (e != FTP_OPEN_DATA_CONNECTION) > goto ouch; > >*************** >*** 782,787 **** >--- 788,794 ---- > fetchXGetFTP(struct url *url, struct url_stat *us, char *flags) > { > int cd; >+ register char *cp; > > if (_ftp_use_http_proxy()) > return fetchXGetHTTP(url, us, flags); >*************** >*** 793,806 **** > /* change directory */ > if (_ftp_cwd(cd, url->doc) == -1) > return NULL; > >! /* stat file */ >! if (us && _ftp_stat(cd, url->doc, us) == -1 >! && fetchLastErrCode != FETCH_UNAVAIL) >! return NULL; >! >! /* initiate the transfer */ >! return _ftp_transfer(cd, "RETR", url->doc, "r", url->offset, flags); > } > > /* >--- 800,824 ---- > /* change directory */ > if (_ftp_cwd(cd, url->doc) == -1) > return NULL; >+ >+ cp = url->doc + strlen(url->doc) - 1; >+ if (cp >= url->doc && *cp == '/') { >+ if (us) { >+ us->size = -1; >+ us->atime = us->mtime = 0; >+ } >+ /* list the directory */ >+ return _ftp_transfer(cd, "LIST", url->doc, "r", url->offset, flags); >+ } else { >+ /* stat file */ >+ if (us && _ftp_stat(cd, url->doc, us) == -1 >+ && fetchLastErrCode != FETCH_UNAVAIL >+ && fetchLastErrCode != FETCH_PROTO) >+ return NULL; > >! /* initiate the transfer */ >! return _ftp_transfer(cd, "RETR", url->doc, "r", url->offset, flags); >! } > } > > /*
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 21144
: 10569