# Revision 1.30  1993/06/18  16:55:51  lmjm
# Drop the uses of $con.
#
# Revision 1.29  1993/06/04  15:20:34  lmjm
# Patch by Joergen Haegg <jh@efd.lth.se> to spot when no password is required.
#
# Revision 1.28  1993/06/03  00:52:17  lmjm
# Use old syle open_data_socket.
#
# Revision 1.27  1993/06/03  00:26:41  lmjm
# Tried to get new open_data_socket to work with dir_* routines - failed.
#
# Revision 1.26  1993/05/27  00:15:40  lmjm
# Zapped timout causing undef in expectgot.
# Increased timeouts.
# Use chat's listen to open PORT for file transfers.
# Got rid of middle arg of expect call - made them comments.
#
# Revision 1.25  1993/05/07  23:36:07  lmjm
# Corrected typo in expect code causing long continuations to fail.
# Timeouts are no longer a fatal error.
# Improved the balance in the timeouts.
#
# Revision 1.24  1993/05/06  23:13:29  lmjm
# Major cleanup.
# Reset ALRM when done.
# Try to reset if cannot write local file on get.
# Spot unreadable remote files.
# Cleaned up *MAJOR* dumb code in open_data_socket.
#
# Revision 1.23  1993/05/06  21:14:19  lmjm
# Use the new mapin.
# Correct put code.
#
# Revision 1.22  1993/04/29  23:31:26  lmjm
# Added sample prog as a comment.
# Clear out chat string that may be large.
# Moved some declarations out of loops and used packageless functin names to
# save space.
#
# Revision 1.21  1993/04/28  20:45:26  lmjm
# Made the RETR/STOR commands report the file.
#
# Revision 1.20  1993/04/27  19:53:49  lmjm
# Allow for filename mapping before Xfer.  Useful for VMS -> unix.
#
# Revision 1.19  1993/04/26  19:58:33  lmjm
# Added missing trailing ; - for older perl's
#
# Revision 1.18  1993/04/25  13:15:43  lmjm
# Keep track of wether the service is open and avoid writing to dead sockets.
# Added SIGPIPE handler if ftp'set_signals called.
# Added a version var.
#
# Revision 1.17  1993/04/21  10:06:54  lmjm
# Send all status reports to STDERR not to STDOUT (to allow use by ftpcat).
# Allow target file to be '-' meaning STDOUT
# Added ftp'quote
#
# Revision 1.16  1993/01/28  18:59:05  lmjm
# Allow socket arguemtns to come from main.
# Minor cleanups - removed old comments.
#
# Revision 1.15  1992/11/25  21:09:30  lmjm
# Added another REST return code.
#
# Revision 1.14  1992/08/12  14:33:42  lmjm
# Fail ftp'write if out of space.
#
# Revision 1.13  1992/03/20  21:01:03  lmjm
# Added in the proxy ftp code from Edwards Reed <err@cinops.xerox.com>
# Added  ftp'delete from Aaron Wohl <aw0g+@andrew.cmu.edu>
#
# Revision 1.12  1992/02/06  23:25:56  lmjm
# Moved code around so can use this as a lib for both mirror and ftpmail.
# Time out opens.  In case Unix doesn't bother to.
#
# Revision 1.11  1991/11/27  22:05:57  lmjm
# Match the response code number at the start of a line allowing
# for any leading junk.
#
# Revision 1.10  1991/10/23  22:42:20  lmjm
# Added better timeout code.
# Tried to optimise file transfer
# Moved open/close code to not leak file handles.
# Cleaned up the alarm code.
# Added $fatalerror to show wether the ftp link is really dead.
#
# Revision 1.9  1991/10/07  18:30:35  lmjm
# Made the timeout-read code work.
# Added restarting file gets.
# Be more verbose if ever have to call die.
#
# Revision 1.8  1991/09/17  22:53:16  lmjm
# Spot when open_data_socket fails and return a failure rather than dying.
#
# Revision 1.7  1991/09/12  22:40:25  lmjm
# Added Andrew Macpherson's patches for hosts without ip forwarding.
#
# Revision 1.6  1991/09/06  19:53:52  lmjm
# Relaid out the code the way I like it!
# Changed the debuggin to produce more "appropriate" messages
# Fixed bugs in the ordering of put and dir listing.
# Allow for hash printing when getting files (a la ftp).
# Added the new commands from Al.
# Don't print passwords in debugging.
#
# Revision 1.5  1991/08/29  16:23:49  lmjm
# Timeout reads from the remote ftp server.
# No longer call die expect on fatal errors.  Just return fail codes.
# Changed returns so higher up routines can tell whats happening.
# Get expect/accept in correct order for dir listing.
# When ftp_show is set then print hashes every 1k transfered (like ftp).
# Allow for stripping returns out of incoming data.
# Save last error in a global string.
#
# Revision 1.4  1991/08/14  21:04:58  lmjm
# ftp'get now copes with ungetable files.
# ftp'expect code changed such that the string_to_print is
# ignored and the string sent back from the remote system is printed
# instead.
# Implemented patches from al.  Removed spuiours tracing statements.
#
# Revision 1.3  1991/08/09  21:32:18  lmjm
# Allow for another ok code on cwd's
# Rejigger the log levels
# Send \r\n for some odd ftp daemons
#
# Revision 1.2  1991/08/09  18:07:37  lmjm
# Don't print messages unless ftp_show says to.
#
# Revision 1.1  1991/08/08  20:31:00  lmjm
# Initial revision
