dhruvbird/node-xmpp-bosh — comment on commit 9f0b359c4349d301a15e67d5fefc58a371b120e2
File: src/session.js line 1015
By satyamshekhar:

Let me phrase it better - In queued requests at any pt in time the max number of requests with RID < session RID will be 1, and that request would have been added by the request that is being currently processed(which is broken). So instead of looping through all queued requests cant we just check if node.attrs.rid < state.rid?

In queued requests at any pt in time the max number of requests with RID < session RID will be 1 -- Why?
Because such requests are deleted from the queued requests immediately, while the requests in being processed - as soon as it comes and we find out that its broken.