-
Bug
-
Resolution: Fixed
-
Major
-
3.1.5
-
None
My jabber server (https://prosody.im/) refuses to speak with my phpBB-3.1.5 installation unless I add a
usleep(1000);
to the sending part: link
After some investigation, I found the following;
The notification code is calling send_message() to send a message to the client. Immediately after this happened, phpbb calls disconnect on the connection.
The problem we have now, is that we don't wait for the jabber server to acknowledge the stream closing, but rather shutdown the socket immediately. If the jabber server did not send the message yet, it will get discarded as the client connection has been terminated.
What should happen is to wait for the server to respond with </stream:stream> before shutting down.
See XEP-0190 superseeded by RFC 6120 4.4
My dirty solution is to put a $this->listen(); here. This could lead to problems if phpbb receives a random message as it doesnt validate thats its actually a stream closing event.