Skip to content
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

Automatically close response stream once client connection closes #188

Merged
merged 2 commits into from
May 24, 2017

Conversation

clue
Copy link
Member

@clue clue commented May 23, 2017

Builds on top of #187
This is also a prerequisite for upcoming changes related to #98

@clue clue added this to the v0.7.0 milestone May 23, 2017
@WyriHaximus WyriHaximus requested review from jsor and WyriHaximus May 23, 2017 11:19
src/Server.php Outdated
// in particular this may only fire on a later read/write attempt
// because we stop/pause reading from the connection once the
// request has been processed.
$connection->on('close', function() use ($stream) {
Copy link
Member

Choose a reason for hiding this comment

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

Might as well write this as $connection->on('close', [$stream, 'close']);?

Copy link
Member Author

Choose a reason for hiding this comment

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

I have updated the PR accordingly (have no strong opinion here) 👍

$socket->close();
}

public function testStreamFromRequestHandlerWillBeClosedIfConnectionClosesWhileSendingBody()
Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Member Author

Choose a reason for hiding this comment

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

Fixed tests by increasing test timeouts :shipit:

$socket->close();
}

public function testStreamFromRequestHandlerWillBeClosedIfConnectionClosesButWillOnlyBeDetectedOnNextWrite()
Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Member Author

Choose a reason for hiding this comment

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

Fixed tests by increasing test timeouts :shipit:

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.

3 participants