(s, data, options)
| 209 | } |
| 210 | } |
| 211 | write(s, data, options) { |
| 212 | if (options?.more) { |
| 213 | this.#buffer ??= new SSLStream(undefined, options.byteLength); |
| 214 | this.#buffer.writeChunk(data); |
| 215 | return Math.max(0, s.writable - this.#buffer.bytesAvailable - 32); |
| 216 | } |
| 217 | if (this.#buffer) { |
| 218 | this.#buffer.writeChunk(data); |
| 219 | data = this.#buffer.getChunk(); |
| 220 | this.#buffer = undefined; |
| 221 | } |
| 222 | |
| 223 | if (data.byteLength > maxFragmentSize) |
| 224 | throw new Error("too large"); |
| 225 | this.startTrace("packetize"); |
| 226 | const packet = recordProtocol.packetize(this, recordProtocol.application_data, data); |
| 227 | s.writable = s.write(packet); |
| 228 | return Math.max(0, s.writable - 32); |
| 229 | } |
| 230 | close(s) { |
| 231 | this.startTrace("packetize"); |
| 232 | const packet = SSLAlert.packetize(this, 0, SSLAlert.close_notify); |
nothing calls this directly
no test coverage detected