Changing http.js to use the same stream.Stream creation as net.js
authorMicheil Smith <micheil@brandedcode.com>
Mon, 11 Oct 2010 02:38:57 +0000 (13:38 +1100)
committerRyan Dahl <ry@tinyclouds.org>
Mon, 11 Oct 2010 02:43:21 +0000 (19:43 -0700)
lib/http.js

index 20b7b0f30b2a569e90b250b7e2d5af6a58d1f779..fd7e9b68f8221a366edd569752015566978a1b43 100755 (executable)
@@ -9,7 +9,7 @@ if (debugLevel & 0x4) {
 }
 
 var net = require('net');
-var Stream = require('stream').Stream;
+var stream = require('stream');
 
 var FreeList = require('freelist').FreeList;
 var HTTPParser = process.binding('http_parser').HTTPParser;
@@ -185,7 +185,7 @@ var continueExpression = /100-continue/i;
 
 /* Abstract base class for ServerRequest and ClientResponse. */
 function IncomingMessage (socket) {
-  Stream.call(this);
+  stream.Stream.call(this);
 
   // TODO Remove one of these eventually.
   this.socket = socket;
@@ -205,7 +205,7 @@ function IncomingMessage (socket) {
   this.statusCode = null;
   this.client = this.socket;
 }
-sys.inherits(IncomingMessage, Stream);
+sys.inherits(IncomingMessage, stream.Stream);
 exports.IncomingMessage = IncomingMessage;
 
 IncomingMessage.prototype._parseQueryString = function () {
@@ -282,7 +282,7 @@ IncomingMessage.prototype._addHeaderLine = function (field, value) {
 };
 
 function OutgoingMessage (socket) {
-  Stream.call(this);
+  stream.Stream.call(this);
 
   // TODO Remove one of these eventually.
   this.socket = socket;
@@ -301,7 +301,7 @@ function OutgoingMessage (socket) {
 
   this.finished = false;
 }
-sys.inherits(OutgoingMessage, Stream);
+sys.inherits(OutgoingMessage, stream.Stream);
 exports.OutgoingMessage = OutgoingMessage;
 
 // This abstract either writing directly to the socket or buffering it.