rem: var timer = Components.classes["@mozilla.org/timer;1"] .createInstance(Components.interfaces.nsITimer); timer.initWithCallback( { notify: function( timer_ ) { if (channel.isPending()) channel.cancel(NS_BINDING_FAILED); } }, SYNC_REQUESTS_TIMEOUT * 1000, Components.interfaces.nsITimer.TYPE_ONE_SHOT ); var stream = channel.open(); timer.cancel();  
add: var stream = channel.open(); 
context: function issueSyncRequest( url, receiverFunc, bLogging ){    if (bLogging == undefined)        bLogging = true;    if (bLogging && LOG_LEVEL > 0) {        logMessage( "issueSyncRequest( \"" + url + "\" )",                    "opening channel." );    }    var channel = getIoService().newChannel(        url, "" /* charset */, null /* baseURI */ );    channel.loadFlags |= Components.interfaces.nsIRequest.LOAD_BYPASS_CACHE;        var timer = Components.classes["@mozilla.org/timer;1"]                .createInstance(Components.interfaces.nsITimer);    timer.initWithCallback(        { // nsITimerCallback:            notify: function( timer_ ) {                        if (channel.isPending())                            channel.cancel(NS_BINDING_FAILED);                    }        },        SYNC_REQUESTS_TIMEOUT * 1000,        Components.interfaces.nsITimer.TYPE_ONE_SHOT );    var stream = channel.open();    timer.cancel();        var status = channel.status;    if (status == Components.results.NS_OK) {        var charset = channel.contentCharset;        if (!charset || charset == "")            charset = "UTF-8";        var str = streamToString( stream, charset );        if (bLogging && LOG_LEVEL > 1) {            logMessage( "issueSyncRequest( \"" + url + "\" )",                        "returned: " + str );        }        if (receiverFunc) {            receiverFunc( str );        }        return str;    }    else if (bLogging && LOG_LEVEL > 0) {        logMessage( "issueSyncRequest( \"" + url + "\" )",                    "failed: " + errorToString(status) );    }        throw status;}
meta: 9421	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/9421/188119b7f6030137779a9d95b9ad28b7b33fed6e/calWcapRequest.js/buggy/calendar/providers/wcap/calWcapRequest.js