Skip to content
This repository has been archived by the owner on Dec 16, 2019. It is now read-only.

Improvements & fixes for Socket::shutdown() PR #864

Merged
merged 7 commits into from
Jan 13, 2019

Conversation

dktapps
Copy link
Contributor

@dktapps dktapps commented May 4, 2018

@sirsnyder this one's for you - some suggested alterations of my own for #845

Copy link
Collaborator

@tpunt tpunt left a comment

Choose a reason for hiding this comment

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

Other than the couple of comments I left, this looks good to me.

classes/socket.h Outdated
@@ -414,9 +414,14 @@ PHP_METHOD(Socket, strerror) {
#ifdef HAVE_SHUTDOWN
/* {{{ proto bool Socket::shutdown(int how) */
Copy link
Collaborator

Choose a reason for hiding this comment

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

This prototype becomes outdated with this change.

classes/socket.h Outdated
}

if (how_shutdown != SHUT_RD && how_shutdown != SHUT_WR && how_shutdown != SHUT_RDWR) {
zend_throw_exception(spl_ce_InvalidArgumentException, "Invalid shutdown type", 0);
RETURN_FALSE;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Since an exception is being thrown, we can change RETURN_FALSE to simply be a return;, since the return value won't be usable after an exception has been thrown.

@dktapps
Copy link
Contributor Author

dktapps commented May 5, 2018

updated, thanks!

@sirsnyder
Copy link
Collaborator

Many thanks @dktapps !

@sirsnyder sirsnyder merged commit bc9f34d into krakjoe:socket_shutdown Jan 13, 2019
@dktapps dktapps deleted the socket-shutdown-fixes branch January 13, 2019 14:26
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants