rfc1436.txt

来自「RFC 的详细文档!」· 文本 代码 · 共 899 行 · 第 1/3 页

TXT
899 行
字号

      (b) The well-tempered server ought to send "text" (unless a file
      must be transferred as raw binary).  Should this text include
      tabs, formfeeds, frufru?  Probably not, but rude servers will
      probably send them anyway.  Publishers of documents should be
      given simple tools (filters) that will alert them if there are any
      funny characters in the documents they wish to publish, and give
      them the opportunity to strip the questionable characters out; the
      publisher may well refuse.

      (c) The well-tempered client should do something reasonable with
      funny characters received in text; filter them out, leave them in,
      whatever.




Anklesari, McCahill, Lindner, Johnson, Torrey & Alberti        [Page 11]

RFC 1436                         Gopher                       March 1993


Appendix

   Paul's NQBNF (Not Quite BNF) for the Gopher Protocol.

   Note:  This is modified BNF (as used by the Pascal people) with a few
          English modifiers thrown in.  Stuff enclosed in '{}' can be
          repeated zero or more times.  Stuff in '[]' denotes a set of
          items.  The '-' operator denotes set subtraction.


Directory Entity

CR-LF     ::= ASCII Carriage Return Character followed by Line Feed
              character.

Tab       ::= ASCII Tab character.

NUL       ::= ASCII NUL character.

UNASCII   ::= ASCII - [Tab CR-LF NUL].

Lastline  ::= '.'CR-LF.

TextBlock ::= Block of ASCII text not containing Lastline pattern.

Type      ::= UNASCII.

RedType   ::= '+'.

User_Name ::= {UNASCII}.

Selector  ::= {UNASCII}.

Host      ::= {{UNASCII - ['.']} '.'} {UNASCII - ['.']}.

Note: This is a Fully Qualified Domain Name as defined in RFC 1034.
      (e.g., gopher.micro.umn.edu)  Hosts that have a CR-LF
      TAB or NUL in their name get what they deserve.

Digit     ::= '0' | '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9' .

DigitSeq  ::= digit {digit}.

Port      ::= DigitSeq.

Note: Port corresponds the the TCP Port Number, its value should
      be in the range [0..65535]; port 70 is officially assigned
      to gopher.



Anklesari, McCahill, Lindner, Johnson, Torrey & Alberti        [Page 12]

RFC 1436                         Gopher                       March 1993


DirEntity ::= Type User_Name Tab Selector Tab Host Tab Port CR-LF
          {RedType User_Name Tab Selector Tab Host Tab Port CR-LF}



Notes:

   It is *highly* recommended that the User_Name field contain only
   printable characters, since many different clients will be using
   it.  However if eight bit characters are used, the characters
   should conform with the ISO Latin1 Character Set.  The length of
   the User displayable line should be less than 70 Characters; longer
   lines may not fit across some screens.

   The Selector string should be no longer than 255 characters.


Menu Entity

Menu      ::= {DirEntity} Lastline.


Menu Transaction  (Type 1 item)

C: Opens Connection
S: Accepts Connection
C: Sends Selector String
S: Sends Menu Entity

   Connection is closed by either client or server (typically server).


Textfile Entity

TextFile  ::= {TextBlock} Lastline

Note:  Lines beginning with periods must be prepended with an extra
     period to ensure that the transmission is not terminated early.
     The client should strip extra periods at the beginning of the line.


TextFile Transaction (Type 0 item)

C: Opens Connection.
S: Accepts connection
C: Sends Selector String.
S: Sends TextFile Entity.




Anklesari, McCahill, Lindner, Johnson, Torrey & Alberti        [Page 13]

RFC 1436                         Gopher                       March 1993


   Connection is closed by either client or server (typically server).

Note:  The client should be prepared for the server closing the
       connection without sending the Lastline.  This allows the
       client to use fingerd servers.


Full-Text Search Transaction (Type 7 item)

Word      ::= {UNASCII - ' '}
BoolOp ::= 'and' | 'or' | 'not' | SPACE
SearchStr ::= Word {{SPACE BoolOp} SPACE Word}

C: Opens Connection.
C: Sends Selector String, Tab, Search String.
S: Sends Menu Entity.

Note:  In absence of 'and', 'or', or 'not' operators, a SPACE is
       regarded as an implied 'and' operator.  Expression is evaluated
       left to right.  Further, not all search engines or search
       gateways currently implemented have the boolean operators
       implemented.

Binary file Transaction (Type 9 or 5 item)

C: Opens Connection.
S: Accepts connection
C: Sends Selector String.
S: Sends a binary file and closes connection when done.


Syntactic Meaning for Directory Entities


The client should interpret the type field as follows:

0   The item is a TextFile Entity.
    Client should use a TextFile Transaction.

1   The item is a Menu Entity.
    Client should use a Menu Transaction.

2   The information applies to a CSO phone book entity.
    Client should talk CSO protocol.

3   Signals an error condition.

4   Item is a Macintosh file encoded in BINHEX format



Anklesari, McCahill, Lindner, Johnson, Torrey & Alberti        [Page 14]

RFC 1436                         Gopher                       March 1993


5   Item is PC-DOS binary file of some sort.  Client gets to decide.

6   Item is a uuencoded file.

7   The information applies to a Index Server.
    Client should use a FullText Search transaction.

8   The information applies to a Telnet session.
    Connect to given host at given port. The name to login as at this
    host is in the selector string.

9   Item is a binary file.  Client must decide what to do with it.

+   The information applies to a duplicated server.  The information
    contained within is a duplicate of the primary server.  The primary
    server is defined as the last DirEntity that is has a non-plus
    "Type" field.  The client should use the transaction as defined by
    the primary server Type field.

g   Item is a GIF graphic file.

I   Item is some kind of image file.  Client gets to decide.

T   The information applies to a tn3270 based telnet session.
    Connect to given host at given port. The name to login as at this
    host is in the selector string.

Security Considerations

   Security issues are not discussed in this memo.

Authors' Addresses

   Farhad Anklesaria
   Computer and Information Services, University of Minnesota
   Room 152 Shepherd Labs
   100 Union Street SE
   Minneapolis, MN 55455

   Phone: (612) 625 1300
   EMail: fxa@boombox.micro.umn.edu










Anklesari, McCahill, Lindner, Johnson, Torrey & Alberti        [Page 15]

RFC 1436                         Gopher                       March 1993


   Mark McCahill
   Computer and Information Services, University of Minnesota
   Room 152 Shepherd Labs
   100 Union Street SE
   Minneapolis, MN 55455

   Phone: (612) 625 1300
   EMail: mpm@boombox.micro.umn.edu


   Paul Lindner
   Computer and Information Services, University of Minnesota
   Room 152 Shepherd Labs
   100 Union Street SE
   Minneapolis, MN 55455

   Phone: (612) 625 1300
   EMail: lindner@boombox.micro.umn.edu


   David Johnson
   Computer and Information Services, University of Minnesota
   Room 152 Shepherd Labs
   100 Union Street SE
   Minneapolis, MN 55455

   Phone: (612) 625 1300
   EMail: dmj@boombox.micro.umn.edu


   Daniel Torrey
   Computer and Information Services, University of Minnesota
   Room 152 Shepherd Labs
   100 Union Street SE
   Minneapolis, MN 55455

   Phone: (612) 625 1300
   EMail: daniel@boombox.micro.umn.edu


   Bob Alberti
   Computer and Information Services, University of Minnesota
   Room 152 Shepherd Labs
   100 Union Street SE
   Minneapolis, MN 55455

   Phone: (612) 625 1300
   EMail: alberti@boombox.micro.umn.edu



Anklesari, McCahill, Lindner, Johnson, Torrey & Alberti        [Page 16]


⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?