Browse Source

Fix http_simple server for new API

v0.7.4-release
Ryan Dahl 15 years ago
parent
commit
54c8ea5ea2
  1. 10
      benchmark/http_simple.js

10
benchmark/http_simple.js

@ -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)

Loading…
Cancel
Save