Moved the curl formatting into the log and changed the arguments for the log event listeneres to
receive both the "message" and the "curlCommand". Added a "tracer" logger which allows you to create log files that a executable scripts. Those scripts will write all of the log messages as script comments, and not comment out the curlCommands, so that they can trace their application and use the generated script to recreate the issue. Most changes are simply cased by adding the "unused" rule to jshint.
This commit is contained in:
@ -8,22 +8,21 @@
|
||||
*/
|
||||
module.exports = HttpConnector;
|
||||
|
||||
var http = require('http');
|
||||
var https = require('https');
|
||||
var handles = {
|
||||
http: require('http'),
|
||||
https: require('https')
|
||||
};
|
||||
var _ = require('../utils');
|
||||
var errors = require('../errors');
|
||||
var qs = require('querystring');
|
||||
var KeepAliveAgent = require('agentkeepalive/lib/agent');
|
||||
var ConnectionAbstract = require('../connection');
|
||||
var defaultHeaders = {
|
||||
'connection': 'keep-alive'
|
||||
};
|
||||
|
||||
|
||||
function HttpConnector(host, config) {
|
||||
ConnectionAbstract.call(this, host, config);
|
||||
|
||||
this.hand = require(this.host.protocol);
|
||||
this.hand = handles[this.host.protocol];
|
||||
this.agent = new KeepAliveAgent({
|
||||
maxSockets: 1,
|
||||
maxKeepAliveRequests: 0, // max requests per keepalive socket, default is 0, no limit.
|
||||
@ -58,7 +57,6 @@ HttpConnector.prototype.makeReqParams = function (params) {
|
||||
};
|
||||
|
||||
var query = this.host.query ? this.host.query : null;
|
||||
var queryStr;
|
||||
|
||||
if (typeof query === 'string') {
|
||||
query = qs.parse(query);
|
||||
@ -85,9 +83,7 @@ HttpConnector.prototype.request = function (params, cb) {
|
||||
var incoming;
|
||||
var timeoutId;
|
||||
var request;
|
||||
var requestId = this.requestCount;
|
||||
var response;
|
||||
var responseStarted = false;
|
||||
var status = 0;
|
||||
var timeout = params.timeout || this.config.timeout;
|
||||
var log = this.config.log;
|
||||
|
||||
Reference in New Issue
Block a user