Skip to content

Commit ac6acd4

Browse files
author
Jonas Pfenniger
committed
Patches refresh
1 parent 1f84131 commit ac6acd4

File tree

2 files changed

+40
-2
lines changed

2 files changed

+40
-2
lines changed
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
From ee4810cad5f4a05f345fce407ecfd574f4cfc9cd Mon Sep 17 00:00:00 2001
2+
From: Jonas Pfenniger <[email protected]>
3+
Date: Sun, 27 Dec 2009 01:07:16 +0100
4+
Subject: [PATCH 1/2] [http] ServerResponse.prototype.sendHeader change
5+
6+
Now accepting a two-sized array to choose your own reason string.
7+
8+
(Needed by WebSocket, apparently the reasons is not free to choose)
9+
---
10+
lib/http.js | 9 ++++++++-
11+
1 files changed, 8 insertions(+), 1 deletions(-)
12+
13+
diff --git a/lib/http.js b/lib/http.js
14+
index abb472e..d14d546 100644
15+
--- a/lib/http.js
16+
+++ b/lib/http.js
17+
@@ -261,7 +261,14 @@ sys.inherits(ServerResponse, OutgoingMessage);
18+
exports.ServerResponse = ServerResponse;
19+
20+
ServerResponse.prototype.sendHeader = function (statusCode, headers) {
21+
- var reason = STATUS_CODES[statusCode] || "unknown";
22+
+ var reason;
23+
+ if (statusCode.splice) {
24+
+ reason = statusCode[1];
25+
+ statusCode = statusCode[0];
26+
+ } else {
27+
+ reason = STATUS_CODES[statusCode] || "unknown";
28+
+ }
29+
+
30+
var status_line = "HTTP/1.1 " + statusCode.toString() + " " + reason + CRLF;
31+
this.sendHeaderLines(status_line, headers);
32+
};
33+
--
34+
1.6.6
35+

patches/0001-Added-hijack-method-to-http.Request.prototype.connec.patch renamed to patches/0002-http-HTTPConnection-now-has-a-hijack-method.patch

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
1-
From 37a975b92da63d9141690d379adfeb827dbd097c Mon Sep 17 00:00:00 2001
1+
From aa7bbd6f4881ccd00748c177eb3af98c3034cb01 Mon Sep 17 00:00:00 2001
22
From: Pfenniger Jonas <[email protected]>
33
Date: Fri, 25 Dec 2009 23:51:00 +0100
4-
Subject: [PATCH] Added hijack method to http.Request.prototype.connection
4+
Subject: [PATCH 2/2] [http] HTTPConnection now has a hijack() method.
55

6+
This is used by the WebSocket server implementation to change the rules
7+
of HTTP connection. Virtually taking over the connection by hijack()ing
8+
it. Yarrrrrrr !
69
---
710
src/node_http.cc | 14 ++++++++++++++
811
src/node_http.h | 8 ++++++++

0 commit comments

Comments
 (0)