socket: Remove old requests

(imported from commit 75bc776e539a2f036ed486e99a6635c38f56cdcb)
This commit is contained in:
Zev Benjamin 2013-10-25 21:12:42 -04:00
parent 7abbf096de
commit 01835dca0f
1 changed files with 3 additions and 1 deletions

View File

@ -87,7 +87,8 @@ Socket.prototype = {
};
sockjs.onmessage = function Socket__sockjs_onmessage(event) {
var req_info = that._requests[event.data.client_meta.req_id];
var req_id = event.data.client_meta.req_id;
var req_info = that._requests[req_id];
if (req_info === undefined) {
blueslip.error("Got a response for an unknown request");
return;
@ -98,6 +99,7 @@ Socket.prototype = {
} else {
req_info.error('response', event.data.response);
}
delete that._requests[req_id];
};
sockjs.onclose = function Socket__sockjs_onclose() {