Skip to content

Instantly share code, notes, and snippets.

@keturn
Created January 29, 2010 03:27
Show Gist options
  • Save keturn/289409 to your computer and use it in GitHub Desktop.
Save keturn/289409 to your computer and use it in GitHub Desktop.
expression-crash
/* This was one of my attempts to figure out deferred responses.
It crashes the whole server with a message like this:
[object Object].emitSuccess (node.js:283:15)
[object Object].<anonymous> (node.js:695:21)
[object Object].emitSuccess (node.js:283:15)
node.js:552:29
node.js:1027:1
node.js:1031:1
*/
require.paths.unshift('lib');
require('express');
var posix = require('posix');
get('/', function () {
var myRequest = this;
function up(s) {
myRequest.respond(s.toUpperCase());
}
return posix.cat('/etc/motd').addCallback(up);
});
run(3001);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment