MCPcopy Create free account
hub / github.com/nodejs/node / lazyllhttp

Function lazyllhttp

deps/undici/undici.js:7049–7151  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

7047 var kSocketUsed = /* @__PURE__ */ Symbol("kSocketUsed");
7048 var extractBody;
7049 function lazyllhttp() {
7050 const llhttpWasmData = process.env.JEST_WORKER_ID ? require_llhttp_wasm() : void 0;
7051 let mod;
7052 let useWasmSIMD = process.arch !== "ppc64";
7053 if (process.env.UNDICI_NO_WASM_SIMD === "1") {
7054 useWasmSIMD = false;
7055 } else if (process.env.UNDICI_NO_WASM_SIMD === "0") {
7056 useWasmSIMD = true;
7057 }
7058 if (useWasmSIMD) {
7059 try {
7060 mod = new WebAssembly.Module(require_llhttp_simd_wasm());
7061 } catch {
7062 }
7063 }
7064 if (!mod) {
7065 mod = new WebAssembly.Module(llhttpWasmData || require_llhttp_wasm());
7066 }
7067 return new WebAssembly.Instance(mod, {
7068 env: {
7069 /**
7070 * @param {number} p
7071 * @param {number} at
7072 * @param {number} len
7073 * @returns {number}
7074 */
7075 wasm_on_url: /* @__PURE__ */ __name((p, at, len) => {
7076 return 0;
7077 }, "wasm_on_url"),
7078 /**
7079 * @param {number} p
7080 * @param {number} at
7081 * @param {number} len
7082 * @returns {number}
7083 */
7084 wasm_on_status: /* @__PURE__ */ __name((p, at, len) => {
7085 assert(currentParser.ptr === p);
7086 const start = at - currentBufferPtr + currentBufferRef.byteOffset;
7087 return currentParser.onStatus(new FastBuffer(currentBufferRef.buffer, start, len));
7088 }, "wasm_on_status"),
7089 /**
7090 * @param {number} p
7091 * @returns {number}
7092 */
7093 wasm_on_message_begin: /* @__PURE__ */ __name((p) => {
7094 assert(currentParser.ptr === p);
7095 return currentParser.onMessageBegin();
7096 }, "wasm_on_message_begin"),
7097 /**
7098 * @param {number} p
7099 * @param {number} at
7100 * @param {number} len
7101 * @returns {number}
7102 */
7103 wasm_on_header_field: /* @__PURE__ */ __name((p, at, len) => {
7104 assert(currentParser.ptr === p);
7105 const start = at - currentBufferPtr + currentBufferRef.byteOffset;
7106 return currentParser.onHeaderField(new FastBuffer(currentBufferRef.buffer, start, len));

Callers 1

connectH1Function · 0.70

Calls 9

__nameFunction · 0.85
assertFunction · 0.50
onStatusMethod · 0.45
onMessageBeginMethod · 0.45
onHeaderFieldMethod · 0.45
onHeaderValueMethod · 0.45
onHeadersCompleteMethod · 0.45
onBodyMethod · 0.45
onMessageCompleteMethod · 0.45

Tested by

no test coverage detected