bdy 1.22.67-master → 1.22.68-master
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/distTs/package.json
CHANGED
|
@@ -86,8 +86,19 @@ class ServerSsh extends events_1.default {
|
|
|
86
86
|
if (this.server) {
|
|
87
87
|
this.injected += 1;
|
|
88
88
|
logger_1.default.debug(`injectSocket: ${this.injected} concurrent injected connection(s)`);
|
|
89
|
+
// Count inbound channel bytes the nested SSH server actually receives.
|
|
90
|
+
// CHANNEL_DATA pushes into the readable via .push(), so wrapping it is a
|
|
91
|
+
// read-only observation that does not change flow/backpressure.
|
|
92
|
+
let inBytes = 0;
|
|
93
|
+
const origPush = stream.push.bind(stream);
|
|
94
|
+
stream.push = (chunk, enc) => {
|
|
95
|
+
if (chunk)
|
|
96
|
+
inBytes += chunk.length;
|
|
97
|
+
return origPush(chunk, enc);
|
|
98
|
+
};
|
|
89
99
|
stream.once('close', () => {
|
|
90
100
|
this.injected -= 1;
|
|
101
|
+
logger_1.default.debug(`injectSocket received ${inBytes} inbound nested-SSH bytes (handshake already consumed)`);
|
|
91
102
|
});
|
|
92
103
|
this.server.injectSocket(stream);
|
|
93
104
|
}
|