<?xml version="1.0"?>
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN"
"http://www.wapforum.org/DTD/wml_1.1.xml">
<wml>
<card id="index" title="Text File" newcontext="true">
<p>
Received: with ECARTIS (v1.0.0; list gopher);
 Wed, 20 Mar 2002 20:34:26 -0500 (EST)
Return-Path: &lt;jgoerzen@complete.org&gt;
Delivered-To: gopher@complete.org
Received: from christoph.complete.org (pcp947166pcs.cstltn01.in.comcast.net
 [68.58.145.248])
	by pi.glockenspiel.complete.org (Postfix) with ESMTP id 15C7D3B81F
	for &lt;gopher@complete.org&gt;; Wed, 20 Mar 2002 20:34:26 -0500 (EST)
Received: from localhost (localhost [127.0.0.1])
	by christoph.complete.org (Postfix) with ESMTP
	id 17EF95A3F9; Wed, 20 Mar 2002 20:34:25 -0500 (EST)
Date: Wed, 20 Mar 2002 20:34:24 -0500
Subject: [gopher] Re: \n.\n
Content-type: text/plain; charset=US-ASCII
Mime-Version: 1.0 (Apple Message framework v481)
Cc: gopher@complete.org
To: Jon Nelson &lt;jnelson@jamponi.net&gt;
From: John Goerzen &lt;jgoerzen@complete.org&gt;
In-Reply-To: &lt;20020320193037.271e98bc.jnelson@jamponi.net&gt;
Message-Id: &lt;C6B8B067-3C6B-11D6-B325-0003930BF072@complete.org&gt;
Content-Transfer-Encoding: 8bit
X-Mailer: Apple Mail (2.481)
X-archive-position: 520
X-ecartis-version: Ecartis v1.0.0
Sender: gopher-bounce@complete.org
Errors-to: gopher-bounce@complete.org
X-original-sender: jgoerzen@complete.org
Precedence: bulk
Reply-to: gopher@complete.org
List-help: &lt;mailto:ecartis@complete.org?Subject=help&gt;
List-unsubscribe: &lt;mailto:gopher-request@complete.org?Subject=unsubscribe&gt;
List-software: Ecartis version 1.0.0
List-ID: Gopher &lt;gopher.complete.org&gt;
X-List-ID: Gopher &lt;gopher.complete.org&gt;
List-subscribe: &lt;mailto:gopher-request@complete.org?Subject=subscribe&gt;
List-owner: &lt;mailto:jgoerzen@complete.org&gt;
List-post: &lt;mailto:gopher@complete.org&gt;
List-archive: &lt;http://www.complete.org/mailinglists/archives/&gt;
X-list: gopher
</p>
<p></p>
<p>On Wednesday, March 20, 2002, at 08:30  PM, Jon Nelson wrote:
</p>
<p>&gt;&gt; much data was actually available to read -- or a code indicating that
&gt;&gt; the other side has finished transmitting and has closed the connection
&gt;
&gt; Actually, John, using &quot;close&quot; to signal end-of-file is a classic and
&gt; *very dangerous* practice. Additionally, HTTP/1.0 does *not* use
</p>
<p>I was choosing my words carefully while trying to avoid being overly
complex!
</p>
<p>Actually, the server should do a shutdown() followed by a close().  In
the client, read() will properly return EOF in this case.
</p>
<p>What we gain by \n.\n is only the ability to detect that a text file has
not been transmitted in full.  If this happens, every client that I know
of will simply ignore the error and display what it got.
</p>
<p>What we lose is the ability to reliably transfer text files containing
\n.\n without modification.
</p>
<p>So, in essence, we have not gained anything by that \n.\n to date.
</p>
<p>&gt; &quot;close&quot; to indicate end-of-file, but rather content-length. In fact,
</p>
<p>Yet often HTTP/1.0 headers omit content-length (esp CGI).
</p>
<p>&gt; can cause a TCP &quot;close&quot;, not just a process on the other end issuing
&gt; a close system call.
</p>
<p>What of these would we handle materially different than we would with
the \n.\n support?
</p>
<p>&gt; I would suggest not altering the gopher0 protocol at this late a stage.
&gt; If you want to modify something, create gopher++ or gopher2, don&#x27;t
&gt; go willy-nilly modifying a protocol that has been established for so
&gt; long.
</p>
<p>For most everything else, I&#x27;d agree.  But we have a case where:
</p>
<p>  1. New clients will communicate just fine with old servers.  Text files
will just have an extra . at the end.
</p>
<p>2. New servers will communicate just fine with old clients.  The clients
stop at EOF anyway.  Several already do not care about \n.\n.
</p>
<p>&gt; Additionally, &quot;\n.\n&quot; is a well-known specifier for end-of-length, and
&gt; it is used in POP3, SMTP and several other line-oriented protocols.
</p>
<p>But there&#x27;s a difference.  Gopher will never read more commands from the
client during the single connection.  SMTP, for instance, will.  With
Gopher, the client sends a filename and \n and that&#x27;s ALL.  The client
could even do a shutdown() at this point.  (And probably should.)
</p>
<p>-- John
</p>
<p></p>
</card>
</wml>
