Skip to content

Conversation

@shinrich
Copy link
Member

@shinrich shinrich commented Sep 6, 2018

Jeremy and @pbchou reported having a TLS client send a client-notify and FIN but ATS would continue sending data back. This sounded like a bad side effect of the half-open logic in HttpSM. If the underlying protocol is just TCP it could be legitimate to sending back traffic after the client sends a FIN. The client may still be listening. But if the underlying protocol is TLS, this half-open scenario makes no sense.

For HTTP2, we always disable the HttpSM half open logic. This PR extends that logic for HTTP1 if the client_vc is a SSLNetVConn.

Jermey did some initial testing with a patch against 7.1.x and this solves the problem. The patch is a little different for master since that already includes the setting to turn of the half open logic entirely.

@shinrich shinrich added this to the 9.0.0 milestone Sep 6, 2018
@shinrich shinrich self-assigned this Sep 6, 2018
bool
allow_half_open()
{
bool retval = false;
Copy link
Member

Choose a reason for hiding this comment

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

return dynamic_cast<SSLNetVConnection *>(client_vc) == nullptr;?

return current_reader->t_state.txn_conf->allow_half_open > 0;
} else {
// Check with the session to make sure the underlying transport allows the half open scenario
return dynamic_cast<Http1ClientSession *>(parent)->allow_half_open();
Copy link
Member

Choose a reason for hiding this comment

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

Why not static_cast, if you are assuming the result is valid?

@shinrich shinrich force-pushed the turn-off-half-open-for-tls branch from 22a934b to 89d891e Compare September 7, 2018 18:41
@shinrich
Copy link
Member Author

shinrich commented Sep 7, 2018

Pushed a new version addressing @SolidWallOfCode's comments.

@shinrich shinrich merged commit 422e810 into apache:master Sep 10, 2018
@bryancall bryancall modified the milestones: 9.0.0, 8.0.0 Sep 10, 2018
@bryancall
Copy link
Contributor

Cherry picked to 8.0.0

@pbchou
Copy link
Contributor

pbchou commented Sep 20, 2018

@shinrich -- Do we need to prepare a back-port PR for 7.1.x? Can you do this, or do you want me to do it using the custom patch that you provided to us earlier (with the same change recommended by @bryancall above)?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants