xmppo / node-xmpp-bosh

An XMPP BOSH & WebSocket server (connection manager) written on node.js using Javascript
https://github.com/xmppo/node-xmpp-bosh
263 stars 85 forks source link

Cannot call method 'push' of undefined #4

Closed lboynton closed 12 years ago

lboynton commented 12 years ago

Just had one of my bosh servers die with this error:

/usr/lib/nodejs/node-xmpp-bosh/src/session.js:807 this.pending_bosh_responses[stream.name].push(attrs); ^ TypeError: Cannot call method 'push' of undefined at Object.enqueue_bosh_response (/usr/lib/nodejs/node-xmpp-bosh/src/session.js:807:50) at Object.send_stream_terminate_response (/usr/lib/nodejs/node-xmpp-bosh/src/stream.js:79:17) at /usr/lib/nodejs/node-xmpp-bosh/src/session.js:633:24 at Array.forEach (native) at Object.handle_client_stream_terminate_request (/usr/lib/nodejs/node-xmpp-bosh/src/session.js:625:30) at Object._process_one_request (/usr/lib/nodejs/node-xmpp-bosh/src/session.js:276:18) at Object.process_requests (/usr/lib/nodejs/node-xmpp-bosh/src/session.js:320:22) at process_bosh_request (/usr/lib/nodejs/node-xmpp-bosh/src/bosh.js:182:25) at bosh_request_handler (/usr/lib/nodejs/node-xmpp-bosh/src/bosh.js:237:9) at /usr/lib/nodejs/node-xmpp-bosh/src/http-server.js:69:17

I assume the pending_bosh_responses[stream.name] array hasn't been initialised for some reason. I've temporarily fixed this by checking if it's undefined just before push is called on it, and initialising it if so, but there is probably a better fix.

node-xmpp-bosh 0.5.6 nodejs 0.6.8 CentOS 5.7

dhruvbird commented 12 years ago

Yes, this is a known bug which has been fixed on master (which is currently not stable). We'll release a download in a few days.

lboynton commented 12 years ago

Thanks, will test once released.