flyson
flyso****@users*****
2006年 12月 10日 (日) 01:09:46 JST
Index: bbs2chreader/content/bbs2chreader/server/thread.js diff -u bbs2chreader/content/bbs2chreader/server/thread.js:1.1.2.5 bbs2chreader/content/bbs2chreader/server/thread.js:1.1.2.6 --- bbs2chreader/content/bbs2chreader/server/thread.js:1.1.2.5 Sun Dec 10 00:03:28 2006 +++ bbs2chreader/content/bbs2chreader/server/thread.js Sun Dec 10 01:09:46 2006 @@ -290,8 +290,18 @@ datDownload: function(){ - this.httpChannel = this._ioService.newChannelFromURI(this.dat.datURL) + + if(this._bbs2chService.pref.getBoolPref("fls.bbs2chreader.bypas_http_proxy")){ + // vNVðoCpXµ½ nsIHttpChannel Ìì¬ + var httpProtocolHandler = this._ioService.getProtocolHandler("http") + .QueryInterface(Components.interfaces.nsIHttpProtocolHandler); + this.httpChannel = httpProtocolHandler.newProxiedChannel(this.dat.datURL, null) + .QueryInterface(Components.interfaces.nsIHttpChannel); + }else{ + this.httpChannel = this._ioService.newChannelFromURI(this.dat.datURL) .QueryInterface(Components.interfaces.nsIHttpChannel); + } + this.httpChannel.requestMethod = "GET"; this.httpChannel.redirectionLimit = 0; // 302 Ì_CNgðsíÈ¢ this.httpChannel.loadFlags = this.httpChannel.LOAD_BYPASS_CACHE; @@ -434,8 +444,17 @@ var datURL = this._ioService.newURI(datURLSpec, null, null) .QueryInterface(Components.interfaces.nsIURL); - this.httpChannel = this._ioService.newChannelFromURI(datURL) + if(this._bbs2chService.pref.getBoolPref("fls.bbs2chreader.bypas_http_proxy")){ + // vNVðoCpXµ½ nsIHttpChannel Ìì¬ + var httpProtocolHandler = this._ioService.getProtocolHandler("http") + .QueryInterface(Components.interfaces.nsIHttpProtocolHandler); + this.httpChannel = httpProtocolHandler.newProxiedChannel(datURL, null) .QueryInterface(Components.interfaces.nsIHttpChannel); + }else{ + this.httpChannel = this._ioService.newChannelFromURI(datURL) + .QueryInterface(Components.interfaces.nsIHttpChannel); + } + this.httpChannel.requestMethod = "GET"; this.httpChannel.redirectionLimit = 0; // 302 Ì_CNgðsíÈ¢ this.httpChannel.loadFlags = this.httpChannel.LOAD_BYPASS_CACHE;