diff --git a/lib/index.js b/lib/index.js index 48efd49..d2b3729 100644 --- a/lib/index.js +++ b/lib/index.js @@ -92,7 +92,8 @@ var read_config = function(){ } if (config.max_sockets) { - require('http').globalAgent.maxSockets = config.max_sockets + require('http').globalAgent.maxSockets = config.max_sockets; + require('https').globalAgent.maxSockets = config.max_sockets; } // Process command line switches, if any. Command-line switches override the settings @@ -101,7 +102,7 @@ var read_config = function(){ if (process.argv[i] === '-n' || process.argv[i] === '--no_daemon') config['no_daemon'] = true; if (process.argv[i] === '-h' || process.argv[i] === '--halt_on_change') config['halt_on_change'] = true; else if (process.argv[i] === '-d' || process.argv[i] === '--local_store') { - if (i+1 >= process.argv[length]) { + if (i+1 >= process.argv.length) { logger.error("No dir provided with --local_store option"); process.exit(3); }