1 libDir = node.path.join(node.path.dirname(__filename), "../lib");
2 require.paths.unshift(libDir);
4 node.mixin(require("/utils.js"));
5 http = require("/http.js");
8 for (var i = 0; i < 20*1024; i++) {
12 http.createServer(function (req, res) {
13 var commands = req.uri.path.split("/");
14 var command = commands[1];
16 var arg = commands[2];
21 if (command == "bytes") {
22 var n = parseInt(arg, 10)
24 throw "bytes called with n <= 0"
25 if (stored[n] === undefined) {
26 puts("create stored[n]");
28 for (var i = 0; i < n; i++) {
34 } else if (command == "quit") {
35 res.connection.server.close();
38 } else if (command == "fixed") {
46 var content_length = body.length.toString();
48 res.sendHeader( status
49 , { "Content-Type": "text/plain"
50 , "Content-Length": content_length