summaryrefslogtreecommitdiff
path: root/net/libfetch/files/ftp.c
AgeCommit message (Collapse)AuthorFilesLines
2014-06-11Revert bad _GNU_SOURCE change.joerg1-3/+1
2014-06-07Define _GNU_SOURCE by default for glibc-based systems (vasprintf(3)).cheusov1-1/+3
This fixes bootstrap failure on AltLinux.
2014-01-07Apply some explicit int casts for size_t format string arguments.joerg1-5/+6
2012-10-15Use s6_addr32 if present as macro and fallback to memcpy otherwise.joerg1-2/+6
2012-04-07Fix the last commit to not break bootstrap.joerg1-2/+2
2012-04-07Fix build with clang.wiz1-2/+3
2011-11-08More help for stupid glibc headers.joerg1-2/+3
2011-10-02PR#45210: Fix pkgsrc bootstrap with gcc 4.6marino1-5/+4
Libfetch build failure with gcc 4.6 is due to the a couple of assigned variables not getting used. This patch allows systems like Debian and OpenIndiana to bootstrap pkgsrc.
2011-08-21Be a bit nicer to broken GCC array boundary checks.joerg1-12/+14
2011-01-23Handle the case where tm_year is a long variable, from Benny Siegertagc1-4/+4
and Thorsten Glaser. Part of the MirBSD support changes.
2010-08-20libfetch-2.33:joerg1-1/+6
Don't leak FTP connections on errors in fetch or if only stat is requested. Reported via Xavier Chantry.
2010-03-21libfetch-2.31:joerg1-23/+69
PR 43013 by Brook Milligan: fetch(3) violates RFC 1738 for ftp:// URLs if the home directory is not the root directory. Remember the current directory the first time a CWD / CDUP has to be issued. Use the document as full URL if the URL started with two / (quoted or not), otherwise append it to the initial directory.
2010-01-23libfetch-2.29:joerg1-29/+29
Push \r\n up to the users of fetch_putln and remove it. Use send instead of write(v) to avoid SIGPIPE.
2010-01-23Remove is_active.joerg1-3/+1
2010-01-22libfetch-2.28:joerg1-79/+28
Revamp FTP connection cache. Move it to the common layer to be later shared with HTTP (for persistent connection). The application controls how much caching is desired. Drop the reference counting on connections. Add a callback when the cached connection is dropped due to LRU. Over all, this allows more than one session cached per host and sessions cached to different servers.
2010-01-11libfetch-2.27:joerg1-2/+2
The connection sharing didn't handle the case of active transfers correctly and tried to close the connection in that case (PR 42607). Correctly check if there is a transfer going on and just leave the connection alone in that case.
2009-10-15libfetch-2.26:joerg1-10/+30
- Add support to aggressively cache directory listenings, useful for HTTP - Avoid leaking memory in error cases. From Xavier from Arch Linux.
2009-08-16libfetch-2.24:joerg1-1/+4
Fix a bug in the line reading optimisation, which could get confused if the byte following the new line is a NUL. Adresses Arch Linux problem report #15845. Do not reuse a FTP connection if there is currently a transfer active. Some FTP servers hang on the NOOP command. Reported by Manuel Bouyer.
2009-08-06Fix strict aliasing issue which GCC 4.4 complained about.tnn1-41/+40
While we know that "struct sockaddr_storage" has been engineered to alias to all the sockaddr structs, the compiler does not know about this. Thus, code like this may be unsafe to use: struct sockaddr_storage ss; struct sockaddr_in *sin = &ss; sin->sin_port = 0; /* dereferencing here breaks ISO C aliasing rules */ A workaround is to wrap the struct in a union, e.g: union anonymous { struct sockaddr_storage ss; struct sockaddr_in sin; } u; u.sin.sin_port = 0; -- Approved by: joerg
2009-02-22Be nice to ancient NetBSD releases. From Hauke Fath.joerg1-2/+2
2009-02-05libfetch-2.21:joerg1-3/+15
Add support for conditional GET using the 'i' flag. Inspired by the HTTP support for the same feature in FreeBSD by Murray Stokely, but mostly rewritten and extended to work for all protocols.
2008-12-02Be a bit nicer to native linux use and define _GNU_SOURCE here as well.joerg1-1/+6
2008-10-08libfetch-2.18:joerg1-2/+12
Change FTP backend to use passive mode by default and fallback to active mode on syntax errors as discussed with and suggested by Luke Mewburn. Retire 'p' now and introduce 'a' flag to get the old default behavior.
2008-10-06libfetch-2.16:joerg1-2/+9
- only include openssl if the openssl option is present - include arpa/inet.h to get ntohl and friends on older platforms like Interix - use new netdb.h compat code from libnbcompat - include inttypes.h only when present - don't name local variables err, Interix has a symbol like that in default namespace - allow fetch_read to do short read and do more intelligent buffering for header processing; effectively don't do a system call for each byte read
2008-04-25libfetch-2.12:joerg1-2/+2
Make function naming consistent before external code depend on it. Update man page.
2008-04-24libfetch-2.11:joerg1-5/+18
Implement full quoting support in FILE and FTP protocols.
2008-04-24libfetch-2.4.10:joerg1-2/+2
Start URL quoting cleanup. All URLs are now quoted correctly on parsing and when appending URLs. URLs without schema and starting with slash are considered to be file:// URLs.
2008-04-21libfetch-2.8:joerg1-2/+1
Fix a number of small bugs introduced in the last version.
2008-04-19libfetch-2.6:joerg1-19/+9
Change fetchList API to always return lists of full URLs.
2008-04-17Claim copyright on the files I modified a lot.joerg1-1/+2
2008-04-17Avoid using %ju as it is not implemented on all platforms.joerg1-2/+2
2008-04-16Use nbcompat.joerg1-1/+10
2008-04-05Actually return the list, not print it.joerg1-4/+5
2008-04-05Add somewhat ugly, but working directory listening code for FTP.joerg1-20/+67
Note that using glob patterns that match directories can result in recursive expansion, e.g. with tnftpd.
2008-04-04libfetch-2.2:joerg1-1/+11
Add interface to glob a directory.
2008-04-04Use inttypes.h, it is more portable and all that is needed here.joerg1-2/+2
2008-04-02libfetch-2.1:joerg1-57/+26
- remove most of the debug junk - fix a buffer overflow in the config parser - replace stdio usage with a simple abstract IO framework. currently without explicit buffering, but that might be added later
2008-02-07Conditionally declare arg on the existance of the socket options.joerg1-2/+5
2008-02-07Don't use warnx, fprintf(stderr, ...) is good enough. Rename logname tojoerg1-7/+6
login_name to avoid shadowing a global variable.
2008-02-07Conditionally use IP_PORTRANGE sockopt and avoid using ss_len when otherjoerg1-9/+11
operations already provided the value.
2008-02-07Kill more __unused.joerg1-2/+2
2008-02-07Conditionalize sin_len assignment.joerg1-1/+4
2008-02-07Replace u_char, u_short, u_long, u_int32_t with the unabbrivated versionjoerg1-7/+7
or the POSIX type.
2008-02-07Don't use __unused.joerg1-3/+3
2008-02-07bcopy -> memcpyjoerg1-5/+5
2008-02-07Import libfetch-2.0, based on the FreeBSD version of today with a numberjoerg1-0/+1202
of smaller changes to not depend on sys/param.h. This library is intended to replace the tnftp dependency in pkg_install.