Skip to content
Browse files

wip

  • Loading branch information...
1 parent 60f18ed commit 13a93c718180384e90f5a8248747daed04a68f5c @isaacs committed Jan 29, 2013
Showing with 17 additions and 11 deletions.
  1. +12 −4 lib/http.js
  2. +5 −7 lib/tls.js
View
16 lib/http.js
@@ -36,13 +36,21 @@ if (process.env.NODE_DEBUG && /http/.test(process.env.NODE_DEBUG)) {
}
function readStart(socket) {
- if (!socket || !socket._handle || !socket._handle.readStart) return;
- socket._handle.readStart();
+ if (!socket)
+ return;
+ if (socket._handle && socket._handle.readStart)
+ socket._handle.readStart();
+ else if (socket.resume)
+ socket.resume();
}
function readStop(socket) {
- if (!socket || !socket._handle || !socket._handle.readStop) return;
- socket._handle.readStop();
+ if (!socket)
+ return;
+ if (socket._handle && socket._handle.readStop)
+ socket._handle.readStop();
+ else if (socket.pause)
+ socket.pause();
}
// Only called in the slow case where slow means
View
12 lib/tls.js
@@ -25,7 +25,8 @@ var net = require('net');
var url = require('url');
var events = require('events');
var Stream = require('stream');
-var END_OF_FILE = 42;
+var Duplex = Stream.Duplex;
+var END_OF_FILE = {};
var assert = require('assert').ok;
var constants = require('constants');
@@ -232,15 +233,12 @@ var slabBuffer = null;
// Base class of both CleartextStream and EncryptedStream
-function CryptoStream(pair) {
- Stream.call(this);
+// write ->
+function CryptoStream(pair, options) {
+ Duplex.call(this, options);
this.pair = pair;
- this.readable = this.writable = true;
-
- this._paused = false;
- this._needDrain = false;
this._pending = [];
this._pendingCallbacks = [];
this._pendingBytes = 0;

0 comments on commit 13a93c7

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