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

Handling external invalidation of mosq->sock #127

Open
ralight opened this issue Mar 15, 2016 · 0 comments
Open

Handling external invalidation of mosq->sock #127

ralight opened this issue Mar 15, 2016 · 0 comments
Labels
Component: libmosquitto Type: Enhancement A new feature for a minor or major release.

Comments

@ralight
Copy link
Contributor

ralight commented Mar 15, 2016

migrated from Bugzilla #461714
status UNCONFIRMED severity enhancement in component Mosquitto client library for 1.4
Reported in version 1.4 on platform All
Assigned to: Roger Light

On 2015-03-09 09:50:51 -0400, Mikkel Kirkgaard Nielsen wrote:

No check is currently done to assure that the mosq->sock file descriptor returned by mosquitto_socket() is still valid or is a mosquitto socket.

This became an issue when trying to create a useable PHP socket resource in Mosquitto-PHP which caused PHP garbage collector to close the socket when the resulting PHP socket object went out of scope (see mgdm/Mosquitto-PHP#22).

I have also done some experimentation with closing of the mosquitto fd which seems to suggest that the library attempts to use the original file descriptor even though it is now either closed or used for a completely different resource.

Of course closing the fd is non-intended behaviour by the library user, but shouldn't the library be able to handle the situation more gracefully?

On 2015-03-27 17:04:40 -0400, Roger Light wrote:

Thanks for the report, I agree that this is a problem. I'm not sure what the best way of handling this is at the moment.

@ralight ralight added Type: Enhancement A new feature for a minor or major release. Component: libmosquitto labels Mar 15, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: libmosquitto Type: Enhancement A new feature for a minor or major release.
Projects
None yet
Development

No branches or pull requests

1 participant