From 76ec47a8e8e1ddc253a050923b66977ab24ac6b3 Mon Sep 17 00:00:00 2001 From: Matteo Collina Date: Wed, 27 Mar 2019 10:15:47 +0100 Subject: [PATCH] Revert "Merge pull request #147 from scarry1992/cork-logic-browser-fix" This reverts commit 441a94a366bfe5fcf6da8bf3d8d97dd5ec92cf4d, reversing changes made to 3f39dcbc098f661ee12d7deba297b1420a0a0e07. --- stream.js | 9 --------- test-client.js | 13 ------------- 2 files changed, 22 deletions(-) diff --git a/stream.js b/stream.js index 9328589..d138eea 100644 --- a/stream.js +++ b/stream.js @@ -72,10 +72,6 @@ function WebSocketStream(target, protocols, options) { // was already open when passed in if (socket.readyState === socket.OPEN) { stream = proxy - } else if (isBrowser) { - stream = proxy - stream.cork() - socket.onopen = onopenBrowser } else { stream = duplexify.obj() socket.onopen = onopen @@ -135,11 +131,6 @@ function WebSocketStream(target, protocols, options) { stream.emit('connect') } - function onopenBrowser () { - stream.uncork() - stream.emit('connect') - } - function onclose() { stream.end() stream.destroy() diff --git a/test-client.js b/test-client.js index a2c75fd..b5ada2c 100644 --- a/test-client.js +++ b/test-client.js @@ -59,16 +59,3 @@ test('coerce client data as binary', function(t) { }) stream.write('hello') }) -test('cork logic test', function (t) { - var stream = ws('ws://localhost:8343', { binary: true }) - stream.on('data', function(o) { - t.equal(o.toString(), 'hello', 'success!') - stream.destroy() - t.end() - }) - stream.cork() - stream.write('he') - stream.write('l') - stream.write('lo') - stream.uncork() -}) \ No newline at end of file