1 path = require("path");
3 var puts = require("sys").puts;
6 http = require(old ? "http_old" : 'http');
7 if (old) puts('old version');
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();
51 , { "Content-Type": "text/plain"
52 , "Content-Length": content_length
56 res.write(body, 'ascii');
59 res.end(body, 'ascii');