+3356
2.3     Gopher+ data transfer.

If a client sends out a Gopher+ type request to a
server (by  tagging on a tab and a "+" to the
request):


        bar selectorF+


The server may return the response in one of three
ways; examples  below:


  +5340<CRLF><data>



  +-1<CRLF><data><CRLF>.<CRLF>



  +-2<CRLF><data>


The first response means: I am going to send exactly
5340 bytes at you and they will begin right after this
line.  The second response means: I have no idea how
many bytes I  have to send (or I am lazy), but I will
send a period on a  line by itself when I am done.
The  third means:  I really  have no idea how many
bytes I have to send, and what's more,  they COULD
contain the <CRLF>.<CRLF> pattern, so just read until
I close  the connection.


The first character of a response to a Gopher+ query
denotes  success (+) or failure (-). Following that is
a token to be  interpreted as a decimal number. If the
number is >= 0, it  describes the length of the
dataBlock. If = -1, it means the  data is period
terminated. If = -2, it means the data ends  when the
connection closes.


The server may return an error also, as in:


--1<CRLF><data><CRLF>.<CRLF>


The (short!) error message will be in ASCII text in
the data part.  The first token on the  first line of
the error text (data) contains an error-code  (an
integer).  It is recommended that the first line also
contain  the e-mail address of the administrator of
the  server (in angle brackets). Both the error-code
and the email address may easily be  extracted by the
client.  Subsequent lines contain a short  error
message that may be displayed to the user. Basic error
codes are:


        1       Item is not available.

        2       Try again later ("eg.  My load is too high
right now.")

        3       Item has moved.  Following the error-code is
the  gopher descriptor

                of where it now lives.


More error codes may be defined as the need arises.



This should be obvious: if the client sends out an
"old"  Gopher kind of request:



    bar selector



the server will know that it is talking to an old
client and  will respond in the old way. This means
that old gopher  clients can still access information
on Gopher+ servers.




2.4     Gopher+ client requests.


Clients can send requests to retrieve the contents of
an item in this form:


        
selectorstringF+[representation][FdataFlag]<CRLF>[dat
ablock]


If dataFlag is '0', or nonexistent, then the client
will not  send any data besides the selector string.
If the dataFlag  is '1' then a block of data will
follow in the same format as Section 2.3.  The  client
can send a large amount of data to the server in the
dataBlock.  Representations or alternative views of an
item's contents may be discovered by interrogating the
server about the item's attribute information; this is
explained below.


Note that in the original Gopher protocol, a query
submitted to an index server might have a selector
string followed by a TAB and the words for which the
index server was being asked to search. In Gopher+,
the extra TAB and Gopher+ information follow the words
for which the server is being asked to search. Gopher+
client have to be smart enough to know that in the
case of a type 7 item (an index server) they append
the Gopher+ information after the words being searched
for.