| 2866 | } |
| 2867 | |
| 2868 | function afterOpen(session, options, headers, streamOptions, err, fd) { |
| 2869 | const state = this[kState]; |
| 2870 | const onError = options.onError; |
| 2871 | if (err) { |
| 2872 | if (onError) |
| 2873 | onError(err); |
| 2874 | else |
| 2875 | this.destroy(err); |
| 2876 | return; |
| 2877 | } |
| 2878 | if (this.destroyed || this.closed) { |
| 2879 | tryClose(fd); |
| 2880 | return; |
| 2881 | } |
| 2882 | state.fd = fd; |
| 2883 | |
| 2884 | fs.fstat(fd, |
| 2885 | doSendFileFD.bind(this, session, options, fd, headers, streamOptions)); |
| 2886 | } |
| 2887 | |
| 2888 | class ServerHttp2Stream extends Http2Stream { |
| 2889 | constructor(session, handle, id, options, headers) { |