Ticket #3297 (closed bug: invalid)

Opened 2 years ago

Last modified 2 years ago

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.

Attachments

XMLHttpRequest.js Download (15.0 KB) - added by flexer 2 years ago.
fix

Change History

Changed 2 years ago by flexer

fix

  Changed 2 years ago by flexer

The easiest way to reproduce the problem is to rapidly change zoom level by mouse wheel.

  Changed 2 years ago by flexer

The problem is reproduced at FF3.6.17(linux, winXPsp3) and at IE8.0.6001.18702(winXPsp3), and the fix works at both (FF and IE).

  Changed 2 years ago by flexer

  • keywords ajax removed

in reply to: ↑ description   Changed 2 years ago by jorix

  • cc xavier.mamano@… added

Replying to flexer:

I have got this error: ... Look at Request.js:

window.setTimeout(function(){
    if (request._aborted !== true) {
        request.send(config.data);
    }
}, 0);

This code is no longer in the trunk.

Please check if using the trunk also fails.

See #2913

  Changed 2 years ago by jorix

NOTE: See trunk examples in: http://openlayers.org/dev/examples, or use code: http://openlayers.org/dev/lib/OpenLayers.js in your examples.

  Changed 2 years ago by erilem

  • status changed from new to closed
  • resolution set to invalid

Good point jorix. I knew we'd fixed that :-) flexer, please reopen if you still see issues with the trunk.

Note: See TracTickets for help on using tickets.