venomous0x / WhatsAPI

Interface to WhatsApp Messenger
2.59k stars 2.13k forks source link

Invalid token #353

Open manufuentescr opened 11 years ago

manufuentescr commented 11 years ago

Help please

Anyone know why I get this error

PHP Fatal error: Uncaught exception 'Exception' with message 'BinTreeNodeReader->readListSize: Invalid token 159' in /var/www/Whatsapp/protocol.class.php:258 Stack trace: 0 /var/www/Whatsapp/protocol.class.php(212): BinTreeNodeReader->readListSize(159) 1 /var/www/Whatsapp/protocol.class.php(146): BinTreeNodeReader->nextTreeInternal() 2 /var/www/Whatsapp/whatsprot.class.php(336): BinTreeNodeReader->nextTree('??Rv??d??1???v?...') 3 /var/www/Whatsapp/whatsprot.class.php(615): WhatsProt->processInboundData('??Rv??d??1???v?...') 4 /var/www/Whatsapp/whatsprot.class.php(765): WhatsProt->PollMessages() 5 /var/www/Whatsapp/whatsprot.class.php(263): WhatsProt->WaitforServer('1368737605-2') 6 /var/www/Whatsapp/whatsprot.class.php(718): WhatsProt->SendMessageNode('xxxxxxxx@s.w...', Object(ProtocolNode)) 7 /var/www/Whatsapp/whatsprot.class.php(515): WhatsProt->processUploadResponse(Object(ProtocolNode)) 8 /var/www/Whatsapp/whatsprot.class.php(615): WhatsProt->processInboundData('????W??8???^H?O...') 9 /var/www/Whatsapp/whatsp in /var/www/Whatsapp/protocol.class.php on line 258

blackmlm commented 11 years ago

I forgot to include the call stack here it goes again... PHP Fatal error: Uncaught exception 'Exception' with message 'BinTreeNodeReader->readListSize: Invalid token 60' in C:\wamp\www\whatsapp\WhatsAPI\src \php\protocol.class.php:271 Stack trace:

0 C:\wamp\www\whatsapp\WhatsAPI\src\php\protocol.class.php(225): BinTreeNodeReader->readListSize(60)

1 C:\wamp\www\whatsapp\WhatsAPI\src\php\protocol.class.php(159): BinTreeNodeReader->nextTreeInternal()

2 C:\wamp\www\whatsapp\WhatsAPI\src\php\whatsprot.class.php(1486): BinTreeNodeReader->nextTree('?????Tr='`0U%??...')

3 C:\wamp\www\whatsapp\WhatsAPI\src\php\whatsprot.class.php(386): WhatsProt->processInboundData('?????Tr='`0U%??...')

4 C:\wamp\www\whatsapp\WhatsAPI\src\php\whatsprot.class.php(1165): WhatsProt->pollMessages()

5 C:\wamp\www\whatsapp\WhatsAPI\src\php\whatsprot.class.php(2015): WhatsProt->waitForServer('message-1373823...')

6 C:\wamp\www\whatsapp\WhatsAPI\src\php\whatsprot.class.php(735): WhatsProt->sendMessageNode('19564002055', Object(ProtocolNode))

7 C:\wamp\www\whatsapp\getMessages.php(49): WhatsProt->sendMessage( in C:\wamp\www\whatsapp\WhatsAPI\src\php\protocol.class.php on line 271

Fatal error: Uncaught exception 'Exception' with message 'BinTreeNodeReader->readListSize: Invalid token 60' in C:\wamp\www\whatsapp\WhatsAPI\src\php\ protocol.class.php on line 271

Exception: BinTreeNodeReader->readListSize: Invalid token 60 in C:\wamp\www\whatsapp\WhatsAPI\src\php\protocol.class.php on line 271

Call Stack: 0.0005 340040 1. {main}() C:\wamp\www\whatsapp\getMessages.php:0 0.3750 1653176 2. WhatsProt->pollMessages() C:\wamp\www\whatsapp\getMessages.php:73 0.3776 1653384 3. WhatsProt->processInboundData() C:\wamp\www\whatsapp\WhatsAPI\src\php\whatsprot.class.php:386 0.3838 1657752 4. WhatsAppEvent->fire() C:\wamp\www\whatsapp\WhatsAPI\src\php\whatsprot.class.php:1528 0.3838 1657784 5. call_user_func_array() C:\wamp\www\whatsapp\WhatsAPI\src\php\WhatsAppEvent.php:66 0.3838 1658280 6. onMessage() C:\wamp\www\whatsapp\WhatsAPI\src\php\WhatsAppEvent.php:66 0.3863 1658488 7. WhatsProt->sendMessage() C:\wamp\www\whatsapp\getMessages.php:49 0.3867 1658960 8. WhatsProt->sendMessageNode() C:\wamp\www\whatsapp\WhatsAPI\src\php\whatsprot.class.php:735 0.3902 1663136 9. WhatsProt->waitForServer() C:\wamp\www\whatsapp\WhatsAPI\src\php\whatsprot.class.php:2015 0.3903 1663200 10. WhatsProt->pollMessages() C:\wamp\www\whatsapp\WhatsAPI\src\php\whatsprot.class.php:1165 0.3903 1663264 11. WhatsProt->processInboundData() C:\wamp\www\whatsapp\WhatsAPI\src\php\whatsprot.class.php:386 0.3903 1663264 12. BinTreeNodeReader->nextTree() C:\wamp\www\whatsapp\WhatsAPI\src\php\whatsprot.class.php:1486 0.3908 1663304 13. BinTreeNodeReader->nextTreeInternal() C:\wamp\www\whatsapp\WhatsAPI\src\php\protocol.class.php:159 0.3908 1663336 14. BinTreeNodeReader->readListSize() C:\wamp\www\whatsapp\WhatsAPI\src\php\protocol.class.php:225

if I receive a message while the listener is not running and I run the script it crash like this..... if I receive three messages, my script will crash 3 times...... I guess the buffer need to be empty...... any ideas of how I can fix this?

ghost commented 10 years ago

https://github.com/venomous0x/WhatsAPI/issues/456

manufuentescr commented 10 years ago

I did several tests and discovered that the error occurs, but sends the message correctly.