src/aria/core/IO.js
function (error, request, response) {
            if (!response) {
                response = {};
            }

            if (!request && error) {
                request = this.pendingRequests[error.reqId];
            }

            this.clearTimeout(request.id);
            this._normalizeResponse(error, request, response);

            // Extra info for the request object
            request.res = response;
            request.endDownload = (new Date()).getTime();
            request.downloadTime = request.endDownload - request.beginDownload;
            request.responseSize = response.responseText.length;

            this.trafficDown += request.responseSize;

            this.$raiseEvent({
                name : "response",
                req : request
            });

            delete this.pendingRequests[request.id];

            if (aria.core.IOFiltersMgr) {
                aria.core.IOFiltersMgr.callFiltersOnResponse(request, {
                    fn : this._afterResponseFilters,
                    scope : this,
                    args : request
                });
            } else {
                this._afterResponseFilters(null, request);
            }
        }
function (error, request, response) {
            if (!response) {
                response = {};
            }

            if (!request && error) {
                request = this.pendingRequests[error.reqId];
            }

            this.clearTimeout(request.id);
            this._normalizeResponse(error, request, response);

            // Extra info for the request object
            request.res = response;
            request.endDownload = (new Date()).getTime();
            request.downloadTime = request.endDownload - request.beginDownload;
            request.responseSize = response.responseText.length;

            this.trafficDown += request.responseSize;

            this.$raiseEvent({
                name : "response",
                req : request
            });

            delete this.pendingRequests[request.id];

            if (aria.core.IOFiltersMgr) {
                aria.core.IOFiltersMgr.callFiltersOnResponse(request, {
                    fn : this._afterResponseFilters,
                    scope : this,
                    args : request
                });
            } else {
                this._afterResponseFilters(null, request);
            }
        }
function ( error , request , response ) { if ( ! response ) { response = { } ; } if ( ! request && error ) { request = this . pendingRequests [ error . reqId ] ; } this . clearTimeout ( request . id ) ; this . _normalizeResponse ( error , request , response ) ; // Extra info for the request object request . res = response ; request . endDownload = ( new Date ( ) ) . getTime ( ) ; request . downloadTime = request . endDownload - request . beginDownload ; request . responseSize = response . responseText . length ; this . trafficDown += request . responseSize ; this . $raiseEvent ( { name : "response" , req : request } ) ; delete this . pendingRequests [ request . id ] ; if ( aria . core . IOFiltersMgr ) { aria . core . IOFiltersMgr . callFiltersOnResponse ( request , { fn : this . _afterResponseFilters , scope : this , args : request } ) ; } else { this . _afterResponseFilters ( null , request ) ; } }
Handle a transport response. This is the callback function passed to a transport request
@param {Boolean|Object} error Whether there was an error or not
@param {aria.core.CfgBeans:IOAsyncRequestCfg} request
@param {aria.core.CfgBeans:IOAsyncRequestResponseCfg} response
Handle a transport response . This is the callback function passed to a transport request