<?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 LISTAR (v1.0.0; list gopher);
 Wed, 27 Dec 2000 15:37:21 -0600 (CST)
Return-Path: &lt;spectre@stockholm.ptloma.edu&gt;
Delivered-To: gopher@complete.org
Received: from stockholm.ptloma.edu (stockholm.ptloma.edu [199.106.86.50])
	by pi.glockenspiel.complete.org (Postfix) with ESMTP id 04D2F3B808
	for &lt;gopher@complete.org&gt;; Wed, 27 Dec 2000 15:37:21 -0600 (CST)
Received: (from spectre@localhost)
	by stockholm.ptloma.edu (8.9.1/8.9.1) id NAA15654
	for gopher@complete.org; Wed, 27 Dec 2000 13:36:58 -0800
From: Cameron Kaiser &lt;spectre@stockholm.ptloma.edu&gt;
Message-Id: &lt;200012272136.NAA15654@stockholm.ptloma.edu&gt;
Subject: [gopher] Re: Gopher Protocol Issue
In-Reply-To: &lt;20001227100207.A26368@mothra&gt; from David Allen at &quot;Dec 27,
 0 10:02:07 am&quot;
To: gopher@complete.org
Date: Wed, 27 Dec 2000 13:36:58 -0800 (PST)
X-Mailer: ELM [version 2.4ME+ PL39 (25)]
MIME-Version: 1.0
Content-type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 8bit
X-archive-position: 10
X-listar-version: Listar v1.0.0
Sender: gopher-bounce@complete.org
Errors-to: gopher-bounce@complete.org
X-original-sender: spectre@stockholm.ptloma.edu
Precedence: bulk
Reply-to: gopher@complete.org
X-list: gopher
</p>
<p></p>
<p>&gt; UMN gopherd when sending a file out to the client removes anything at
&gt; the end of the line (carriage returns, line feeds) and then adds
&gt; carriage return, linefeed to the end of the line.  What sucks about
&gt; this is that if your line is just terminated with a linefeed, ala
&gt; UNIX, the file you&#x27;re sending  actually gets BIGGER because of the
&gt; extra carriage returns.  That&#x27;s a real problem, because if the server
&gt; sends a gopher+ header saying how many bytes it&#x27;s going to send
&gt; according to the filesize, and then ADDS carraige returns, the client
&gt; has a problem.
</p>
<p>There&#x27;s a larger issue at hand of how backwards-compatible Gopher+ is,
so I&#x27;ll of course put in my two cents at the end of this :-)
</p>
<p>&gt; So how do you reconcile this?  Is it &quot;correct&quot; behavior for a gopherd
&gt; to terminate ALL lines with &quot;\r\n&quot; even if that&#x27;s not part of the
&gt; original data it&#x27;s sending?  (In the original gopher RFC, it
&gt; specifically says that for directory listings, each line should be
&gt; terminated with &quot;\r\n&quot;.  But for regular files, it doesn&#x27;t say)  This
&gt; would be intensely lousy, since it would mean that the server wouldn&#x27;t
&gt; know how many bytes it was going to send unless it looked through the
&gt; files and counted the number of occurances of that pattern before
&gt; hand, which isn&#x27;t very efficient.
</p>
<p>Actually, some clients will break without the \r\n termination of lines
in text files -- TurboGopher for the Mac is one of these offenders.
I ran into this problem when designing Bucktooth when I discovered that
files were getting munged on my Power Mac. Unix gopher and Lynx show them
fine, of course, but where there&#x27;s smoke there&#x27;s fire. So I now leave
them in (or add them through the server), which makes TG happy and doesn&#x27;t
break Unix gopher or Lynx.
</p>
<p>Gopher+ is sort of a nebulous extension and there are a lot of inconsistencies
in it, the one you mention being one of many. It&#x27;s a lot of good ideas that
should be implemented but aren&#x27;t in a developer-friendly form with all the
kinks accounted for. That&#x27;s why I gave up trying to create a wholly compliant
implementation in Bucktooth -- it only supports enough Gopher+ to tell a
client bent on sending G+ requests that it shouldn&#x27;t do that, and that&#x27;s all.
I have enough intricacies in the core protocol to worry about without G+ :-(
Before further development continues, I think there should be some work on
getting the Gopher+ sketch turned into a much more solid proposal.
</p>
<p>--
----------------------------- personal page: http://www.armory.com/~spectre/ --
 Cameron Kaiser, Point Loma Nazarene University * ckaiser@stockholm.ptloma.edu
-- Rational behavior is a choice, not a predestination. -- Kent Paul Dolan ----
</p>
<p></p>
</card>
</wml>
