Pings need to start after the stream is auth'd
I was having some problems with my server yesterday and while debugging noticed a ping problem. It appears that pings are scheduled as soon as the client is connected to the server rather than after the client is auth'd.. So because I was having some auth problems I saw the following sequence:
client: send jabber:iq:auth client: send ping server: disconnect client since protocol was sent before the authentication was granted
This is more of a race condition since normally auth happens fast enough that I'm fully auth'd before the first ping is sent out. Methinks the fix is that the ping timer should not be started until the stream is "up".. I'm thinking it should happen after auth and all other startup protocol (fetching roster, bookmarks, etc.)