HTTP & GOPHER SERVERS FOR JNOS1.10i At last, I did a major cleaning up and extensions to the Gopher and Http servers for JNOS. Also, I did a lot of stream lining and additions to the Ftp server. FTPSERVER: Some cleaning up and code efficiency. RNFR & RNTO commands added to rename files (ported from Tnos). APPE command added to append files. HELP command added. NOOP command fixed. Unix-like relative interpretation of absolute paths. e.g. if anonymous has "/pub" as his firstpath then the commands CWD, RETR, RSME, LIST & NLST would interpret "/yyyy.xxx" as "/pub/yyyy.xxx" if "/yyyy.xxx" is not permitted. A new sysop command "ftpmax" added to restrict the number of concurrent ftp connections. All transfers are done in binary mode for speed. This is not a problem since the DOS and internet EOL's are the same. The ftp permissions work a little differently: if a user has any kind of access to a directory he/she has also LIST access to that directory. Affected files: ftpserv.c ftpserv.h index.c (addition of skipnonwhite() function) glogal.h (declaration of the above) GOPHER: A lot of bug fixes. Logging to the general log file only. Root gopher directory can be changed from nos.cfg file with the line "Gopherdir = /path"; default is "/gopher". The URLs can be given as either "drive:/path" or just "/path". In the latter case, a drive letter is prepended to the path. The default is "c". You can change this with the sysop command "gopher drive ", where 'c' is the drive letter. The CSO database file should be called "cso.dbf" and should reside in the DOS default directory while Jnos is running. Now, the big one: You can run as many gopher servers as you want, each listening on a different port and using a different root directory and CSO databasefile without any additional code as in Ashok's gofer2 server. Just give the command "start gopher ". The root directory for the server listening on port 333 would be "/g333" and, the CSO file would be "cso333.dbf". These root dirs are not automatically created though, unlike the standard one; "/gopher". Addition of "gopher maxcli ","gopher simult " and, "gopher tdisc " sysop commands. "maxcli" sets the number of simultaneous gopher connects allowed; the rest gets immediately disconnected, default is 10. "simult" sets the number of requests served simutaneously, default is 5. e.g. if there are 10 gopher connections the first 5 get their requests served immediately, the rest are kept on hold till 1 one of the first 5 is done and disconnected. "tdisc" sets the number of seconds allowed from the connection till to the request. So that, somebody connot block our gopher server just by connecting and sitting idle there. Default is 180 secs. All file transfers are done in binary mode for speed. Affected Files: gopher.c dbf.c dbf.h commands.h config.c config.h files.c files.h netuser.c makefile pc.c servers.tl socket.h version.c HTTP: This one is a major rewrite. You can serve any kind of file accepted by the web browsers. Make sure that those files have proper extensions, though. Default root hhtp directory is also "/gopher". It can be changed from nos.cfg with "Httpdir = /path". The URL's can be either like "http://server/drive:/path" or "http://server/path". In the latter case, again a default drive is added. You can change this default with the command "http drive ", again. You can start as many http servers as you want each on a different port. The root directory for the server on port 334 would be "/g333". This NOT a typo: port 334 is associated with directory "/g333". So that you can serv from the same root dir via gopher and http by listening on consecutive port. (I hope you wouldn't start an http server on port 0 :-). The file "/gopher/root.htm" is served to the URLs "http://server/" and "http://server/drive:/". If an URL points to a directory then the file "welcome.htm" in that directory is sent if it exists. Otherwise, a selectable directory listing in html format is made on the fly. The files "wwwpre.cat" & "wwwpost.cat" in that directory are pre- and appended to the listing if they exist. Caution: "wwwpre.cat" is the first half of an html file, so, it should have all the head elements. On the other hand, "wwwpost.cat" is the second half the document, so, it must not have any html head elements in it. Addition of "http maxcli ","http simult " and, "http tdisc " commands. They do exactly the same thing the "gopher" commands do for the http server with the same defaults. Alternatively, you can get the "pub/jnos/www/alt/http.c". This version fixes the display of plain text files. It sends the HTTP/1.0 header Content-Type: as text/plain if the requested file doesn't have an ".htm" extension AND it is not binary. The latter is checked using the isbinary() function from ftpsubr.c. Affected Files: http.c commands.h config.c config.h files.c files.h netuser.c makefile pc.c servers.tl socket.h version.c SMTPCLIENT: Added delivery timeout and trying of upto 6 MX records if "usemx" is on. For the delivery timeout added the sysop command "smtp dtimeout " command. Where n is the number of hours after which an undeliverable message is returned back to the sender. Default is 0, i.e. no timeout. Affected files: smtpcli.c domain.c netuser.h HOW TO MAKE: Get a copy of "jnos110i.zip". (ftp://pc.usl.edu/hamradio/jnos/jnos110i.zip) Get "www.zip" from [gopher|http]://ftp.econ.pitt.edu/pub/jnos/www/www.zip or, ftp://ftp.econ.pitt.edu/jnos/www/www.zip. First unzip jnos110i.zip, then www.zip onto it. Modify config.h & makefile then make. COMMENTS: www.zip file includes some of the mods from pc.usl.edu, too. But, probably not all of them. If you supply me with the missing ones I can add them to the www collection, too. You can get the ftp://ftp.econ.pitt.edu/jnos/www/gopsetup.txt for instructions to setup the gopher server and its search engines. Whenever gopsetup.txt and this document are in conflict, this one is the correct one. --------------------------------------- Bug reports, fixes, comments and requests to: Selcuk Ozturk / seost2+@pitt.edu / http://ftp.econ.pitt.edu/selcuk