home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Internet Tools 1993 July / Internet Tools.iso / RockRidge / info-service / gopher / gopher_protocol / Gopher+ / Gopher+.text < prev    next >
Encoding:
Text File  |  1992-09-04  |  31.4 KB  |  950 lines

  1. Gopher+
  2.  
  3. proposed enhancements to the internet Gopher protocol
  4.  
  5.  
  6. Bob Alberti, Farhad Anklesaria, Paul Lindner, Mark P. McCahill, Daniel Torrey    
  7.  
  8. University of Minnesota Microcomputer and Workstation Networks Center
  9.  
  10. Summer 1992
  11.  
  12.  
  13.  
  14. gopher+  n.  1. Hardier strains of mammals of the family 
  15. Geomyidae.  2. (Amer. colloq.) Native or inhabitant of Minnesota, 
  16. the Gopher state, in full winter regalia (see PARKA).  3. (Amer. 
  17. colloq.) Executive secretary.  4. (computer tech.) Software 
  18. following a simple protocol for burrowing through a TCP/IP 
  19. internet, made more powerful by simple enhancements (see CREEPING 
  20. FEATURISM).
  21.  
  22.  
  23.  
  24. Abstract
  25.  
  26. The internet Gopher protocol was designed for distributed document search and retrieval. 
  27. The document The internet Gopher protocol: a distributed document search 
  28. and retrieval protocol describes the basic protocol and has an overview of how to 
  29. implement new client and server applications.   This document proposes some 
  30. enhancements to the syntax, semantics and functionality of the original Gopher protocol.
  31.  
  32.  
  33. Distribution of this document is unlimited.  Please send comments to the Gopher 
  34. development team: <gopher@boombox.micro.umn.edu>.  Experimentation with the 
  35. mechanisms described here is encouraged. 
  36.  
  37.  
  38.  
  39.  
  40. 1.    Introduction
  41.  
  42. The Internet Gopher protocol was designed primarily to act as a distributed document 
  43. delivery system.  It has enjoyed increasing popularity, and is being used for purposes that 
  44. were not visualized when the protocol was first outlined.  The rest of this document 
  45. describes the Gopher+ enhancements in a non-rigorous but easily read and understood 
  46. way.  There is a short BNF-like section at the end for exact syntax descriptions.  
  47. Throughout the document, "#" stands for the ASCII TAB character. There is an implicit 
  48. carriage return and line-feed at the ends of lines; these will only be explicitly mentioned 
  49. where necessary to avoid confusion. To understand this document, you really must be 
  50. familiar with the basic Gopher protocol.
  51.  
  52.  
  53. Servers and clients understanding the Gopher+ extensions, transmit extra information at the 
  54. ends of list and request lines.  Old, basic gopher clients ignore such information.  New 
  55. Gopher+ aware servers continue to work at their old level with unenhanced clients.  The 
  56. extra information that can be communicated by Gopher+ clients may be used to summon 
  57. new capabilities to bridge the most keenly felt shortcomings of the venerable old Gopher.
  58.  
  59.  
  60.  
  61.  
  62.  
  63.  
  64. 2.     How does Gopher+ work?
  65.  
  66. Gopher+ enhancements rely on transmitting "extra" tab delimited fields beyond what 
  67. regular (old) Gopher servers and clients now use.  If most existing (old) clients were to 
  68. encounter extra stuff beyond the "port" field in a list (directory), most would ignore it. 
  69. Gopher+ servers will return item descriptions in this form:
  70.  
  71.  
  72.     1Display string#selector string#host#port#extra stuff<CRLF>
  73.  
  74.  
  75. If an existing (old) client has problems with additional information beyond the port, it 
  76. should not take much more than a simple tweak to have it discard unneeded stuff.
  77.  
  78.  
  79.  
  80.  
  81. 2.1    Advisory issued to client maintainers.
  82.  
  83. If it does not do this already, your existing client should be modified as soon as possible to 
  84. ignore extra fields beyond what it expects to find.  This will ensure that clients not break 
  85. when Gopher+ servers enter gopherspace.
  86.  
  87.  
  88. All the regular Gopher protocol info remains intact except for:
  89.  
  90.  
  91. (1)  Instead of just a CRLF after the port field in any item of a list (directory) there may be 
  92. an optional TAB followed by extra stuff as noted above (explanation to follow).
  93.  
  94.      
  95.  
  96. (2) In the original Gopher protocol, there was provision for a date-time descriptor (sec 3.6) 
  97. to be sent after the selector (for use by autoindexer beasts).  As far as we know, while the 
  98. descriptor is implemented in the Mac server, it is not in any other server and no clients or 
  99. daemons use it.  This is a good time to withdraw this feature. The basic gopher protocol 
  100. has been revised for the final time and will be frozen.
  101.  
  102.  
  103.  
  104.  
  105. 2.2    Gopher+ item lists.
  106.  
  107. Gopher servers that can utilize the Gopher+ enhancements will send some additional stuff 
  108. (frequently the character "+") after the port field describing any list item. eg:
  109.  
  110.  
  111. 1Some old directory#foo selector#host1#port1
  112.  
  113. 1Some new directory#bar selector#host1#port1#+
  114.  
  115. 0Some file or other#moo selector#host2#port2#+
  116.  
  117.  
  118. The first line is the regular old gopher item description. The second line is new Gopher+  
  119. item description. The third line is a Gopher+ description of a document. Old gopher clients 
  120. can request the latter two items using old format gopher selector strings and retrieve the 
  121. items. New, Gopher+ savvy clients will notice the trailing + and know that they can do 
  122. extra things with these kinds of items.
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.  
  130. 2.3    Gopher+ data transfer.
  131.  
  132. If a client sends out a Gopher+ type request to a server (by tagging on a tab and a "+" to the 
  133. request):
  134.  
  135.  
  136.     bar selector#+
  137.  
  138.  
  139. The server may return the response in one of three ways; examples below:
  140.  
  141.  
  142.   +5340<CRLF><data>
  143.  
  144.   
  145.  
  146.   +-1<CRLF><data><CRLF>.<CRLF>
  147.  
  148.   
  149.  
  150.   +-2<CRLF><data>
  151.  
  152.  
  153. The first response means: I am going to send exactly 5340 bytes at you and they will begin 
  154. right after this line.  The second response means: I have no idea how many bytes I have to 
  155. send (or I am lazy), but I will send a period on a line by itself when I am done.  The  third 
  156. means:  I really have no idea how many bytes I have to send, and what's more, they 
  157. COULD contain the <CRLF>.<CRLF> pattern, so just read until I close the connection.
  158.  
  159.  
  160. The first character of a response to a Gopher+ query denotes success (+) or failure (-). 
  161. Following that is a token to be interpreted as a decimal number. If the number is >= 0, it 
  162. describes the length of the dataBlock. If = -1, it means the data is period terminated. If = -
  163. 2, it means the data ends when the connection closes.  
  164.  
  165.  
  166. The server may return an error also, as in:
  167.  
  168.  
  169. --1<CRLF><data><CRLF>.<CRLF>
  170.  
  171.  
  172. The (short!) error message will be in ASCII text in the data part.  The first token on the first 
  173. line of the error text (data) contains an error-code (an integer).  It is recommended that the 
  174. first line also contain  the email address of the administrator of the server (in angle 
  175. brackets). Both the error-code and the email address may easily be extracted by the client.  
  176. Subsequent lines contain a short error message that may be displayed to the user. Basic 
  177. error codes are:
  178.  
  179.  
  180.     1    Item is not available.
  181.  
  182.     2    Try again later ("eg.  My load is too high right now.")
  183.  
  184.     3    Item has moved.  Following the error-code is the gopher descriptor of
  185.  
  186.         where it now lives.
  187.  
  188.  
  189. More error codes may be defined as the need arises.
  190.  
  191.  
  192.  
  193. This should be obvious: if the client sends out an "old" Gopher kind of request:
  194.  
  195.    
  196.  
  197.    bar selector
  198.  
  199.    
  200.  
  201. the server will know that it is talking to an old client and will respond in the old way. This 
  202. means that old gopher clients can still access information on Gopher+ servers.
  203.  
  204.  
  205.  
  206. 2.4    Gopher+ client requests.
  207.  
  208.  
  209. Clients can send requests to retrieve the contents of an item in this form:
  210.  
  211.  
  212.      selector string#+[representation][#dataFlag]<CRLF>[dataBlock]
  213.  
  214.  
  215. If dataFlag is '0', or nonexistent, then the client will not send any data besides the selector 
  216. string.  If the dataFlag is '1' then a block of data will follow in the same format as Section 
  217. 2.3.  The client can send a large amount of data to the server in the dataBlock.  
  218. Representations or alternative views of an item's contents may be discovered by 
  219. interrogating the server about the item's attribute information; this is explained below.
  220.  
  221.  
  222.  
  223. 2.5    Gopher+ Item Attribute Information.
  224.  
  225.  
  226. The most basic enhancement of Gopher+ items is the ability to associate information about 
  227. an item such as size, alternative views, the administrator, an abstract, etc. with the item.  To 
  228. get Attribute Information, a client can send out a request to the gopher server that looks like 
  229. this:
  230.  
  231.  
  232.     selector string#!<CRLF>
  233.  
  234.  
  235. (think of "!" as an upside-down i for "information"). To the server this means "Instead of 
  236. returning the contents of the item, return the item's Attribute Information". The Attribute 
  237. Information is returned as an ASCII text stream containing blocks of information.For 
  238. example, a server might return:
  239.  
  240.  
  241.     +INFO: 0Some file or other#moo selector#host2#port2#+
  242.  
  243.     +ADMIN:
  244.  
  245.      Admin: Frodo Gophermeister <fng@bogus.edu> 
  246.  
  247.      Mod-Date:  15 August 1992 <19920815185503>
  248.  
  249.     +VIEWS: 
  250.  
  251.      Text: <10k>
  252.  
  253.      Postscript: <100k>
  254.  
  255.      Text German: <15k>
  256.  
  257.        MacWriteII: <45K>
  258.  
  259.     +ABSTRACT: 
  260.  
  261.      This is a short (but multi-line) abstract about the
  262.  
  263.      item. Two or three lines ought to be enough
  264.  
  265.  
  266. The beginning of a block of information is denoted by a "+" in column 1 of  a line. Another 
  267. way to think of it is: the name of each block begins with a + and the rest of the name cannot 
  268. contain a +. Each line of information within a block begins with a space so that it is easy to 
  269. locate the beginning of a block. 
  270.  
  271.  
  272. There can be multiple blocks of information about an item, but the first block must be the 
  273. one-line +INFO block containing the keyword +INFO followed by the gopher item 
  274. description. This is done to make it easy to associate informational attributes with the 
  275. gopher items to which they refer (see section 2.7 for some good reasons for doing this). 
  276. The very first line of Attribute Information for an item contains a one-line +INFO block 
  277. containing the gopher descriptor for the item.  All Gopher+ servers must return an 
  278. "+INFO" block for all items listed by the server. Also present may be an +ADMIN block 
  279. that can be many lines long.  The server must also send an +ADMIN block when asked to 
  280. send all the item's attributes (as in the example above).  The +ADMIN block must contain 
  281. at least an Admin attribute and Mod-Date attributes, though there may be many other 
  282. administrative items also present in the +ADMIN block.  The Admin (the administrator of 
  283. the item) and Date (the date of the item's last modification) attributes are required to be 
  284. returned by the server, and other optional attributes may be returned as well.  In this 
  285. example, there are two pieces of information within the +ADMIN block (Admin and Mod-
  286. Date). The Admin attribute must contain the e-mail address of an administrator inside angle 
  287. brackets. The Admin line might also contain the administrators name and phone number. 
  288. The Date line must contain the modification date in angle brackets. The format of the date is 
  289. <YYYYMMDDhhmmss> where YYYY is year, MM is month, DD is day, hh is hours, mm 
  290. is minutes, and ss is seconds.
  291.  
  292.  
  293. The third block in the example is the +VIEWS block. This block lists different formats in 
  294. which the document can be retrieved. The first format listed is what the server believes to 
  295. be the preferred format. A gopher client might display the list of possible view labels of the 
  296. item to the user and let the user select the view they prefer. Alternatively, a smart client 
  297. might look at the content of the labels and preferentially retrieve Postscript views of items. 
  298. Note that the view labels are structured. View labels specify a handler (Postscript, Text, 
  299. etc.), an optional language (English, German, etc.) and an optional size. The client 
  300. software can pick off the size of each view IF there are any angle brackets on the line. 
  301. There might not be a size that the server cares to tell you about. Also this might NOT be the 
  302. exact size that the server will wind up delivering to you if you ask for it... but it should be 
  303. reasonably close. This information makes it possible for clever clients to select views based 
  304. on size, data representation, or language. See section 2.6 for how alternate representations 
  305. (views) are retrieved. 
  306.  
  307.  
  308. The next block in the example is an (optional) +ABSTRACT. Here the block consists of 
  309. lines of text that might be displayed to the user. 
  310.  
  311.  
  312. Other blocks of information can defined and added as the need arises. For instance, a 
  313. Neuromancer-esque 3-D cyberspace attribute might be accommodated by including a 3D-
  314. ICON block (with an image to display in 3-space) and a 3D-COORDINATE block (with 
  315. y,x, and z coordinates). More immediate needs can also addressed by defining other 
  316. information blocks. For instance, a SCRIPT block would be a natural place to put 
  317. information for scripting telnet sessions. Information blocks give us an extensible way of 
  318. adding attributes (or what Macintosh programmers call resources) to gopher items. 
  319.  
  320.  
  321. Some of the really cool ideas we have for information attributes may require sending large 
  322. amounts of data, some of which may not be easily represented as ASCII text, but the idea 
  323. of the attributes information is that it is a relatively compact list of attributes. These 
  324. somewhat conflicting desires can be reconciled by allowing references to gopher items in 
  325. an attribute. For example, an +ABSTRACT block might be returned this way:
  326.  
  327.  
  328.     +ABSTRACT: 0long abstract#selector#host2#port2#+
  329.  
  330.  
  331. In this example, the abstract is a document that resides on a gopher server. By allowing 
  332. references to to gopher items, we can also accommodate data that must be sent in an 8-bit 
  333. clear stream by using the Gopher+ methods for retrieving binary data. 
  334.  
  335.  
  336. If both a reference to an attribute and an explicit value for the attribute are present in an 
  337. attribute list, the preferred version is the explicit value. In the example below, the preferred 
  338. version is "the short abstract goes here". 
  339.  
  340.  
  341.     +ABSTRACT: 0long abstract#selector#host2#port2#+
  342.  
  343.        the short abstract goes here
  344.  
  345.  
  346. Note that if you want to have several views of (for example) an +ABSTRACT this is 
  347. possible by using a reference to a item residing on a gopher server because the item can 
  348. have its own attributes. 
  349.  
  350.  
  351. Attributes names are case sensitive (easier to match and more of them).  There is no need to 
  352. "preregister" all possible attributes since we cannot anticipate all possible future needs. 
  353. However it would be reasonable to maintain a registry for implementors and administrators 
  354. so duplication can be avoided. Server implementors or administrators can request that new 
  355. attributes be included in the registry.
  356.  
  357.  
  358. Dream on: What gets us excited are alternate representations for directory lists.  Sure, the 
  359. standard representation for a gopher directory list is known to us all.  But isn't hypertext 
  360. (in a WWW sense) an alternate kind of directory list?  We also envisioned a "geographical 
  361. view" (GView?) mapping servers onto a map of the world (throw up a gif picture and then 
  362. overlay dots based on latitude and longitude or xy coordinates).  OK.  Dream off.
  363.  
  364.  
  365. Note that interested parties outside gopherspace have long and complex wish-lists for 
  366. "attributes" that all well-dressed Internet citizens should have.  We don't want to comment 
  367. on the use or value of these laundry-lists. Suffice it to say that nothing precludes server 
  368. administrators from including whatever attributes they see fit to include. Certainly IAFA 
  369. blocks are desirable, bearing UDIs, URL's or whatever else is desired.  The gopher 
  370. community will probably arrive at a list of "recommended" attributes that server 
  371. administrators should try to support.  Because not every server administrator sees 
  372. advantage to cluttering Attribute Info files with information their  primary users will never 
  373. need, it does not seem fair to  "force" folks to include them; most will just ignore the harsh 
  374. protocol guideline and the value of the protocol will be diminished.  We want to mandate as 
  375. little as we possibly can.
  376.  
  377.  
  378.  
  379. 2.6    Using Attribute Info: Alternate representations (+VIEWS).
  380.  
  381.  
  382. The user may locate a document and wonder if there are  representations of it besides, say, 
  383. the standard Text.  Using the appropriate client incantation (Option Double-Click? or 
  384. whatever) the user indicates a wish to see what's  available.  The client retrieves the 
  385. Attribute Information, displays the list of views to the user in some kind of scrolling list 
  386. dialog.  User selects a line and client now requests the document in say, Postscript 
  387. representation:
  388.  
  389.  
  390.    the selector#+Postscript
  391.  
  392.  
  393.  
  394. Smart clients are not precluded from doing things like "Always get Postscript if you can" or 
  395. "Always get  Postscript if that is less than 700K in size." etc. And the "smarter" you make 
  396. it, the hairier your client will become - unless you are a user interface wizard of awesome 
  397. proportions. While the example above is of fetching a document's postscript view, there is 
  398. nothing precluding having different views for directories. In the dream sequence earlier, we 
  399. imagined a geographic view of a directory. For a client to fetch that view, it would say this:
  400.  
  401.  
  402.    the selector#+GView
  403.  
  404.  
  405.  
  406. 2.7    Getting attributes for all items in a directory in one transaction.
  407.  
  408.  
  409. Heavyweight/clever/special-purpose clients may want to know all the attributes of items in 
  410. a given directory in one transaction. The "$" command is used to request all the attributes 
  411. of a directory at once. For instance, a client might sent the request:
  412.  
  413.  
  414.     selector string#$
  415.  
  416.  
  417. and the server might return this:
  418.  
  419.  
  420.     +INFO: 0Salmon dogs#some selector#host2#port2#+
  421.  
  422.     +ADMIN:
  423.  
  424.      Admin: Frodo Gophermeister <fng@bogus.edu> 
  425.  
  426.      Mod-Date: August 15, 1992 <19920815185503>
  427.  
  428.     +VIEWS: 
  429.  
  430.      Text: <10k>
  431.  
  432.      Postscript German: <100k>
  433.  
  434.     +ABSTRACT: 
  435.  
  436.        A great recipe for making salmon
  437.  
  438.     +INFO: 0Hot pups#other selector#host3#port3#+
  439.  
  440.     +ADMIN:
  441.  
  442.      Admin: Bilbo Gophernovice <bng@bogus.edu> 
  443.  
  444.      Date: <19910101080003>
  445.  
  446.  
  447. In this example, the server returned the attribute lists for two items because there were only 
  448. two items in the directory.. The client software can easily separate the attributes for the 
  449. items since each attribute list starts with "+INFO". It is also easy for the client to use the 
  450. "$" command to get directory listings since the gopher item descriptor is on the +INFO line 
  451. for each item. 
  452.  
  453.  
  454. Note that the $ command is the only way to find the administrator of a remote link.  To get 
  455. the full attribute information for a link on another machine may require asking the master 
  456. machine for the item information.  It is possible to append which attributes you are 
  457. interested in retrieving after the $, eg:
  458.  
  459.  
  460.     some directory selector#$+VIEWS
  461.  
  462. or
  463.  
  464.     other directory selector#$+VIEWS+ABSTRACT
  465.  
  466.     
  467.  
  468. The $ command makes it possible for a client that does not mind burning bandwidth to get 
  469. attribute information for all items as the user navigates gopherspace. Clients using 2400 
  470. bps SLIP links will probably not use this method... but clients on Ethernet may not mind. 
  471. This command may also be useful for building indexes of gopherspace if one wanted to do 
  472. an Archie-like service for gopherspace.  Note that the specific requested attributes are only 
  473. suggestions to the server that the client would like less than a full set of attributes.  The 
  474. server may choose to ignore the request (if it is not capable of extracting the required 
  475. attributes) and return the client the full set anyway.  Other caveats:  even if the attributes 
  476. requested are not available, the server WILL NOT return an error, but will send whatever 
  477. IS available.  It is the client's responsibility inspect the returned attributes.
  478.  
  479.  
  480. Analogous to use of the $ command, the ! command can also be used to request certain 
  481. attribute blocks.
  482.  
  483.  
  484.  
  485.  
  486. 2.8    Gopher+ Interactive Query items.
  487.  
  488.  
  489. The principle here is based on Roland Schemer's "Q/q" type ideas. We're calling it the 
  490. Interactive Query enhancements... 
  491.  
  492.  
  493. The server may list items that have a "?" following the port field:
  494.  
  495.  
  496.    0A file#file selector#host#port#?
  497.  
  498.    1A directory#dir selector#host#port#?
  499.  
  500.  
  501. Now the fact that there's something there means that they're Gopher+ items.  Old clients 
  502. will still be able to show such items in lists, but if they simply send the old style plain 
  503. selector string to retrieve them, the server will respond with an old style error telling them 
  504. to get an updated client.  New clients will know that before getting one of these items, it 
  505. will be necessary to retrieve questions from the server, have the user answer them, and 
  506. then feed the answers back to the server along with the selector. The questions to be asked 
  507. of the user are retrieved from the server by looking at the +ASK attribute in the item's 
  508. attribute information.
  509.  
  510.  
  511. So when the user selects a query item, the client quickly connects to the server and requests 
  512. the Attribute Information for the item.  Then the client extracts the information in the +ASK 
  513. attribute block. Here's an example:
  514.  
  515.  
  516.     +INFO: 0inquisitive#moo moo selector#host2#port2#+
  517.  
  518.     +ADMIN
  519.  
  520.      Admin: Frank Gophermeister <fng@bogus.edu>
  521.  
  522.      Mod-Date: August 15, 1992 <19920815185503>
  523.  
  524.       +ASK: 
  525.  
  526.        Ask: How many volts?
  527.  
  528.        Choose: Deliver electric shock to administrator now?#Yes#Not!
  529.  
  530.   
  531.  
  532.   
  533.  
  534. The client will use all lines in the order they appear in the +ASK attribute block.  The 
  535. content will be presented to the user as questions or prompts or dialogs or something like 
  536. that.
  537.  
  538.  
  539. The "Ask" presents the user with a question, supplies a default text answer if it exists.
  540.  
  541.  
  542. The "AskF" requests the user for a new local filename, presumably for stashing the 
  543. response returned by the server. It may supply a default filename.
  544.  
  545.  
  546. The "Choose" presents the user with a few short choices; ideal for a dialog box with a 
  547. couple or three buttons.
  548.  
  549.  
  550. The "ChooseF" requests that the user select an existing local file, presumably for sending 
  551. to the server.  On some systems, the client writer or administrator might want to restrict the 
  552. selection of such files to the current directory (ie. not allow paths in the filename to prevent 
  553. sending things like password files).
  554.  
  555.  
  556. The n responses harvested from the user are sent on to the server as the first n lines in the 
  557. dataBlock.  There can only be one file sent, and it will be the remainder of the dataBlock if 
  558. any.
  559.  
  560.  
  561. Because of the potential for abuse, client writers should provide a way to 
  562. turn off +ASK block interpretation, and distribute clients that do not 
  563. interpret +ASK blocks by default.  It is recommended that the +ASK 
  564. mechanism not be used as a password request, and users be cautioned 
  565. against typing their password to anything but a very familiar looking login 
  566. request.
  567.  
  568.  
  569. Gopher was originally designed as an essentially anonymous document retrieval protocol to 
  570. facilitate easy access to information rather than limited access.  Various kinds of restrictive 
  571. mechanisms have been implemented at the server end (for example, access restriction by 
  572. source IP address); however if you have sensitive information, we emphasize that putting it 
  573. under a Gopher's nose is not a good idea.
  574.  
  575.  
  576. The folks with a hirsute tendency will have noticed that all these interactions  are static 
  577. rather than truly dynamic and interactive.  In other words, the  server cannot ask different 
  578. questions in response to different answers.  +ASK does not constitute a  scripting language 
  579. by any means.
  580.  
  581.  
  582. To do "true" scripting, we have to do one of two things
  583.  
  584.  
  585. 1.  Write a full language parser/interpreter into clients. The server loads a whole script into 
  586. the client's brain, and the client "runs" it.   This rather grossly violates the spirit of 
  587. simplicity in cross-platform gopher implementation.  However, when and if a standard 
  588. scripting language is adopted, there will be room for it in a SCRIPT attribute block.
  589.  
  590.  
  591. 2.  Client enters a complex back-and-forth transaction with the server. This requires the 
  592. server, client, or both to save rather a lot of state.  NOPE!  Server saving state means 
  593. holding open a connection or (worse) the server retaining tokens between connections.  
  594. Client saving state means the server has an even worse job to do.
  595.  
  596.  
  597. As Opus the Penguin would say:  a Hairball.
  598.  
  599.  
  600.  
  601. 2.9    Gopher+ Pictures, Sounds, Movies.
  602.  
  603.  
  604. A lot of folks need ability to retrieve and display pictures, but there is no real consensus on 
  605. ONE format for these pictures. We don't want to define a type character for every oddball 
  606. picture type.  Gopher+ handles Pictures, Movies, and Sounds by defining three item types: 
  607. ":" for bitmap images, ";" for movies, and "<" for sounds (originally I, M, and S were 
  608. suggested, but they were informally in use in other ways; the only thing magic about ":", 
  609. ";", and "<", is that they are the first characters after '9')  Note that there is NO 
  610. default format for Pictures, Movies and Sounds; the specific format of the 
  611. image, movie, or sound must be gleaned from the +VIEWS information for 
  612. the item (eg. Gif, PICT, TIFF, etc.).
  613.  
  614. Appendix I
  615.  
  616.  
  617. Required attributes and suggested attributes.
  618.  
  619.  
  620.  
  621. A1.0 The +INFO attribute block
  622.  
  623.  
  624. The +INFO atttribute block is sent whenever an item's attributes are requested.  It is 
  625. required that the Attribute Information list for an item must contain a one-line +INFO 
  626. attribute, and the +INFO attribute must contain the gopher+ descriptor for the item.
  627.  
  628.  
  629.     +INFO: 1Nice stuff#/selector#host#port#+
  630.  
  631.  
  632.  
  633. A2.0 The +ADMIN attribute
  634.  
  635.  
  636.  A Gopher+ server is required to have an +ADMIN block for every item and the +ADMIN 
  637. block must contain Admin and a Mod-Date lines: 
  638.  
  639.  
  640.     +ADMIN:
  641.  
  642.      Admin: [comments] <administrator e-mail address> 
  643.  
  644.      Mod-Date: [comments] <YYYYMMDDhhmmss>
  645.  
  646.  
  647. In addition to the required lines, we recommend that the +ADMIN attribute of items 
  648. returned by a full-text search engine contain a SCORE attribute. The SCORE attribute 
  649. should contain the relevance ranking (an integer) of the item. 
  650.  
  651.  
  652.      Score: relevance-ranking
  653.  
  654.  
  655. We recommend that the +ADMIN attribute of a full-text search engine contain a Score-
  656. Range attribute. This attribute is used to specify the range of values taken on by the 
  657. relevance ranking scores of items returned by the search engine. The Score-Range makes it 
  658. possible to normalize scores from different search engine technologies. The first number is 
  659. the lower bound, the second number is the upper bound.
  660.  
  661.  
  662.      Score-range: lower-bound upper-bound
  663.  
  664.  
  665. We also recommend that the +ADMIN attribute for the root of the server (i.e. what you get 
  666. back when you ask for the attributes of the item with the empty selector string) also contain 
  667. these fields:
  668.  
  669.  
  670.       Site: the name of the site 
  671.  
  672.       Org: organization or group owning the site 
  673.  
  674.       Loc: city, state, country
  675.  
  676.       Geog: latitude longitude
  677.  
  678.       TZ: timezone as gmt-offset
  679.  
  680.  
  681. Other useful attributes might include:
  682.  
  683.  
  684.       Provider: who provided this item
  685.  
  686.     Author: who wrote this item
  687.  
  688.     Creation-Date: when it was born <YYYYMMDDhhmmss>
  689.  
  690.     Expiration-Date: when it expires <YYYYMMDDhhmmss>
  691.  
  692.  
  693. A3.0 The +VIEWS attribute
  694.  
  695.  
  696. The +VIEWS attribute is used to specify alternative representations of an item. The form of 
  697. the +VIEWS attribute is: 
  698.  
  699.  
  700.     +VIEWS: [gopher descriptor]
  701.  
  702.      viewHandler[ viewLanguage]: [<56K>]
  703.  
  704.      viewHandler[ viewLanguage]: [<93K>]
  705.  
  706.      viewHandler[ viewLanguage]: [<77K>]
  707.  
  708.  
  709. Some values for viewhandler are
  710.  
  711.  
  712.     Text, List, Postscript, Gif, Pict, Pict2, Tiff.
  713.  
  714.  
  715. The Gopher Registry document will list all currently registered views for implementors and 
  716. administrators.  All gopher servers must support the Text view for readable documents and 
  717. the List view (the basic Gopher+ directory list) for directories.  These are the views that 
  718. must be returned by default.  If all a server supports is the default views, then it may omit 
  719. the +VIEWS attribute block (although we suggest that it not do so).
  720.  
  721.  
  722. Some registered values for viewLanguage are
  723.  
  724.  
  725.     English, German, French, Spanish, Swedish, Finnish, Norwegian, Dutch
  726.  
  727.  
  728.  
  729. A4.0 The +ABSTRACT attribute
  730.  
  731.  
  732. The +ABSTRACT attribute is used to specify a short abstract for the item. The form of the 
  733. +ABSTRACT attribute is: 
  734.  
  735.  
  736.     +ABSTRACT: [gopher reference]
  737.  
  738.      A line of text<CRLF>
  739.  
  740.      another line of text<CRLF>
  741.  
  742.      still another line of text.<CRLF>
  743.  
  744.  
  745. We recommend that a description of the sorts of information at the site,  a postal address, a 
  746. phone number, and the administrator name for the site be included in the +ABSTRACT 
  747. attribute for the server root (i.e. what you get when you ask for the attribute list of the 
  748. server with no selector string).
  749.  
  750.  
  751.  
  752.  
  753.  
  754.  
  755.  
  756.  
  757. Appendix II
  758.  
  759.  
  760. Paul's NQBNF (Not Quite BNF) for the Gopher+ Enhancements.
  761.  
  762.  
  763.  
  764. Note:  This is modified BNF (as used by the Pascal people) with a few English modifiers thrown 
  765. in.  Stuff enclosed in '{}' can be repeated zero or more times.  Stuff in '[]' denotes a set of items.  
  766. The '-' operator denotes set subtraction.
  767.  
  768.  
  769. This section is not quite solid yet.  Please send us information on any errors you might notice.
  770.  
  771.  
  772. Directory Entity
  773.  
  774.  
  775. CR-LF     ::= Carriage Return Character followed by Line Feed character. 
  776.  
  777. Tab       ::= ASCII Tab character
  778.  
  779. NUL       ::= ASCII NUL character
  780.  
  781. PLUS      ::= ASCII '+' character
  782.  
  783. LEFT      ::= ASCII '<' character
  784.  
  785. RIGHT      ::= ASCII '>' character
  786.  
  787. OCTET     ::= $00 -> $ff
  788.  
  789. UNASCII   ::= OCTET - [Tab CR-LF NUL]
  790.  
  791. UNASCIINOPLUS ::= UNASCII - [PLUS]
  792.  
  793. UNASCIINOANGLE ::= UNASCII - [LEFT, RIGHT]
  794.  
  795. Lastline  ::= '.'CR-LF
  796.  
  797. TextBlock ::= Block of ASCII text not containing Lastline pattern.
  798.  
  799. Type      ::= UNASCII
  800.  
  801. DisplayString ::= {UNASCII}
  802.  
  803. Selector  ::= {UNASCII}
  804.  
  805. Otherflds ::= {UNASCII + TAB}
  806.  
  807. Host      ::= {{UNASCII - ['.']} '.'} {UNASCII - ['.']}
  808.  
  809.  
  810.  
  811. Note: This is a Fully Qualified Domain Name as defined in RFC 830. (e.g. 
  812. gopher.micro.umn.edu)  Hosts that have a CR-LF  TAB or NUL in their name get what they 
  813. deserve.
  814.  
  815.  
  816. Digit     ::= '0' | '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9'
  817.  
  818. DigitSeq  ::= digit {digit}.
  819.  
  820. Port      ::= DigitSeq.
  821.  
  822.  
  823. Note: Port corresponds the the TCP Port Number, its value should be in the range [0..65535]; port 
  824. 70 is officially assigned to gopher.
  825.  
  826.  
  827.  
  828. Bool      ::= '0' | '1'
  829.  
  830. G+Field   ::= '+' | '?'
  831.  
  832.  
  833. Success   ::= '+' | '-'.
  834.  
  835. Transfer  ::= DigitSeq | '-1' | '-2'
  836.  
  837. DataHead  ::= Success Transfer CR-LF
  838.  
  839. DataBlock ::= DataHead {OCTET}
  840.  
  841.  
  842. G1DirEntity ::= Type DisplayString Tab Selector Tab Host Tab Port Tab 
  843. Otherflds CR-LF 
  844.  
  845. G+DirEntity ::= Type DisplayString Tab Selector Tab Host Tab Port Tab G+Field     
  846.  
  847.                 CR-LF 
  848.  
  849.  
  850.  
  851. Notes:
  852.  
  853.    It is *highly* recommended that the DisplayString field contain only printable characters, since 
  854. many different clients will be using it.  However if eight bit characters are used, the characters 
  855. should conform with the ISO Latin1 Character Set.  The length of the User displayable line should 
  856. be less than 70 Characters; longer lines may not fit across some screens. Warning! The Selector 
  857. string can be longer than 255 characters. 
  858.  
  859.  
  860. Menu Entity
  861.  
  862. Menu      ::= DataHead {G+DirEntity}.
  863.  
  864.  
  865. Continues ::= Bool
  866.  
  867. Representation ::= 'Text' | 'List'  | 'Postscript' | 'MacWriteII' | 'RTF' 
  868. |{UNASCII}
  869.  
  870.  
  871.  
  872. Retrieving a document/menu/etc.:
  873.  
  874.  
  875. C: Opens Connection
  876.  
  877. S: Accepts Connection
  878.  
  879. C: Sends Selector String Tab '+' Representation [Tab DataFlag]
  880.  
  881. C: [Optional] Client sends a DataBlock depending on value of DataFlag.
  882.  
  883. S: Sends DataBlock
  884.  
  885. Connection is closed by either client or server (typically server).
  886.  
  887.  
  888. Spaceline    ::= ' ' {UNASCII} CR-LF
  889.  
  890. Blockname     ::=  '+' {UNASCIINOPLUS}
  891.  
  892. Attrblock    ::= Blockname ' ' [G+Direntry] CR-LF  {Spaceline}
  893.  
  894. Attrval      ::= SPACE {UNASCII} CR-LF
  895.  
  896. E-Mail       ::= {UNASCII} s.t. it conforms to RFC 822
  897.  
  898. Adminval     ::= ' Admin:' {UNASCII} '<'  E-Mailaddr '>' CR-LF
  899.  
  900. Dateval      ::= ' Mod-Date:' {UNASCII} '<' YYYYMMDDhhmmss '>' CR-LF
  901.  
  902. AdminReq     ::= AdminVal Dateval
  903.  
  904. Infoblock    ::= '+INFO: ' G+Direntry CR-LF
  905.  
  906. AdminBlock    ::= '+ADMIN: ' {G+Direntry} CR-LF AdminReq {Attrval}
  907.  
  908. Language     ::= 'English' | 'French' | 'German' | {UNASCII}
  909.  
  910. ViewVal      ::= ' ' Representation [' ' Language] ":" ASCIINOANGLE '<' 
  911.  
  912.                  Size 'k>' CR-LF
  913.  
  914. ViewBlock    ::= '+VIEWS: ' {G+Direntry} CR-LF {ViewVal}
  915.  
  916. AttrBlocks   ::= InfoBlock ViewBlock {AttrBlock}
  917.  
  918.  
  919.  
  920. Retrieving item Information.
  921.  
  922.  
  923. C: Opens Connection
  924.  
  925. S: Accepts Connection
  926.  
  927. C: Sends Selector String Tab '!' {BlockName}CR-LF
  928.  
  929. S: Sends DataBlock with data in AttrrBlocks format.
  930.  
  931. Connection is closed by either client or server (typically server).
  932.  
  933.  
  934. Attributes ::= {AttrBlocks}
  935.  
  936.  
  937.  
  938. Retrieving all Item Information entries for a directory.
  939.  
  940.  
  941. C: Opens Connection
  942.  
  943. S: Accepts Connection
  944.  
  945. C: Sends Selector String Tab '$'{BlockName} CR-LF
  946.  
  947. S: Sends DataBlock with data in Attributes format.
  948.  
  949. Connection is closed by either client or server (typically server).
  950.