(abort, body, client, request, socket, contentLength, header, expectsPayload)
| 8079 | } |
| 8080 | __name(writeBuffer, "writeBuffer"); |
| 8081 | async function writeBlob(abort, body, client, request, socket, contentLength, header, expectsPayload) { |
| 8082 | try { |
| 8083 | if (contentLength != null && contentLength !== body.size) { |
| 8084 | throw new RequestContentLengthMismatchError(); |
| 8085 | } |
| 8086 | const buffer = Buffer.from(await body.arrayBuffer()); |
| 8087 | socket.cork(); |
| 8088 | socket.write(`${header}content-length: ${contentLength}\r |
| 8089 | \r |
| 8090 | `, "latin1"); |
| 8091 | socket.write(buffer); |
| 8092 | socket.uncork(); |
| 8093 | request.onBodySent(buffer); |
| 8094 | request.onRequestSent(); |
| 8095 | if (!expectsPayload && request.reset !== false) { |
| 8096 | socket[kReset] = true; |
| 8097 | } |
| 8098 | client[kResume](); |
| 8099 | } catch (err) { |
| 8100 | abort(err); |
| 8101 | } |
| 8102 | } |
| 8103 | __name(writeBlob, "writeBlob"); |
| 8104 | async function writeIterable(abort, body, client, request, socket, contentLength, header, expectsPayload) { |
| 8105 | assert(contentLength !== 0 || client[kRunning] === 0, "iterator body cannot be pipelined"); |
no test coverage detected
searching dependent graphs…