/third_party/node/test/parallel/ |
H A D | test-http-agent-scheduling.js | 14 function makeRequest(url, agent, callback) { 16 .request(url, { agent }, (res) => { 29 function bulkRequest(url, agent, done) { 31 let count = agent.maxSockets; 33 for (let i = 0; i < agent.maxSockets; i++) { 34 makeRequest(url, agent, callback); 52 const agent = new http.Agent({ 57 bulkRequest(url, agent, (ports) => { 58 makeRequest(url, agent, (port) => { 60 makeRequest(url, agent, (por [all...] |
H A D | test-http-agent-keepalive.js | 30 const agent = new Agent({ 53 agent: agent, 60 assert.strictEqual(agent.sockets[name].length, 1); 61 assert.strictEqual(agent.freeSockets[name], undefined); 62 assert.strictEqual(agent.totalSocketCount, 1); 72 assert.strictEqual(agent.sockets[name].length, 1); 73 assert.strictEqual(agent.freeSockets[name], undefined); 75 assert.strictEqual(agent.sockets[name], undefined); 76 assert.strictEqual(agent [all...] |
H A D | test-http-keep-alive.js | 35 const agent = new http.Agent({ maxSockets: 1 }); 40 name = agent.getName({ port: this.address().port }); 42 path: '/', headers: headers, port: this.address().port, agent: agent 44 assert.strictEqual(agent.sockets[name].length, 1); 45 assert.strictEqual(agent.requests[name].length, 2); 50 path: '/', headers: headers, port: this.address().port, agent: agent 52 assert.strictEqual(agent.sockets[name].length, 1); 53 assert.strictEqual(agent [all...] |
H A D | test-http-keep-alive-close-on-header.js | 40 const agent = new http.Agent({ maxSockets: 1 }); 41 const name = agent.getName({ port: this.address().port }); 47 agent: agent 49 assert.strictEqual(agent.sockets[name].length, 1); 64 agent: agent 66 assert.strictEqual(agent.sockets[name].length, 1); 80 agent: agent [all...] |
H A D | test-http-addrequest-localaddress.js | 9 const agent = require('http').globalAgent; 16 agent.maxSockets = 0; 20 agent.addRequest(req, 'localhost', 8080, '127.0.0.1'); 21 assert.strictEqual(Object.keys(agent.requests).length, 1); 23 Object.keys(agent.requests)[0], 28 agent.addRequest(req, { 34 assert.strictEqual(Object.keys(agent.requests).length, 1); 36 Object.keys(agent.requests)[0],
|
H A D | test-https-agent-create-connection.js | 11 const agent = new https.Agent(); 54 _agentKey: agent.getName({ port, host }) 57 const socket = agent.createConnection(options); 70 _agentKey: agent.getName({ port, host }) 72 const socket = agent.createConnection(port, options); 85 _agentKey: agent.getName({ port, host }) 87 const socket = agent.createConnection(port, host, options); 101 const socket = agent.createConnection(port, host, options); 113 const socket = agent.createConnection(port, host, options); 128 const socket = agent [all...] |
H A D | test-http-client-reject-unexpected-agent.js | 14 'agent', 34 function createRequest(agent) { 35 const options = Object.assign(baseOptions, { agent }); 49 failingAgentOptions.forEach((agent) => { 51 () => createRequest(agent), 55 message: 'The "options.agent" property must be one of Agent-like ' + 57 common.invalidArgTypeHelper(agent) 62 acceptableAgentOptions.forEach((agent) => { 63 createRequest(agent);
|
H A D | test-http-agent-maxtotalsockets.js | 33 const agent = new http.Agent({ 53 agent.destroy(); 63 agent, 69 for (const key of Object.keys(agent.sockets)) { 70 assert(agent.sockets[key].length <= maxSockets); 81 for (const key of Object.keys(agent.sockets)) { 82 num += agent.sockets[key].length; 89 for (const key of Object.keys(agent.requests)) { 90 num += agent.requests[key].length;
|
H A D | test-https-agent-abort-controller.js | 13 const agent = new Agent(); 29 _agentKey: agent.getName({ port, host }) 35 const connection = agent.createConnection({ ...options, signal }); 46 const connection = agent.createConnection({ ...options, signal }); 58 agent: agent, 74 agent: agent,
|
H A D | test-http-agent-maxsockets.js | 7 const agent = new http.Agent({ 24 agent: agent, 30 const freepool = agent.freeSockets[Object.keys(agent.freeSockets)[0]]; 33 agent.destroy();
|
H A D | test-http-agent-maxsockets-respected.js | 13 const agent = new http.Agent({ 33 agent: agent, 49 const sockets = agent.sockets[Object.keys(agent.sockets)[0]];
|
H A D | test-https-agent-sockets-leak.js | 22 const agent = new https.Agent({ 33 agent: agent 38 // Only one entry should exist in agent.sockets pool 39 // If there are more entries in agent.sockets, 41 assert.strictEqual(Object.keys(agent.sockets).length, 1); 45 // exist in agent.sockets pool after both request and socket 47 assert.strictEqual(Object.keys(agent.sockets).length, 0);
|
H A D | test-https-agent-sni.js | 39 const agent = new https.Agent({ 44 agent: agent, 54 agent: agent,
|
H A D | test-http-client-override-global-agent.js | 12 const agent = new http.Agent(); 13 const name = agent.getName({ port: server.address().port }); 14 http.globalAgent = agent; 17 assert(name in agent.sockets); // Agent has indeed been used
|
H A D | test-https-agent-getname.js | 10 const agent = new https.Agent(); 14 agent.getName(), 20 agent.getName({}), 50 agent.getName(options),
|
H A D | test-http-client-timeout-connect-listener.js | 19 const agent = new http.Agent({ keepAlive: true, maxSockets: 1 }); 20 const options = { port: server.address().port, agent: agent }; 24 agent.destroy();
|
H A D | test-https-client-override-global-agent.js | 23 const agent = new https.Agent(); 24 const name = agent.getName({ port: server.address().port }); 25 https.globalAgent = agent; 28 assert(name in agent.sockets); // Agent has indeed been used
|
H A D | test-http-client-timeout-option-listeners.js | 6 const agent = new http.Agent({ keepAlive: true }); 16 agent, 31 agent.destroy(); 38 const sockets = agent.sockets[`${options.host}:${options.port}:`];
|
H A D | test-http-keepalive-request.js | 44 const agent = http.Agent({ keepAlive: true }); 55 agent.destroy(); 62 agent: agent
|
/third_party/python/Lib/test/ |
H A D | test_robotparser.py | 14 agent = 'test_robotparser' variable in BaseRobotTest 26 agent, url = url 27 return agent, url 28 return self.agent, url 32 agent, url = self.get_agent_and_url(url) 33 with self.subTest(url=url, agent=agent): 34 self.assertTrue(self.parser.can_fetch(agent, url)) 38 agent, url = self.get_agent_and_url(url) 39 with self.subTest(url=url, agent 144 agent = 'figtree' global() variable in CrawlDelayAndRequestRateTest 153 agent = 'FigTree Robot libwww-perl/5.04' global() variable in DifferentAgentTest 192 agent = 'Googlebot' global() variable in AnotherInvalidRequestRateTest 208 agent = 'Googlebot' global() variable in UserAgentOrderingTest 213 agent = 'Googlebot-Mobile' global() variable in UserAgentGoogleMobileTest 224 agent = 'googlebot' global() variable in GoogleURLOrderingTest [all...] |
/third_party/node/lib/ |
H A D | _http_client.js | 157 let agent = options.agent; 159 if (agent === false) { 160 agent = new defaultAgent.constructor(); 161 } else if (agent === null || agent === undefined) { 163 agent = defaultAgent; 165 // Explicitly pass through this statement as agent will not be used 167 } else if (typeof agent.addRequest !== 'function') { 168 throw new ERR_INVALID_ARG_TYPE('options.agent', [all...] |
H A D | _http_agent.js | 127 debug('agent.on(free)', name); 200 const agent = this; 202 agent.emit('keylog', keylog, this); 228 // Pacify parallel/test-http-agent-getname by only appending 374 function installListeners(agent, s, options) { 377 agent.emit('free', s, options); 386 agent.totalSocketCount--; 387 agent.removeSocket(s, options); 396 const sockets = agent.freeSockets; 410 agent [all...] |
/third_party/node/deps/undici/src/lib/ |
H A D | global.js | 7 const Agent = require('./agent') 13 function setGlobalDispatcher (agent) { 14 if (!agent || typeof agent.dispatch !== 'function') { 15 throw new InvalidArgumentError('Argument agent must implement Agent') 18 value: agent,
|
/third_party/node/src/tracing/ |
H A D | trace_event.cc | 10 void TraceEventHelper::SetAgent(Agent* agent) { in SetAgent() argument 11 if (agent) { in SetAgent() 12 g_agent = agent; in SetAgent() 13 g_controller = agent->GetTracingController(); in SetAgent()
|
/third_party/node/deps/npm/node_modules/@npmcli/agent/lib/ |
H A D | index.js | 11 const getAgent = (url, { agent, proxy, noProxy, ...options } = {}) => { 13 if (agent != null) { 14 return agent 48 agent: agentCache,
|