1 path = require("path");
3 libDir = path.join(path.dirname(__filename), "../lib");
4 require.paths.unshift(libDir);
6 process.mixin(require("sys"));
7 http = require("http");
10 for (var i = 0; i < 20*1024; i++) {
16 http.createServer(function (req, res) {
17 var commands = req.url.split("/");
18 var command = commands[1];
20 var arg = commands[2];
23 if (command == "bytes") {
24 var n = parseInt(arg, 10)
26 throw "bytes called with n <= 0"
27 if (stored[n] === undefined) {
28 puts("create stored[n]");
30 for (var i = 0; i < n; i++) {
36 } else if (command == "quit") {
37 res.connection.server.close();
40 } else if (command == "fixed") {
48 var content_length = body.length.toString();
50 res.sendHeader( status
51 , { "Content-Type": "text/plain"
52 , "Content-Length": content_length