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

Can't receive payload over ~65K on 32bits OS/PHP #64

Closed
Domochip opened this issue Dec 16, 2021 · 0 comments
Closed

Can't receive payload over ~65K on 32bits OS/PHP #64

Domochip opened this issue Dec 16, 2021 · 0 comments

Comments

@Domochip
Copy link
Contributor

Hi,

We are using RatchetPHP in an Home Automation Plugin.
The Home Automation system is named Jeedom (pretty famous in France).
The plugin is jMQTT which is used to handle MQTT protocol in Jeedom.

Some of our users are running this system on Raspberry Pi which is by default under a 32bits OS.

We found out that when sending a payload bigger than ~65K ratchetPHP raise an error on 32bits OS/PHP.

Issue is here (French) :
https://github.com/Domochip/jMQTT/issues/121#issuecomment-992824648

The error message is pretty clear :
PHP Warning: unpack(): 64-bit format codes are not available for 32-bit versions of PHP in /var/www/html/plugins/jMQTT/resources/vendor/ratchet/rfc6455/src/Messaging/MessageBuffer.php on line 163

I'll submit a PR to improve this management of "payload_length" like this :

  • 64Bits OS/PHP : Nothing change, works like today
  • 32Bits OS/PHP : Handle "payload_length" as a 32bits integer. It will then crash for a payload over than 2GB (instead of 65K today)

What's your mind about that?

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

No branches or pull requests

1 participant