More work on #286 - specifically the duration
git-svn-id: https://beef.googlecode.com/svn/trunk@773 b87d56ec-f9c0-11de-8c8a-61c5e9addfc9
This commit is contained in:
@@ -125,6 +125,8 @@ beef.net = {
|
||||
var response = new this.response;
|
||||
response.was_cross_domain = cross_domain;
|
||||
|
||||
var start_time = new Date().getTime();
|
||||
|
||||
//build and execute request
|
||||
$j.ajax({type: method,
|
||||
dataType: dataType,
|
||||
@@ -133,19 +135,23 @@ beef.net = {
|
||||
timeout: (timeout * 1000),
|
||||
//function on success
|
||||
success: function(data, textStatus, jqXHR){
|
||||
var end_time = new Date().getTime();
|
||||
console.log(data); //TODO remove after testing
|
||||
response.status_code = "200";
|
||||
response.response_body = data;
|
||||
response.port_status = "open";
|
||||
response.was_timedout = false;
|
||||
response.duration = (end_time - start_time);
|
||||
},
|
||||
//function on failure
|
||||
error: function(jqXHR, textStatus, errorThrown){
|
||||
var end_time = new Date().getTime();
|
||||
console.log(errorThrown); //TODO remove after testing
|
||||
response.status_code = "TODO: errorThrown";
|
||||
response.duration = end_time - start_time;
|
||||
}
|
||||
});
|
||||
//return response;
|
||||
return response;
|
||||
},
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user