Message, incoming2 = parser.incoming = new ParserIncomingMessage(socket);
  incoming2.httpVersionMajor = versionMajor, incoming2.httpVersionMinor = versionMinor, incoming2.httpVersion = `${versionMajor}.${versionMinor}`, incoming2.joinDuplicateHeaders = socket?.server?.joinDuplicateHeaders || parser.joinDuplicateHeaders, incoming2.url = url, incoming2.upgrade = upgrade;
  let n = headers.length;
  if (parser.maxHeaderPairs > 0)
    n = Math.min(n, parser.maxHeaderPairs);
  if (incoming2._addHeaderLines(headers, n), typeof method === "number")
    incoming2.method = allMethods[method];
  else
    incoming2.statusCode = statusCode, incoming2.statusMessage = statusMessage;
  return parser.onIncoming(incoming2, shouldKeepAlive);
}
function parserOnBody(b) {
  let stream = this.incoming;
  if (stream === null)
    return;
  if (!stream._dumped) {
    if (!stream.push(b))
      readStop(this.socket);
  }
}
function parserOnMessageComplete() {
  let parser = this, stream = parser.incoming;
  if (stream !== null) {
    stream.complete = !0;
    let headers = parser._headers;
    if (headers.length)
      stream._addHeaderLines(headers, headers.length), parser._headers = [], parser._url = "";
    stream.push(null);
  }
  readStart(parser.socket);
}
var parsers = new FreeList("parsers", 1000, function parsersCb() {
  let parser = new HTTPParser;
  return cleanParser(parser), parser[kOnHeaders] = parserOnHeaders, parser[kOnHeadersComplete] = parserOnHeadersComplete, parser[kOnBody] = parserOnBody, parser[kOnMessageComplete] = parserOnMessageComplete, parser;
});
function closeParserInstance(parser) {
  parser.close();
}
function freeParser(parser, req, socket) {
  if (parser) {
    if (parser._consumed)
      parser.unconsume();
    if (cleanParser(parser), parser.remove(), parsers.free(parser) === !1)
      setImmediate(closeParserInstance, parser);
    else
      parser.free();
  }
  if (req)
    req.parser = null;
  if (socket)
    socket.parser = null;
}
function cleanParser(parser) {
  parser._headers = [], parser._url = "", parser.socket = null, parser.incoming = null, parser.outgoing = null, parser.maxHeaderPairs = MAX_HEADER_PAIRS, parser[kOnMessageBegin] = null, parser[kOnExecute] = null, parser[kOnTimeout] = null, parser._consumed = !1, parser.onIncoming = null, parser.joinDuplicateHeaders = null;
}
function prepareError(err, parser, rawPacket) {
  if (err.rawPacket = rawPacket || parser.getCurrentBuffer(), typeof err.reason === "string")
    err.message = `Parse Error: ${err.reason}`;
}
var warnedLenient = !1;
function isLenient() {
  if (insecureHTTPParser && !warnedLenient)
    warnedLenient = !0, process.emitWarning("Using insecure HTTP parsing");
  return insecureHTTPParser;
}
$ = {
  validateHeaderName,
  validateHeaderValue,
  _checkIsHttpToken: checkIsHttpToken,
  _checkInvalidHeaderChar: checkInvalidHeaderChar,
  chunkExpression: /(?:^|\W)chunked(?:$|\W)/i,
  continueExpression: /(?:^|\W)100-continue(?:$|\W)/i,
  CRLF: `\r
`,
  freeParser,
  methods,
  parsers,
  kIncomingMessage,
  HTTPParser,
  isLenient,
  prepareError
};
return $})

