Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Patches refresh

  • Loading branch information...
commit ac6acd464f49fb20cf189aecd18e0dd644e09353 1 parent 1f84131
zimbatm authored December 27, 2009
35  patches/0001-http-ServerResponse.prototype.sendHeader-change.patch
... ...
@@ -0,0 +1,35 @@
  1
+From ee4810cad5f4a05f345fce407ecfd574f4cfc9cd Mon Sep 17 00:00:00 2001
  2
+From: Jonas Pfenniger <jonas@pfenniger.name>
  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
+
7  ...ack-method-to-http.Request.prototype.connec.patch → ...http-HTTPConnection-now-has-a-hijack-method.patch
... ...
@@ -1,8 +1,11 @@
1  
-From 37a975b92da63d9141690d379adfeb827dbd097c Mon Sep 17 00:00:00 2001
  1
+From aa7bbd6f4881ccd00748c177eb3af98c3034cb01 Mon Sep 17 00:00:00 2001
2 2
 From: Pfenniger Jonas <zimbatm@Guybrush.local>
3 3
 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.
5 5
 
  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 !
6 9
 ---
7 10
  src/node_http.cc |   14 ++++++++++++++
8 11
  src/node_http.h  |    8 ++++++++

0 notes on commit ac6acd4

Please sign in to comment.
Something went wrong with that request. Please try again.