Mercurial > prosody-hg
comparison plugins/mod_bosh.lua @ 3040:c02d0e7e088e
mod_bosh: Remove some hacky code for pruning dead requests that hopefully never gets executed - if it does there's a bug anyway.
| author | Matthew Wild <mwild1@gmail.com> |
|---|---|
| date | Mon, 17 May 2010 11:45:11 +0100 |
| parents | 2fef108d7eb7 |
| children | 7489ac1d5938 |
comparison
equal
deleted
inserted
replaced
| 3039:2fef108d7eb7 | 3040:c02d0e7e088e |
|---|---|
| 155 local r, send_buffer = session.requests, session.send_buffer; | 155 local r, send_buffer = session.requests, session.send_buffer; |
| 156 local response = { headers = default_headers } | 156 local response = { headers = default_headers } |
| 157 function session.send(s) | 157 function session.send(s) |
| 158 --log("debug", "Sending BOSH data: %s", tostring(s)); | 158 --log("debug", "Sending BOSH data: %s", tostring(s)); |
| 159 local oldest_request = r[1]; | 159 local oldest_request = r[1]; |
| 160 while oldest_request and oldest_request.destroyed do | |
| 161 t_remove(r, 1); | |
| 162 waiting_requests[oldest_request] = nil; | |
| 163 oldest_request = r[1]; | |
| 164 end | |
| 165 if oldest_request then | 160 if oldest_request then |
| 166 log("debug", "We have an open request, so sending on that"); | 161 log("debug", "We have an open request, so sending on that"); |
| 167 response.body = t_concat{"<body xmlns='http://jabber.org/protocol/httpbind' sid='", sid, "' xmlns:stream = 'http://etherx.jabber.org/streams'>", tostring(s), "</body>" }; | 162 response.body = t_concat{"<body xmlns='http://jabber.org/protocol/httpbind' sid='", sid, "' xmlns:stream = 'http://etherx.jabber.org/streams'>", tostring(s), "</body>" }; |
| 168 oldest_request:send(response); | 163 oldest_request:send(response); |
| 169 --log("debug", "Sent"); | 164 --log("debug", "Sent"); |
