💾 Archived View for gemi.dev › gemini-mailing-list › 001082.gmi captured on 2024-05-26 at 17:17:03. Gemini links have been rewritten to link to archived content

View Raw

More Information

⬅️ Previous capture (2023-12-28)

-=-=-=-=-=-=-

[spec] When may clients begin processing responses?

1. Scot (gmi1 (a) scotdoyle.com)

Hi all,

The transaction sequence in section 1.1 seems to read chronologically, 
which would mean clients are not permitted to handle any of the 
response until the server closes the connection.

Would it make sense to clarify this in the spec, maybe by changing 
the last line of section 1.1 or by adding a note to section 3.4?

Scot

Link to individual message.

2. lincoln auster (lincolnauster (a) gmail.com)

Hi,

> The transaction sequence in section 1.1 seems to read chronologically,
> which would mean clients are not permitted to handle any of the
> response until the server closes the connection.

I hadn't noticed that in my reading: it does look like incremental
processing/rendering might be strictly disallowed with response body
handling only allowed to occur after the close_notify.

> Would it make sense to clarify this in the spec, maybe by changing
> the last line of section 1.1 or by adding a note to section 3.4?

What's the current informal stance on clients just doing this given the
ambiguity in the spec? It seems a bit odd to me that the spec would
forbid this class of client optimizations: reading the whole of a
response into memory for processing feels like it could be a fairly
wasteful operation[0].

Anyway, I'm just seconding Scot's question and asking for some broader
clarification!

--
lincoln auster
     they/them

0: I also think it would lead to a more complex implementation in
   functional(-ish) languages where we can map a rendering subroutine
   over a TLS stream regardless of the completion of that stream, but
   don't quote me on that :).

Link to individual message.

3. Omar Polo (op (a) omarpolo.com)

Scot <gmi1@scotdoyle.com> writes:

> Hi all,
>
> The transaction sequence in section 1.1 seems to read chronologically, 
> which would mean clients are not permitted to handle any of the 
> response until the server closes the connection.

I don't know how every gemini client handle this, but IMHO the clearest
way to do so is just streamingly parsing the output as soon as it
arrives.  If you don't get a close_notify at the end you can just as
well delete the page and render an error if you want.

(also, you won't be able to handle streaming pages if you wait for the
server to close the connection)

> Would it make sense to clarify this in the spec, maybe by changing 
> the last line of section 1.1 or by adding a note to section 3.4?

No.  The transaction sequence shows the steps, it's not written anywhere
that some of those steps can't happen in parallel.

> Scot

Link to individual message.

4. Jonathan Lamothe (jlamothe (a) posteo.net)

Fun story:

I misunderstood this email and thought you were talking about when the 
server should start sending a response.  That misunderstanding let me to 
find a bug in the server framework I'm writing that would have caused it 
to hang, so... thanks?

--
Regards,
Jonathan Lamothe

Sent from my mobile device.

Nov. 22, 2021 18:55:46 Scot <gmi1@scotdoyle.com>:

> Hi all,
> 
> The transaction sequence in section 1.1 seems to read chronologically,
> which would mean clients are not permitted to handle any of the
> response until the server closes the connection.
> 
> Would it make sense to clarify this in the spec, maybe by changing
> the last line of section 1.1 or by adding a note to section 3.4?
> 
> Scot

Link to individual message.

5. Jonathan Lamothe (jonathan (a) jlamothe.net)

...and I keep sending to this list from the wrong address.

--
Regards,
Jonathan Lamothe

Sent from my mobile device.

Nov. 23, 2021 13:11:21 Jonathan Lamothe <jlamothe@posteo.net>:

> Fun story:
> 
> I misunderstood this email and thought you were talking about when the 
server should start sending a response.  That misunderstanding let me to 
find a bug in the server framework I'm writing that would have caused it 
to hang, so... thanks?
> 
> -- 
> Regards,
> Jonathan Lamothe
> 
> Sent from my mobile device.
> 
> Nov. 22, 2021 18:55:46 Scot <gmi1@scotdoyle.com>:
> 
>> Hi all,
>> 
>> The transaction sequence in section 1.1 seems to read chronologically,
>> which would mean clients are not permitted to handle any of the
>> response until the server closes the connection.
>> 
>> Would it make sense to clarify this in the spec, maybe by changing
>> the last line of section 1.1 or by adding a note to section 3.4?
>> 
>> Scot

Link to individual message.

6. Scot (gmi1 (a) scotdoyle.com)

On Tue, 23 Nov 2021 08:57:43 +0100
Omar Polo <op@omarpolo.com> wrote:

> Scot <gmi1@scotdoyle.com> writes:
> 
> > Hi all,
> >
> > The transaction sequence in section 1.1 seems to read chronologically, 
> > which would mean clients are not permitted to handle any of the 
> > response until the server closes the connection.
> 
> I don't know how every gemini client handle this, but IMHO the clearest
> way to do so is just streamingly parsing the output as soon as it
> arrives.  If you don't get a close_notify at the end you can just as
> well delete the page and render an error if you want.
> 
> (also, you won't be able to handle streaming pages if you wait for the
> server to close the connection)
> 

Agreed. A nice side effect (imo) of specifying that clients are
permitted to start handling requests right away is that the
streaming use case is included.

Link to individual message.

7. Scot (gmi1 (a) scotdoyle.com)

On Tue, 23 Nov 2021 18:19:03 +0000 (UTC)
Jonathan Lamothe <jonathan@jlamothe.net> wrote:

> Nov. 23, 2021 13:11:21 Jonathan Lamothe <jlamothe@posteo.net>:
> 
> > Fun story:
> > 
> > I misunderstood this email and thought you were talking about when the 
server should start sending a response.  That misunderstanding let me to 
find a bug in the server framework I'm writing that would have caused it 
to hang, so... thanks?
> > 
> > -- 
> > Regards,
> > Jonathan Lamothe
> > 

Glad to be of help. I'm right there with you.

Link to individual message.

8. Omar Polo (op (a) omarpolo.com)

Scot <gmi1@scotdoyle.com> writes:

> On Tue, 23 Nov 2021 08:57:43 +0100
> Omar Polo <op@omarpolo.com> wrote:
>
>> Scot <gmi1@scotdoyle.com> writes:
>> 
>> > Hi all,
>> >
>> > The transaction sequence in section 1.1 seems to read chronologically, 
>> > which would mean clients are not permitted to handle any of the 
>> > response until the server closes the connection.
>> 
>> I don't know how every gemini client handle this, but IMHO the clearest
>> way to do so is just streamingly parsing the output as soon as it
>> arrives.  If you don't get a close_notify at the end you can just as
>> well delete the page and render an error if you want.
>> 
>> (also, you won't be able to handle streaming pages if you wait for the
>> server to close the connection)
>> 
>
> Agreed. A nice side effect (imo) of specifying that clients are
> permitted to start handling requests right away is that the
> streaming use case is included.

Exactly! :D

Link to individual message.

---

Previous Thread: Case-sensitive hostnames

Next Thread: Announcing SpellBinding, a cgi game for Gemini