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

Mitigate endless loop broken pipe error #143

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

tb205gti
Copy link

The code can end up in an endless loop if a broken pipe is experienced in the _fwrite function. This is a rudimentary mitigation by counting the iterations and comparing it to the buffer_length. If the iterations are double the buffer_length, there is a high risk that it is stuck in an endless loop.

PHP Notice:  fwrite(): send of 2013 bytes failed with errno=32 Broken pipe in /phpMQTT.php on line 435

The code can end up in an endless loop if a broken pipe is experienced in the _fwrite function. This is a rudimentary mitigation by counting the iterations and comparing it to the buffer_length. If the iterations are double the buffer_length, there is a high risk that it is stuck in an endless loop. 
```
PHP Notice:  fwrite(): send of 2013 bytes failed with errno=32 Broken pipe in /phpMQTT.php on line 435
```
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.

None yet

1 participant