Fix http_simple server for new API

This commit is contained in:
Ryan Dahl 2009-11-06 12:53:27 +01:00
parent 51c1526b6a
commit 54c8ea5ea2

View File

@ -1,14 +1,18 @@
libDir = process.path.join(process.path.dirname(__filename), "../lib");
path = require("path");
libDir = path.join(path.dirname(__filename), "../lib");
require.paths.unshift(libDir);
process.mixin(require("sys"));
http = require("sys");
http = require("http");
fixed = ""
for (var i = 0; i < 20*1024; i++) {
fixed += "C";
}
stored = {};
http.createServer(function (req, res) {
var commands = req.uri.path.split("/");
var command = commands[1];
@ -16,8 +20,6 @@ http.createServer(function (req, res) {
var arg = commands[2];
var status = 200;
p(req.uri.params);
if (command == "bytes") {
var n = parseInt(arg, 10)
if (n <= 0)