(self, fd, headers, offset = 0, length = -1,
streamOptions = 0)
| 2707 | } |
| 2708 | |
| 2709 | function processRespondWithFD(self, fd, headers, offset = 0, length = -1, |
| 2710 | streamOptions = 0) { |
| 2711 | const state = self[kState]; |
| 2712 | state.flags |= STREAM_FLAGS_HEADERS_SENT; |
| 2713 | |
| 2714 | let headersList; |
| 2715 | try { |
| 2716 | headersList = buildNgHeaderString( |
| 2717 | headers, |
| 2718 | assertValidPseudoHeaderResponse, |
| 2719 | self.session[kStrictSingleValueFields], |
| 2720 | ); |
| 2721 | } catch (err) { |
| 2722 | if (self.ownsFd) |
| 2723 | tryClose(fd); |
| 2724 | self.destroy(err); |
| 2725 | return; |
| 2726 | } |
| 2727 | self[kSentHeaders] = headers; |
| 2728 | |
| 2729 | // Close the writable side of the stream, but only as far as the writable |
| 2730 | // stream implementation is concerned. |
| 2731 | self._final = null; |
| 2732 | self.end(); |
| 2733 | |
| 2734 | const ret = self[kHandle].respond(headersList, streamOptions); |
| 2735 | |
| 2736 | if (ret < 0) { |
| 2737 | if (self.ownsFd) |
| 2738 | tryClose(fd); |
| 2739 | self.destroy(new NghttpError(ret)); |
| 2740 | return; |
| 2741 | } |
| 2742 | |
| 2743 | defaultTriggerAsyncIdScope(self[async_id_symbol], startFilePipe, |
| 2744 | self, fd, offset, length); |
| 2745 | } |
| 2746 | |
| 2747 | function startFilePipe(self, fd, offset, length) { |
| 2748 | const handle = new FileHandle(fd, offset, length); |
no test coverage detected
searching dependent graphs…