-
Notifications
You must be signed in to change notification settings - Fork 0
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
Reset outgoing stream on inbound is reset #1
Conversation
Added state to Stream to reset outbound only when the state is open Relates to #187
}, | ||
c, | ||
}) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here, I am simply reverting the change.
@@ -2014,6 +2014,9 @@ func (a *Association) resetStreamsIfAny(p *paramOutgoingResetRequest) *packet { | |||
if !ok { | |||
continue | |||
} | |||
a.lock.Unlock() | |||
s.onInboundStreamReset() | |||
a.lock.Lock() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reporting the event to the corresponding stream and let it decide what to do.
} | ||
s.lock.Unlock() | ||
default: | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This state checks are done inside sendPayloadData()
if err != nil { | ||
return 0, err | ||
return n, errStreamClosed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Try to use the same error object to be compatible.
|
||
if s.readErr == nil { | ||
s.readErr = io.EOF |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not what RFC 8831 implies. s.Close() should only close the outgoing stream. (fixing the existing bug)
if resetOutbound { | ||
s.association.sendResetRequest(sid) | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Finally, this is what we wanted in the PR.
@enobufs Sorry for the delay, just come back form vacation. |
Added state to Stream to reset outbound only when the state is open Relates to pion#187
Hi @jerry-tao, what do you think about this fix. (this branch is based on your fork
jerry-tao/sctp:master
).Who to react to the incoming OutgoingResetRequest should be Stream layer (not at the Association layer).
Also, if the stream already sent its OutgoingResetRequest, it shouldn't send another one, meaning, we need to introduce a state in the Stream class (s.state), and send OutgoingResetRequest if the state is "open", I believe. Which prevented the vnet test case from failing.
As RFC 8831 implies, teardown sequence of a stream starts with outgoing (closing), then incoming (closed). This branch also addresses it by not to cause error (s.readErr) because it will eventually be reset by the remote.
I am hoping to merge this into your branch, then we can finalize it in your pull-request.