Skip to content

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