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

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

Merged
sirsnyder merged 7 commits intokrakjoe:socket_shutdownfrom
pmmp:socket-shutdown-fixes
Jan 13, 2019
Merged

Improvements & fixes for Socket::shutdown() PR#864
sirsnyder merged 7 commits intokrakjoe:socket_shutdownfrom
pmmp:socket-shutdown-fixes

Conversation

@dktapps
Copy link
Copy Markdown
Contributor

@dktapps dktapps commented May 4, 2018

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

@dktapps dktapps force-pushed the socket-shutdown-fixes branch from b8229a5 to f2cc3e7 Compare May 4, 2018 10:40
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
Contributor Author

dktapps commented May 5, 2018

updated, thanks!

@sirsnyder
Copy link
Copy Markdown
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.

3 participants