Browse Source

Changing http.js to use the same stream.Stream creation as net.js

v0.7.4-release
Micheil Smith 14 years ago
committed by Ryan Dahl
parent
commit
1af52d28ca
  1. 10
      lib/http.js

10
lib/http.js

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

Loading…
Cancel
Save