Commit Graph

41 Commits

Author SHA1 Message Date
phk
8a9d073182 Correctly figure out that the remove cannot do passive mode.
PR:		6259
Reviewed & slightly modified by:	phk
Submitted by:	Archie Cobbs <archie@whistle.com>
1998-04-11 07:28:53 +00:00
charnier
46f7bb5b5b .Sh AUTHOR -> .Sh AUTHORS. Use .An/.Aq 1998-03-19 07:34:22 +00:00
jkh
5689fa645e environment variables missing from ftpio(3) man page
PR:		5691
Submitted by:	archie@whistle.com
1998-02-10 07:01:51 +00:00
jb
d9ede58894 Change errno usage as a field in a structure and as an argument to a
function from 'errno' to 'error' so that there is no conflict with the
thread-safe definition of errno in errno.h.
1997-12-20 04:06:06 +00:00
fenner
5e6914fff5 Teach ftpErrString to format UNIX errnos, since at least ftpLogin()
can return UNIX errnos.  When UNIX errnos catch up with FTP status
codes (e.g. at 100) a new way will have to be found to tell which
is which.

This allows fetch to print errors like
fetch: ftp.fu-berlin.de: No route to host
instead of
fetch: ftp.fu-berlin.de: Unknown error
1997-10-02 23:26:03 +00:00
jkh
17a85eb79d Correct an ancient bogon which involved trying to read() from a
nuked file descriptor.  This is probably why sysinstall's ftp xfer
occasionally SEGV'd if you left things alone for a long time and
the timeout code got called.  Whoops!
1997-10-01 07:21:41 +00:00
phk
7d1a30911b Many places in the code NULL is used in integer context, where
plain 0 should be used.  This happens to work because we #define
NULL to 0, but is stylistically wrong and can cause problems
for people trying to port bits of code to other environments.

PR:		2752
Submitted by:	Arne Henrik Juul <arnej@imf.unit.no>
1997-09-18 14:08:40 +00:00
jkh
c405f6cc43 Make this C++ safe.
Submitted by:	Nadav Eiron <nadav@barcode.co.il>
1997-05-05 11:18:55 +00:00
bde
b5dfde431c Fixed #include and/or prototype bugs in synopsis. 1997-04-19 15:57:20 +00:00
peter
3447762204 Revert $FreeBSD$ to $Id$ 1997-02-22 15:12:41 +00:00
jkh
b3f71b79b1 Only send QUIT if the last operation didn't time out (otherwise you're
just going to hang forever on the close).
1997-01-21 20:37:59 +00:00
jkh
e7f0bb06e6 Yow! Is my face red... I just noticed (duh) that signal() always installs
the handler with SA_RESTART set, so the system calls I wanted to have the
timeout effect will just restart instead (which is NOT what I wanted).
Sheepishly use sigaction() like a good boy and make timeouts actually do
something.

Also pass errors out more effectively so that fetch(1) actually understands
what went wrong.
1997-01-17 12:51:55 +00:00
jkh
9c0cd3f9df Make the long-awaited change from $Id$ to $FreeBSD$
This will make a number of things easier in the future, as well as (finally!)
avoiding the Id-smashing problem which has plagued developers for so long.

Boy, I'm glad we're not using sup anymore.  This update would have been
insane otherwise.
1997-01-14 07:20:47 +00:00
jkh
71e1f0742d Sanitize and extend SIGALRM timeout handling. 1996-12-17 20:19:35 +00:00
ache
bd56af32e0 Oops, back out previous optimization, don't work as I expect
(lack of sleep)
1996-11-14 09:51:47 +00:00
ache
343e1808a0 Since ftpPutURL not use hostname cache, optimize it by always closing
connection at the end of operation, so it not leave opened
file without a reason.
1996-11-14 09:44:09 +00:00
ache
ad5a80d925 For functions ftpGetURL, ftpPutURL, ftpLogin it was impossible to know
FTP error return code because
1) They return NULL, it means that ftpErrno can't be used because
it takes file pointer
2) They don't have FILE-type argument as f.e. ftpGet/ftpPut to use
it for ftpErrno instead.

For that functions I add yet one int* type argument to store
FTP error return code. It is impossible to add some global variable
for that reason, because user can have multiply FTP connections
opened at the same time.

So, interface changed, major number bumped.
Userland changes will follows.

Minor bugfixes, the code:
Forget to close file in few places, when failure occurse
Forget to NULL cached host name, multiply free is possible
1996-11-14 06:59:41 +00:00
ache
02874dd72a Oops, forget the fact that several ftp connections can be active
at the same time, so add new con_state to avoid QUIT recursion

Still should go to 2.2
1996-11-14 05:22:12 +00:00
ache
e829f811a1 1) Don't allow endless recursion in ftp_close when it attempts to
send QUIT to closed connection.
2) Preserve login failure code, don't overwrite it with ftp_close
code

Should go to 2.2
1996-11-14 05:05:26 +00:00
jkh
b310e967d0 Send PASV instead of PASSIVE.
Submitted-By: Archie Cobbs <archie@whistle.com>
1996-10-10 08:34:27 +00:00
wosch
0afb8360fb delete doubled words, e.g.: "the the" -> "the" 1996-10-05 22:27:30 +00:00
peter
cdf6ad00d5 Make libftpio 64-bit clean.
Major version bumped (by me) since the ftpGet() public interface has
changed (an "int *" becomes and "off_t *")

Submitted by: Jason Thorpe <thorpej@nas.nasa.gov>, PR#1640
1996-09-19 17:28:34 +00:00
jkh
289513699f Intelligently cache previous connection to host if we can still
use it.

Correct a typo bogon that had REST mistyped as RETR.  No wonder fetch's
restart command didn't work! :-(
1996-08-31 22:02:18 +00:00
peter
922fb4c05a cmp -s || install -c ==> install -C 1996-08-30 01:51:09 +00:00
jkh
9f430b38cd D'oh! verbose output should go to stderr. 1996-08-24 09:51:59 +00:00
jkh
a6e0ac7f27 Implement a change suggested by Archie Cobbs - the seekto argument should
be zero'd only if the operation *fails*, indicating that the file
starting offset is effectively zero.  This makes more sense.
1996-08-21 01:23:33 +00:00
jkh
9a98b5cc99 Add an ftpErrString() function for returning human readable failure
codes.
Submitted-By: Archie Cobbs <archie@whistle.com>
1996-08-21 01:12:11 +00:00
jkh
18566fcf8c 1. Add verbose flag to ftp_login()
2. Remove pkg_* support - tcl7.5's channel interface has rendered this
   almost entirely unsupportable (at least in the way it currently stands).
Submitted-By: jmz & jkh
1996-08-03 11:58:54 +00:00
jkh
4639ec0587 Implement an ftpVerbose() hook.
Submitted by: jmz
1996-07-04 00:55:21 +00:00
gpalmer
eb78e733f7 Makefile:
Add -Wall to CFLAGS

ftpio.h:
		It's ftpGetModTime, not ftpModTime
1996-06-26 20:31:11 +00:00
jkh
bcd03ff404 Adjust docs to match reality. 1996-06-24 02:22:15 +00:00
jkh
041b6c2acf Adjust the reference to ftpBinary() in the (unused) TCL wrappers. 1996-06-24 02:19:27 +00:00
jkh
1ad6457300 Fix a bug in the way binary/ascii settings were being done. New
ftpAscii() call sets connection to ascii as counterpart to ftpBinary().
1996-06-22 21:43:56 +00:00
jkh
7f9fc52f81 Make certain small things more consistent with the other stdio man pages. 1996-06-20 15:49:54 +00:00
jkh
d46c38aaa8 Manage control connections a little better for the URL routines.
This will do as a stop-gap until I figure out a more fault-tolerant
way of having deferred closes against the control connection work
without blocking.
1996-06-17 23:16:04 +00:00
jkh
cb43fe50df Make binary mode the default. 1996-06-17 22:10:15 +00:00
jkh
e22c2bed3b Stamp out a potential memory leak.
Make ftpChdir return the server status again - it was more convenient.
1996-06-17 20:36:57 +00:00
jkh
9e567d1111 Rethink and reimpliment the way RESTARTS are handled. The method I inheirited
from jmz was a hopeless kludge (sorry Jean-Marc :) and handled the problem
in the wrong way.  ftpRestart() has now gone away and ftpGet() has grown a
new parameter.
1996-06-17 15:28:08 +00:00
jkh
922a980a2a Add a feature: If the environment variable FTP_PASSIVE_MODE is defined
(the convention as established by pkg_install(1)), select passive mode
FTP automatically.
1996-06-17 12:42:33 +00:00
jkh
23874f9930 Whoops, give the authors all proper credit. 1996-06-17 12:28:50 +00:00
jkh
880dd9d3c6 Bring in a new library `libftpio', so named to avoid clashes with older
packages and also sort of give the (correct) impression that this basically
sits on top of stdio and deals with stream pointers (FILE*).
1996-06-17 12:26:06 +00:00