(payload, force)
| 186 | } |
| 187 | |
| 188 | finalize(payload, force) { |
| 189 | if (this._protocol._kexinit === undefined || force) { |
| 190 | const output = this._zlib.writeSync(payload, true); |
| 191 | const packet = this._protocol._cipher.allocPacket(output.totalLen); |
| 192 | if (output.push === undefined) { |
| 193 | packet.set(output, 5); |
| 194 | } else { |
| 195 | for (let i = 0, p = 5; i < output.length; ++i) { |
| 196 | const chunk = output[i]; |
| 197 | packet.set(chunk, p); |
| 198 | p += chunk.length; |
| 199 | } |
| 200 | } |
| 201 | return packet; |
| 202 | } |
| 203 | return payload; |
| 204 | } |
| 205 | } |
| 206 | |
| 207 | class PacketWriter { |
nothing calls this directly
no test coverage detected