Skip to content

Clarify allowed messages during SETUP #324

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Nov 7, 2023
Merged

Conversation

afrind
Copy link
Collaborator

@afrind afrind commented Nov 3, 2023

I think the intent of the draft was clear but this makes it explicit not to open a uni stream before setup exchange is done.

Fixes: #136


This draft only specifies a single use of bidirectional streams. Objects are
sent on unidirectional streams. Because there are no other uses of
bidirectional streams, a peer MAY currently close the session as a
'Protocol Violation' if it receives a second bidirectional stream.
An endpoint MUST NOT open a unidirectional stream until after it has completed
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this implies that the server has to wait until SERVER SETUP is acknowledged? It can really only know that when it receives the first non-setup control message.

Really the text should say "until after the receipt of a SUBSCRIBE message". It's used as both an acknowledgement of the SETUP handshake being completed and It's just a protocol violation to send OBJECTs without a SUBSCRIBE anyway. But I'm also fine with "until the receipt of the first non-SETUP message" just to keep things generic for the future.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Never trust transport acks at the app layer! Definitely don't want to imply that. I can update it to:

An endpoint MUST not open a unidirectional stream or send an OBJECT* message until after receiving a SUBSCRIBE and sending a SUBSCRIBE OK.

That transitively means you can't do it during setup, since you can't send or receive a subscrbie* until after setup is complete. Would that work?

Copy link
Collaborator

@kixelated kixelated Nov 6, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That transitively means you can't do it during setup, since you can't send or receive a subscrbie* until after setup is complete.

Mostly true. Now that control messages are sent on the same stream as SETUP, you can abuse head-of-line blocking. If client only supports versions/extensions with the same SUBSCRIBE encoding, then the client can send the SUBSCRIBE immediately:

--> SETUP (stream 1)
--> SUBSCRIBE (stream 1)
<-- SETUP (stream 1)
<-- SUBSCRIBE_OK (stream 1)
<-- OBJECT (stream 2)

Your proposed text now allows this so that's gud. I think it can be simplified even further:

An endpoint MUST not send an OBJECT before receiving a corresponding SUBSCRIBE message.

This rules out publisher push, independent of the handshake itself.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What Track ID would the OBJECTs have if a SUBSCRIBE hadn't been sent?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can add this MUST to the PR that makes it so the subscriber picks Track ID.

@ianswett ianswett merged commit b94c7b5 into main Nov 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Messages during handshake
4 participants