Lines Matching refs:agent
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',
170 agent);
172 this.agent = agent;
176 if (this.agent && this.agent.protocol)
177 expectedProtocol = this.agent.protocol;
192 (this.agent && this.agent.defaultPort);
269 if (this.agent) {
270 // If there is an agent we should default to Connection:keep-alive,
272 // If it's not a keepAlive agent, and the maxSockets==Infinity, then
274 if (!this.agent.keepAlive && !NumberIsFinite(this.agent.maxSockets)) {
341 if (this.agent) {
342 this.agent.addRequest(this, optsWithoutSignal);
344 // No agent, default to Connection:close.
837 (req.agent && req.agent.options && req.agent.options.timeout)
889 if (!err && req.agent && !socket.destroyed) {