Compare commits

..

2 Commits

Author SHA1 Message Date
e699c44480 v2.0.3: bugfix invalid access of socket._handle 2019-09-03 09:19:33 -06:00
7da7746a31 don't assume socket._handle exists 2019-09-03 09:14:47 -06:00
2 changed files with 29 additions and 29 deletions

View File

@ -266,9 +266,9 @@ function extractSocketProps(socket, propNames) {
propNames.forEach(function (propName) { propNames.forEach(function (propName) {
props[propName] = socket['_' + propName]; props[propName] = socket['_' + propName];
}); });
} else if ( } else if (socket._handle) {
socket._handle if (
&& socket._handle._parent socket._handle._parent
&& socket._handle._parent.owner && socket._handle._parent.owner
&& socket._handle._parent.owner.stream && socket._handle._parent.owner.stream
&& socket._handle._parent.owner.stream.remotePort && socket._handle._parent.owner.stream.remotePort
@ -278,7 +278,6 @@ function extractSocketProps(socket, propNames) {
}); });
} else if ( } else if (
socket._handle._parentWrap socket._handle._parentWrap
&& socket._handle._parentWrap
&& socket._handle._parentWrap.remotePort && socket._handle._parentWrap.remotePort
) { ) {
propNames.forEach(function (propName) { propNames.forEach(function (propName) {
@ -295,6 +294,7 @@ function extractSocketProps(socket, propNames) {
props[propName] = socket._handle._parentWrap._handle.owner.stream[propName]; props[propName] = socket._handle._parentWrap._handle.owner.stream[propName];
}); });
} }
}
return props; return props;
} }
function extractSocketProp(socket, propName) { function extractSocketProp(socket, propName) {

View File

@ -1,6 +1,6 @@
{ {
"name": "proxy-packer", "name": "proxy-packer",
"version": "2.0.2", "version": "2.0.3",
"description": "A strategy for packing and unpacking a proxy stream (i.e. packets through a tunnel). Handles multiplexed and tls connections. Used by telebit and telebitd.", "description": "A strategy for packing and unpacking a proxy stream (i.e. packets through a tunnel). Handles multiplexed and tls connections. Used by telebit and telebitd.",
"main": "index.js", "main": "index.js",
"scripts": { "scripts": {