Skip to content

Commit

Permalink
fixed memory leak
Browse files Browse the repository at this point in the history
  • Loading branch information
steveWang committed Jul 14, 2011
1 parent b16331f commit 74b0899
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/fileServer.js
Expand Up @@ -12,7 +12,9 @@ exports.generateClientLibs = generateClientLibs;

exports.wrapServer = function (httpServer, serverOptions) {
server = httpServer;
options = serverOptions;
options = serverOptions || {client: {}};
options.client = JSON.stringify(options.client);

defaultListeners = server.listeners('request');
if (serverOptions.autoHost) {
server.removeAllListeners('request');
Expand Down Expand Up @@ -45,8 +47,6 @@ function handleResponse(request, response) {

// Actually serve the file
function serveFile(filename, request, response, options) {
options = options || {};
options.client = JSON.stringify(options.client);

// Write file from cache if possible
if (nowUtil.hasProperty(fileCache, filename)) {
Expand Down

0 comments on commit 74b0899

Please sign in to comment.