Ticket #3297 (closed bug: invalid)
XMLHttpRequest.js : do NOT call _object.send after _object.abort
| Reported by: | flexer | Owned by: | |
|---|---|---|---|
| Priority: | minor | Milestone: | 2.11 Release |
| Component: | Ajax | Version: | 2.10 |
| Keywords: | Cc: | Andrey.Aniskovets@…, xavier.mamano@… | |
| State: |
Description
I have got this error:
uncaught exception: [Exception... "Component returned failure code: 0xc1f30001 (NS_ERROR_NOT_INITIALIZED) [nsIXMLHttpRequest.send]" nsresult: "0xc1f30001 (NS_ERROR_NOT_INITIALIZED)" location: "JS frame :: .../ol/OpenLayers/Request/XMLHttpRequest.js :: anonymous :: line 227" data: no]
Another user has the same problem: http://osgeo-org.1803224.n2.nabble.com/SOLVED-Firefox-nsIXMLHttpRequest-send-throwing-0xc1f30001-NS-ERROR-NOT-INITIALIZED-td5903108.html#a6349420 and there is my comment ("flexer") - almost the same as below:
A solution: Do NOT call "this._object.send(vData);" if "this._object.abort();" has been called (see XMLHttpRequest.js).
Look at Request.js:
window.setTimeout(function(){
if (request._aborted !== true) {
request.send(config.data);
}
}, 0);
and look at XMLHttpRequest.js :
cXMLHttpRequest.prototype.send = function(vData) {
// Add method sniffer if (cXMLHttpRequest.onsend)
....
and look at XMLHttpRequest.js:
cXMLHttpRequest.prototype.abort = function() {
.... // BUGFIX: Gecko - unnecessary DONE when aborting if (this.readyState > cXMLHttpRequest.UNSENT)
this._aborted = true;
this._object.abort(); ....
I have added to XMLHttpRequest.js these lines and the problem was solved:
cXMLHttpRequest.prototype.send = function(vData) {
if (!!this._isAbortCalled)
return;
....
cXMLHttpRequest.prototype.abort = function() {
this._isAbortCalled = true; ....
The changed file (with the fix) is attached.

