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

Implemented UserFile file descriptor casting. #4320

Closed
wants to merge 4 commits into from

Conversation

kevinxucs
Copy link
Contributor

Implemented UserFile file descriptor casting by calling user defined function streamWrapper::stream_cast(int). Also in the function which converts File* to file descriptor, checks whether the casting function fd() returns -1, raise warning if so. Finally after all the castings for read / write / except array are done, check whether any file descriptors are successfully casted, if not, raise warning and return false.

Passing vfsstream selectStream test.

@facebook-github-bot
Copy link
Contributor

This pull request has been imported into Phabricator, and discussion and review of the diff will take place at https://reviews.facebook.net/D29433

Implemented UserFile file descriptor casting by calling user defined
function streamWrapper::stream_cast(int). Also in the function which
converts File* to file descriptor, checks whether the casting function
fd() returns -1, raise warning if so. Finally after all the castings for
read / write / except array are done, check whether any file descriptors
are successfully casted, if not, raise warning and return false.

Passing vfsstream selectStream test.
Change fd() function in HPHP::File to be virtual, so that polymorphism can
work on HPHP::UserFile.
Moved fd cast warning to HPHP::UserFile::fd() which should be a more
appropriate place to throw it.

Reformat line which exceeds 80 characters.
Enable test in slow/streams/stream_wrapper_register.php for
streamWrapper::stream_cast(int).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants