Skip to content

Commit

Permalink
Fix compatibility with Node.js master
Browse files Browse the repository at this point in the history
  • Loading branch information
lpinca committed Apr 13, 2017
1 parent 651ce41 commit 8e85b81
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions lib/spdy/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,14 @@ proto._onStream = function _onStream (stream) {
socket = new net.Socket(socketOptions)
}

// This is needed because the `error` listener, added by the default
// `connection` listener, no longer has bound arguments. It relies instead
// on the `server` property of the socket. See https://github.com/nodejs/node/pull/11926
// for more details.
// This is only done for Node.js >= 4 in order to not break backwards
// compatibility with older versions of the platform.
if (process.versions.modules >= 46) { socket.server = this }

handle.assignSocket(socket)

// For v0.8
Expand Down

0 comments on commit 8e85b81

Please sign in to comment.