Skip to content
This repository has been archived by the owner on Apr 22, 2023. It is now read-only.

Commit

Permalink
Fix http_simple server for new API
Browse files Browse the repository at this point in the history
  • Loading branch information
ry committed Nov 6, 2009
1 parent 51c1526 commit 54c8ea5
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions benchmark/http_simple.js
Original file line number Diff line number Diff line change
@@ -1,23 +1,25 @@
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];
var body = "";
var arg = commands[2];
var status = 200;

p(req.uri.params);

if (command == "bytes") {
var n = parseInt(arg, 10)
if (n <= 0)
Expand Down

0 comments on commit 54c8ea5

Please sign in to comment.