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

closing already closed sockets, not invalidating socket handle, _mosquitto_socket_nonblock #649

Closed
edwin-oetelaar opened this Issue Dec 8, 2017 · 1 comment

Comments

Projects
None yet
2 participants
@edwin-oetelaar

edwin-oetelaar commented Dec 8, 2017

COMPAT_CLOSE(*sock);

also on lines
340
425
442
1247
1275
1293
1299

I think the _mosquitto_socket_nonblock is misleading, it closes the socket as a side-effect.

if(_mosquitto_socket_nonblock(*sock)){
	COMPAT_CLOSE(*sock); /* This is wrong, the socket is already closed by _mosquitto_socket_nonblock() call */
        continue;

ralight added a commit that referenced this issue Dec 21, 2017

[649] Don't close socket again if nonblock fails.
Thanks to Edwin van den Oetelaar.

Bug: #649
@ralight

This comment has been minimized.

Contributor

ralight commented Dec 21, 2017

Thanks for spotting this, it's not a fatal problem but nice to have fixed anyway.

@ralight ralight added this to the fixes-next milestone Dec 21, 2017

@ralight ralight closed this Dec 21, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment