Skip to content

Instantly share code, notes, and snippets.

--- a/wscript 2010-06-02 17:08:42.000000000 -0700
+++ b/wscript 2010-06-02 17:09:25.000000000 -0700
@@ -200,7 +200,7 @@
else:
mode = "debug"
- cmd_R = 'python "%s" -j %d -C "%s" -Y "%s" visibility=default mode=%s %s library=static snapshot=on'
+ cmd_R = 'python "%s" -j %d -C "%s" -Y "%s" visibility=default mode=%s %s library=static snapshot=on library d8'
cmd = cmd_R % ( scons
var net = require('net');
var s = new net.Stream(0, 'unix');
s.resume();
s.addListener('fd', function(fd) {
http.createServer(function (req, res) {
sys.debug("Got request at " + process.pid);
res.writeHead(200, {"Content-Type": "text/plain"});
res.end("Hello from " + proces.pid);
diff --git a/Makefile b/Makefile
index 61853d8..53bb61d 100644
--- a/Makefile
+++ b/Makefile
@@ -15,7 +15,8 @@ msgpack: deps/msgpack/dist/lib/libmsgpack.a
deps/msgpack/dist/lib/libmsgpack.a:
cd deps/msgpack && \
mkdir -p dist && \
- ./configure --enable-static --disable-shared \
+ ./configure CFLAGS="-fPIC" CXXFLAGS="-fPIC" \
diff --git a/lib/http.js b/lib/http.js
index 1cf9eca..e9d7c6a 100644
--- a/lib/http.js
+++ b/lib/http.js
@@ -863,11 +863,18 @@ function Client ( ) {
self.destroy(ret);
} else if (parser.incoming && parser.incoming.upgrade) {
var bytesParsed = ret;
- var upgradeHead = d.slice(start + bytesParsed, end - start);
- parser.incoming.upgradeHead = upgradeHead;
From 189ecf32e2540fb8e8d251bef16795868af66323 Mon Sep 17 00:00:00 2001
From: Peter Griess <pg@std.in>
Date: Tue, 15 Jun 2010 12:35:49 -0500
Subject: [PATCH] Support 'upgrade' event in HTTP client.
- Add a unit test for client HTTP upgrade.
- Move around unit tests for server HTTP upgrade.
---
lib/http.js | 13 ++-
test/simple/test-http-upgrade-client.js | 79 +++++++++++++++
- Without this, recvMsg can be invoked before the event emitter gets a
chance to run. In this case, recvMsg.fd will be overwritten and the
original caller can end up emitting null.
---
lib/net.js | 20 ++++++++++++++------
1 files changed, 14 insertions(+), 6 deletions(-)
diff --git a/lib/net.js b/lib/net.js
index 24e1f7a..ac5f568 100644
--- a/lib/net.js
./cli.js --auto-activate always install npm@stable
npm it worked if it ends with ok
npm sudo true
npm configfile /Users/griessp/.npmrc
npm cli [ '--auto-activate', 'always', 'install', 'npm@stable' ]
npm version 0.1.19
npm ! Error: ENOENT, No such file or directory
at node.js:255:9
% npm ls @installed
npm it worked if it ends with ok
npm sudo false
npm configfile /Users/griessp/.npmrc
npm cli [ 'ls', '@installed' ]
npm version 0.1.19
npm GET /
npm@0.1.19 @active @installed @remote @stable @tag=latest @tag=stable
websocket-client@0.9.3 @active @installed @remote @stable @tag=latest @tag=stable
webworker@0.8.0 @installed @remote @stable @tag=latest @tag=stable
var HTTPParser = process.binding('http_parser').HTTPParser;
var net = require('net');
var path = require('path');
var sys = require('sys');
var Worker = require('webworker/webworker').Worker;
var VHOSTS = ['foo.bar.com', 'baz.bizzle.com'];
var WORKERS = {};
VHOSTS.forEach(function(vh) {
var sys = require('sys');
var slice = function(b, off, len) {
var s = 7 - (off + len - 1);
b = b >>> s;
return b & ~(0xff << len);
};
sys.puts(slice(0x12, 3, 2));