[tbb-commits] [tor-launcher/master] Bug 31487: Modify moat client code so it is compatible with ESR68

gk at torproject.org gk at torproject.org
Thu Aug 22 21:16:18 UTC 2019


commit f69f055708526c207eb69f40f577da9a80cd75ca
Author: Kathy Brade <brade at pearlcrescent.com>
Date:   Thu Aug 22 09:39:20 2019 -0400

    Bug 31487: Modify moat client code so it is compatible with ESR68
    
    Account for changes to XPCOM APIs.
---
 src/modules/tl-bridgedb.jsm | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/src/modules/tl-bridgedb.jsm b/src/modules/tl-bridgedb.jsm
index de580bc..8cc7919 100644
--- a/src/modules/tl-bridgedb.jsm
+++ b/src/modules/tl-bridgedb.jsm
@@ -532,7 +532,7 @@ _MoatRequestor.prototype =
     let noTimeout = 0xFFFFFFFF; // UINT32_MAX
     let proxyInfo = proxyPS.newProxyInfoWithAuth(this.mMeekClientProxyType,
                               this.mMeekClientIP, this.mMeekClientPort,
-                              userName, password,
+                              userName, password, undefined, undefined,
                               flags, noTimeout, undefined);
     let uriStr = TorLauncherUtil.getCharPref(this.kPrefMoatService);
     if (!uriStr)
@@ -546,14 +546,14 @@ _MoatRequestor.prototype =
 
     // There does not seem to be a way to directly create an nsILoadInfo from
     // JavaScript, so we create a throw away non-proxied channel to get one.
-    let loadInfo = Services.io.newChannelFromURI2(uri, undefined,
+    let loadInfo = Services.io.newChannelFromURI(uri, undefined,
                         Services.scriptSecurityManager.getSystemPrincipal(),
                         undefined,
                         Ci.nsILoadInfo.SEC_ALLOW_CROSS_ORIGIN_DATA_IS_NULL,
                         Ci.nsIContentPolicy.TYPE_OTHER).loadInfo;
     let httpHandler = Services.io.getProtocolHandler("http")
                                  .QueryInterface(Ci.nsIHttpProtocolHandler);
-    let ch = httpHandler.newProxiedChannel2(uri, proxyInfo, 0, undefined,
+    let ch = httpHandler.newProxiedChannel(uri, proxyInfo, 0, undefined,
                                  loadInfo).QueryInterface(Ci.nsIHttpChannel);
 
     // Remove unwanted HTTP headers and set request parameters.
@@ -616,13 +616,13 @@ _MoatResponseListener.prototype =
   mResponseLength: 0,
   mResponseBody: undefined,
 
-  onStartRequest: function(aRequest, aContext)
+  onStartRequest: function(aRequest)
   {
     this.mResponseLength = 0;
     this.mResponseBody = "";
   },
 
-  onStopRequest: function(aRequest, aContext, aStatus)
+  onStopRequest: function(aRequest, aStatus)
   {
     this.mChannel = undefined;
 
@@ -636,9 +636,9 @@ _MoatResponseListener.prototype =
     let statusCode, msg;
     try
     {
-      statusCode = aContext.responseStatus;
-      if (aContext.responseStatusText)
-        msg = statusCode + " " + aContext.responseStatusText;
+      statusCode = aRequest.responseStatus;
+      if (aRequest.responseStatusText)
+        msg = statusCode + " " + aRequest.responseStatusText;
     }
     catch (e) {}
 
@@ -693,7 +693,7 @@ _MoatResponseListener.prototype =
     }
   }, // onStopRequest
 
-  onDataAvailable: function(aRequest, aContext, aStream, aSrcOffset, aLength)
+  onDataAvailable: function(aRequest, aStream, aSrcOffset, aLength)
   {
     TorLauncherLogger.log(2, "Moat onDataAvailable: " + aLength + " bytes");
     if ((this.mResponseLength + aLength) > this.mRequestor.kMaxResponseLength)



More information about the tbb-commits mailing list