fix processing queued requests

This commit is contained in:
Roman Shtylman
2013-11-04 10:30:54 -05:00
parent 6afb75704a
commit 0bba03ccd2
2 changed files with 7 additions and 0 deletions

View File

@@ -135,6 +135,11 @@ Proxy.prototype.next_socket = function(cb) {
self.sockets.push(sock);
}
// no sockets left to process waiting requests
if (self.sockets.length === 0) {
return;
}
var wait = self.waiting.shift();
debug('processing queued cb');
if (wait) {

View File

@@ -199,6 +199,8 @@ module.exports = function(opt) {
});
var server = bouncy(function(req, res, bounce) {
debug('request %s', req.url);
// if we should bounce this request, then don't send to our server
if (maybe_bounce(req, res, bounce)) {
return;