mirror of
https://github.com/bitinflow/server.git
synced 2026-03-13 13:35:53 +00:00
fix processing waiting callbacks inside next_socket
This commit is contained in:
11
proxy.js
11
proxy.js
@@ -128,7 +128,11 @@ Proxy.prototype._handle_socket = function(socket) {
|
|||||||
});
|
});
|
||||||
|
|
||||||
self.sockets.push(socket);
|
self.sockets.push(socket);
|
||||||
|
self._process_waiting();
|
||||||
|
};
|
||||||
|
|
||||||
|
Proxy.prototype._process_waiting = function() {
|
||||||
|
const self = this;
|
||||||
const wait_cb = self.waiting.shift();
|
const wait_cb = self.waiting.shift();
|
||||||
if (wait_cb) {
|
if (wait_cb) {
|
||||||
self.debug('handling queued request');
|
self.debug('handling queued request');
|
||||||
@@ -176,12 +180,7 @@ Proxy.prototype.next_socket = function(handler) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const wait = self.waiting.shift();
|
self._process_waiting();
|
||||||
self.debug('processing queued cb');
|
|
||||||
if (wait) {
|
|
||||||
self.next_socket(cb);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user