tcpcmd Change Notes


1.0B7 CHANGE NOTES

1. tcpcmd.intefaces.tcpWrite (4/8/97)

Now uses buffered writes when using NetEvents to stop overrunning NetEvent's event queue.

2. tcpcmd.sendMail (4/3/97)

Was failing to open disk file as source for message text if parameter was of type filespec. Now properly handles filespec and alias parameter types.

3. tcpcmd.interfaces.openStream (3/23/97)

Now better reports a connect timeout when using NetEvents

4. tcpcmd.interfaces.openStream (3/9/97)

openStream was not handling a timeout at connect with NetEvents. The built-in UCMD was not affected.
Fixed by simulating a system error "-23016" [timeout] TCP error, which is now correctly reported to the calling script.

5. NetEvents startup (3/9/97)

A previous version of tcpcmd included a system.startup script that would launch NetEvents when Frontier launches.
This script has been removed and calls to netevents.launch() are included in key tcpcmd.interfaces scripts which are first to be used.
Now it doesn't matter if you pre-launch NetEvents or not. tcpcmd will launch it for you when necessary.

6. tcpcmd.ftp.putFile (3/8/97)

Was using wrong transfer mode for uploading files that had no file extension (e.g. ".txt" or ".html"). I was calling getFileTypeAndCreator when I really shouldn't have.
Now, we merely use file.type() to get the actual type of the file. 'TEXT' files are sent as ASCII, anything else is sent as BINARY.

7. tcpcmd.interfaces.openStream (3/7/97)

Was returning a bogus error message if NetEvents was being used and had not been launched.
openStream now returns a scriptError if NetEvents is not running.

8. tcpcmd.getMethodComplex (3/7/97)

Bill Seitz reported that getMethodComplex (and thus, getURL) would not work on some hosts serving multiple virtual domains.
The fix was to include a new request header field, "Host", which the host will use to determine the actual location of the requested object.

9. New debugging aid (3/5/97)

Set tcpcmd.logging to true to log all transmitted commands and received host responses to a log outline. This feature uses the log suite. It is only useful for FTP, SMTP, and POP scripts.
The log outlines are uniquely identified by threadID so that you can have a log for each tcp/ip session/listener/thread. These log outlines proliferate quickly; don't forget to delete them.
NOTE: FTP and POP Users: Your FTP or POP password will be displayed in clear text in the logging window. Please use with appropriate discretion.

10. tcpcmd.http.checkHTTPprotectedURL (3/1/97)

Problem: was treating "400 BAD REQUEST" as a file-not-found situation. Hosts that don't support the HEAD request can return this message.
Now, if "400" is returned, tcpcmd.getURL is used to retrieve the header and the (discarded) body. A safety check keeps this from becoming an endless loop.

11. tcpcmd.interfaces.tcpWrite (2/26/97)

Was screwing up line-endings when using the UCMD. Did not affect NetEvents users. Fixed.

12. tcpcmd.interfaces.sendCommand (2/25/97)

Corrected a bug when passing an actual record as data; not the address. This should only affect those writing their own scripts that call tcpcmd.interfaces.sendCommand.

13. tcpcmd.tcpcmdStartup (which is copied to system.startup) (2/25/97)

Had the code within an "on" handler, but no script to execute it! Now script is not in handler. Also added full path specfications to the objects referenced.

14. BIG NEWS! (2/23/97)

tcpcmd now supports NetEvents or tcpcmd's built-in UCMD. Your choice! Set the flag at tcpcmd.useUCMD to 'TRUE' if you want to use the UCMD. Set it false, and NetEvents will be used.
Note: This version currently requires the UCMD for the "myAddress" and RFC time functions and the UCMD will be temporarily used for these functions regardless of the flag setting.
All existing scripts should work with NetEvents without changes!

15. tcpcmd.interfaces reworked

The plan was to make existing scripts compatible with NetEvents. Since the "glue" between the scripts and the communications package is in the interfaces table, this is where the bulk of the changes were made.
New optional parameters were added to tcpcmd.interfaces.bufferedPut and tcpcmd.interfaces.bufferedGet to support the behavior of NetEvents:

We need to "tickle" the command stream in an ftp file transfer so that NetEvents doesn't automatically close the command stream during a lengthy file transfer.
These new optional parameters are ignored if the UCMD is in use.

tcpcmd.interfaces.tcpRead accepts a 'bufSize' value of infinity to indicate that the caller wants to read until certain "host is done" conditions are met. This allows tcpRead to mimic the behavior of the UCMD when using NetEvents.

16. Two changes in ftp table

These were the only changes outside of the interfaces table required to make all the client verbs work with NetEvents.
tcpcmd.ftp.getFile and tcpcmd.ftp.putFile were modified to add the command stream parameter in the calls to bufferedGet and bufferedPut (respectively). This does not affect any scripts calling getFile or putFile.

17. Servers

The stopServer scripts in the finger and http servers were modified to support NetEvents or the UCMD.
The servers may be revised in the future once a final framework or daemon materializes. The tcpcmd servers work with the UCMD, but you may have better luck with NetEvents.

18. sendMail

New optional parameter 'mimeType', with default to "text/plain". This allows scripters to set the mimeType of the message to other than "plain", for example, to send text with HTML markup ("text/html").
Not as good as attachments, but, hey, it's a start. :)

19. Timeouts

Note: Timeouts are not user-adjustable when using NetEvents. NetEvents handles timeouts internally and won't "hang up" indefinitely. Existing scripts will work with NetEvents without changes.
The following notes pertain mostly when using the built-in UCMD.
New table, tcpcmd.timeouts, contains default timeout values for each protocol. This allows "tuning" the timeouts for your particular application. Defaults supplied are all 60 seconds.
Don't mess with these unless you really have to. There are some inter-relationships not fully explored.
Optional 'timeout' parameter added to most hi- and mid-level verbs.

20. transferAs and Internet Config (11/3/96)

The 'transferAs' parameter is now defaulted to 'nil' in most cases. You no longer have to specify a transfer method; tcpcmd will make a fairly intelligent decision as to whether to use "A" (ASCII) or "I" (BINARY).
If you are using Internet Config, tcpcmd will use the file mapping settings in IC to determine the file type, creator, and transfer method.
If you don't use IC, or if the particular mapping is not defined in IC, tcpcmd will treat files ending with ".htm", ".html", ".asc", ".txt", ".hqx", ".uu", and ".uue" as text files.
Their creator will be that which is stored in tcpcmd.properties.textFileCreator.

21. Buffered uploads/downloads (11/3/96)

tcpcmd.download and tcpcmd.upload and all the file transfer verbs downstream take advantage of buffered disk i/o.
New verb: tcpcmd.interfaces.bufferedGet
New verb: tcpcmd.interfaces.bufferedPut
Optional parameter 'bufSize' is now in all affected verbs. Default is 5120 bytes.
Since some Frontier string handling verbs are still used, twice as much memory as bufSize can be consumed.

22. Added new verb, tcpcmd.lookupDNS

Pass this verb an ip address string (e.g. "206.161.67.111") or a domain name (e.g. "www.erols.com") and the opposite form is returned.

23. FTP now supports passive and active transfers

If the host supports passive, the ftp data transfer commands will attempt to use passive transfers.
If not, active transfers are used. If an attempt to open a passive connection fails, an active transfer is used instead.
There is a weird bug about passive port numbers > 32767 when this can happen.

24. FTP now supports iso8859 translation

Added optional 'iso8859' parameter to tcpcmd.download, tcpcmd.upload, tcpcmd.ftp.copyToHost, tcpcmd.ftp.copyFromHost, tcpcmd.ftp.getFile, tcpcmd.ftp.putFile.
If iso8859 == true, the files are translated using the new translation verbs in tcpcmd.iso.
I debated about using string.iso8859encode, but there are issues about sharing its table: either you have to lock it (causing delays for other processing), or you run the risk of someone changing the table out from underneath you.

25. New tcpcmd.iso table with two new verbs

Provided for character translation in FTP transfers
This is NOT the same as string.iso8859encode, since it deals with single characters, not the html version of the character.
Included are two tables of conversion values to/from ISO-8859-1
New verb: tcpcmd.iso.translateFromISO does a character-by-character table lookup
New verb: tcpcmd.iso.translateToISO does a character-by-character table lookup

26. tcpcmd.checkURL

11/3/96 - Now always returns a string -- never a scriptError. Relaxes calling script requirements to use try/else construct. Now, the returned strings contain either "Success", "Error" or "Redirected" (with additional text).
12/16/96 - Was failing to deal with any version of HTML other than 1.0. That's now been fixed; checkURL ignores the version of HTML returned.
12/16/96 - Added new error messages for DNS errors

27. tcpcmd.download (11/10/96)

Removed parameter-prompting dialogs if download was called without any parameters.
I may make a MacBird card for this, ala Fetch.

28. tcpcmd.upload (11/10/96)

Removed parameter-prompting dialogs if upload was called without any parameters.
I may make a MacBird card for this, ala Fetch.

29. tcpcmd.examples.countMyMsgs

Wasn't always closing the stream properly on an error condition.

30. tcpcmd.examples.fingerServer

New sample script has one-liners to start a server, run client verbs against that server, then stop the server.

31. tcpcmd.examples.httpServer

New sample script has one-liners to start a server, run client verbs against that server, then stop the server.

32. tcpcmd.examples.outLineFTPsite

Tweaked visitDirectory handler a bit and added support for handling dotted directories.
12/28/96 - Had to fiddle some more with handling empty directories. Maybe have it fixed now! ;)

33. tcpcmd.finger (11/16/96)

Changed dialog.alert to scriptError if an error occurred. Check for error -23015 (openFailed) and set tryError to more meaningful error message.

34. tcpcmd.ftp.copyFromHost

Replaced use of file.sureFolder with toys.sureFilePath and now creates folders properly
Moved folder tracking code from trackFolders local function to handleDirectoryEntry local function

35. tcpcmd.ftp.copyToHost

Dick Munroe found a problem with passing putFile the entire path name, not just the filename

36. tcpcmd.ftp.deleteDirectory (11/3/96)

Wasn't backing out of the deleted directory, causing subsequent directory operations to fail. Now moves up the directory path as directories are deleted.

37. tcpcmd.ftp.getFile (11/3/96)

BUFFERED get! Only uses 2 x bufSize, no matter how big the file.
Attempts passive mode if host supports it, falls back to active if problem opening pasv port
Now correctly closes stream on LIST error
Changed parameter 'format' to 'transferAs' to be more consistent with higher-level verbs

38. tcpcmd.ftp.getFTPurl (11/3/96)

Handles binary and text file downloads. Supports bufSize parameter for new buffered getFile

39. tcpcmd.ftp.getFileNamePosition

Wasn't handling empty directories correctly with NetPresenz

40. tcpcmd.ftp.getHostDirectory

now correctly closes stream on LIST error

41. tcpcmd.ftp.logon

Password command not used if no password is specified
Password defaults to user.mailAddress if none is specified, conforming better to most host's anonymous password preferences.
Enabled use of ftp help command to establish if host supports passive and MacBinary
12/23/96 - added use of SYST command to determine if Windows NT server. If so, also send "SITE DIRSTYLE" command to turn off DOS-style listings

42. tcpcmd.ftp.openDataStream

New verb. Tries to open passive, if tcpcmd.ftp.logon found that host supports it. Uses active if host doesn't support passive, or attempt to open passive failed

43. tcpcmd.ftp.openPassiveStream

Wasn't parsing pasv response properly from DEC host - fixed.

44. tcpcmd.ftp.putFile (11/3/96)

BUFFERED put! Only uses 2 x bufSize, no matter how big the file.
Attempts passive mode if host supports it, falls back to active if problem opening pasv port
Changed parameter 'format' to 'transferAs' to be more consistent with higher-level verbs

45. tcpcmd.ftp.retr

12/23/96 - Now allows responses 125-150, which accomodates Dave's new NT server's way or responding

46. tcpcmd.ftp.site

12/23/96 - New verb to send SITE commands to host.

47. tcpcmd.ftp.syst

12/23/96 - New verb to send SYST command to host.

48. tcpcmd.ftp.sureFilePath

New verb that ensures target directory on ftp host exists
Creates any intervening directories necessary

49. tcpcmd.ftp.visitDirectory

Fixed problem dealing with 'dotted' directories. Now they are ignored and are not traversed.
Had too many parameters for the callback routine (handleDirectoryEntry)
Removed optional trackFolders parameter since it was never used

50. tcpcmd.ftp.openPassiveStream

We try harder to parse the host response to determine ip address and port to use

51. tcpcmd.gopher.getGopherURL

added optional timeout parameter (default to 60 secs)

52. tcpcmd.http.getMethodComplex (11/3/96)

Better support for binary files. Uses InternetConfig to determine whether to transfer as ascii or binary.
getMethodComplex uses buffered file techniques when saving an http url to disk
Added check for relative anchors in urls and remove them if found
Added call to closeStream when any error reading or writing stream
The contents of parameter table have been solidified. There are "standard" elements (some of which are required, like the url); the rest are now treated as optional, user-supplied http header parameters.
These items are "fixed" in their uses. That is, they have definitions that must be followed

url
proxy
method
argTable -- where form (POST) arguments are stored
httpSearchArgs
pathArgs

Any other items found in the table are treated as http header parameters:

no sanity check is performed -- you must make them correct
don't put the colon on the header

See tcpcmd.http.sampleParamTableFull for examples

53. tcpcmd.http.checkHTTPurl

Improved error handling and return strings by trapping connection and i/o errors separately
Now correctly parses return from server when entire page and not just header is returned.

54. tcpcmd.interfaces.getFileTypeAndCreator (11/3/96)

New verb uses IC (if found) to determine file type and creator. It makes a reasonable guess if IC not used or IC mapping not found.
This verb is used in ftp verbs and http.getMethodComplex

55. tcpcmd.interfaces.getResponse

Now properly handles multi-line responses.
New optional parameter 'stdResp'. If true, getResponse returns when it encounters a line of text conforming to one of the following formats:

### text
###-text
+OK text
-ERR text

56. tcpcmd.interfaces.sendCommand

Now properly collects multi-line responses

57. tcpcmd.interfaces.tcpWaitForConnectAsync

1/15/97 - Preston Holmes and Brian Andresen uncovered a bug with the logic I used below.
Now, both parameter's don't have to be specified in order for the stream record to be stored in saveAddr. threadID will be ignored IF saveAddr is omitted.
The change in the servers that allows tracking the listener thread required the addition of a 'threadID' optional parameter.
If it and the 'saveAddr' parameter are both given, then the threadID is stored along with the record at the address specfied in saveAddr.

58. tcpcmd.interfaces.rfcStringToDate

Changed name of parameter from 'dateString' to 'theDate'. Made it an optional parameter and defaulted it to clock.now().

59. tcpcmd.sendmail

Now handles better data types for distribution lists. Can pass a table address, list type or a comma-delimited string of email addresses.

60. tcpcmd.servers.finger.listener

Now close to Dave Winer's generic server approach that eliminates semaphores and spawning threads
Keeps track of listener's thread in the net session record. This helps with server tear-down.

61. tcpcmd.servers.finger.stopServer

Added non-fatal attempt to kill listener's thread, based on the threadID stored in the associated net session

62. tcpcmd.servers.http.listener

Now close to Dave Winer's generic server approach that eliminates semaphores and spawning threads
Keeps track of listener's thread in the net session record. This helps with server tear-down.
Took care of determining whether file path or odb address was rootPath

63. tcpcmd.servers.http.stopServer

Added non-fatal attempt to kill listener's thread, based on the threadID stored in the associated net session

64. tcpcmd.pop.logon

Was not logging off properly when given bad userid or password - fixed
Changed scriptError return message to be what the host returned, rather than assume what the error meant

65. tcpcmd.pop.logoff

Put quit command and closestream each under their own try statement
Errors are ignored -- seems to work w/o problems here

66. tcpcmd.properties

Renamed textFileType to textFileCreator (which is what it really is) and changed all references to it

67. tcpcmd.smtp.endMessage

1/21/97 - A user reported that the 'qmail' server would not accept end-of-message as Leonard and I had attempted to do. I reverted to a more "brute force" approach, which seemed to fix the problem with qmail.
Had typo; would call "tryError" instead of scriptError if an error occurred


OTHER CHANGE NOTES

1. changeNotes

2. changeNotesb72

3. changeNotesb71


This page was last built on 8/1/98; 10:28:39 PM ET by Alan German, asg@erols.com. At the moment, I am using Macintosh OS to work on this website. The "Electric Cactus" graphic is based on original artwork owned by UserLand Software and is used with their permission.