Skip to content

Commit

Permalink
Revert "Merge pull request #147 from scarry1992/cork-logic-browser-fix"
Browse files Browse the repository at this point in the history
This reverts commit 441a94a, reversing
changes made to 3f39dcb.
  • Loading branch information
mcollina committed Mar 27, 2019
1 parent e743003 commit 76ec47a
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 22 deletions.
9 changes: 0 additions & 9 deletions stream.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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()
Expand Down
13 changes: 0 additions & 13 deletions test-client.js
Original file line number Diff line number Diff line change
Expand Up @@ -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()
})

0 comments on commit 76ec47a

Please sign in to comment.