����JFIF��� ( %"1"%)+...383,7(-.- 404 Not Found
Sh3ll
OdayForums


Server : Apache/2.4.6 (CentOS) OpenSSL/1.0.2k-fips PHP/7.4.20
System : Linux st2.domain.com 3.10.0-1127.10.1.el7.x86_64 #1 SMP Wed Jun 3 14:28:03 UTC 2020 x86_64
User : apache ( 48)
PHP Version : 7.4.20
Disable Function : NONE
Directory :  /home/real/node-v13.0.1/test/parallel/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //home/real/node-v13.0.1/test/parallel/test-http-keepalive-override.js
'use strict';
const common = require('../common');
const assert = require('assert');

const http = require('http');

const server = http.createServer((req, res) => {
  res.end('ok');
}).listen(0, common.mustCall(() => {
  const agent = http.Agent({
    keepAlive: true,
    maxSockets: 5,
    maxFreeSockets: 2
  });

  const keepSocketAlive = agent.keepSocketAlive;
  const reuseSocket = agent.reuseSocket;

  let called = 0;
  let expectedSocket;
  agent.keepSocketAlive = common.mustCall((socket) => {
    assert(socket);

    called++;
    if (called === 1) {
      return false;
    } else if (called === 2) {
      expectedSocket = socket;
      return keepSocketAlive.call(agent, socket);
    }

    assert.strictEqual(socket, expectedSocket);
    return false;
  }, 3);

  agent.reuseSocket = common.mustCall((socket, req) => {
    assert.strictEqual(socket, expectedSocket);
    assert(req);

    return reuseSocket.call(agent, socket, req);
  }, 1);

  function req(callback) {
    http.request({
      method: 'GET',
      path: '/',
      agent,
      port: server.address().port
    }, common.mustCall((res) => {
      res.resume();
      res.once('end', common.mustCall(() => {
        setImmediate(callback);
      }));
    })).end();
  }

  // Should destroy socket instead of keeping it alive
  req(common.mustCall(() => {
    // Should keep socket alive
    req(common.mustCall(() => {
      // Should reuse the socket
      req(common.mustCall(() => {
        server.close();
      }));
    }));
  }));
}));

ZeroDay Forums Mini