1 path = require("path");
3 libDir = path.join(path.dirname(__filename), "../lib");
4 require.paths.unshift(libDir);
6 var sys = (require("sys"));
7 for (var i in sys) global[i] = sys[i];
8 http = require("http");
11 for (var i = 0; i < 20*1024; i++) {
17 http.createServer(function (req, res) {
18 var commands = req.url.split("/");
19 var command = commands[1];
21 var arg = commands[2];
24 if (command == "bytes") {
25 var n = parseInt(arg, 10)
27 throw "bytes called with n <= 0"
28 if (stored[n] === undefined) {
29 puts("create stored[n]");
31 for (var i = 0; i < n; i++) {
37 } else if (command == "quit") {
38 res.connection.server.close();
41 } else if (command == "fixed") {
49 var content_length = body.length.toString();
52 , { "Content-Type": "text/plain"
53 , "Content-Length": content_length