Loading toolkit/components/tor-launcher/TorProtocolService.sys.mjs +28 −0 Original line number Diff line number Diff line Loading @@ -188,6 +188,24 @@ export const TorProtocolService = { return TorParsers.parseReply(cmd, keyword, response); }, async onionAuthAdd(hsAddress, b64PrivateKey, isPermanent) { return this._withConnection(conn => { return conn.onionAuthAdd(hsAddress, b64PrivateKey, isPermanent); }); }, async onionAuthRemove(hsAddress) { return this._withConnection(conn => { return conn.onionAuthRemove(hsAddress); }); }, async onionAuthViewKeys() { return this._withConnection(conn => { return conn.onionAuthViewKeys(); }); }, // TODO: transform the following 4 functions in getters. At the moment they // are also used in torbutton. Loading Loading @@ -630,6 +648,16 @@ export const TorProtocolService = { } }, async _withConnection(func) { // TODO: Make more robust? const conn = await this._getConnection(); try { return await func(conn); } finally { this._returnConnection(); } }, // If aConn is omitted, the cached connection is closed. _closeConnection() { if (this._controlConnection) { Loading Loading
toolkit/components/tor-launcher/TorProtocolService.sys.mjs +28 −0 Original line number Diff line number Diff line Loading @@ -188,6 +188,24 @@ export const TorProtocolService = { return TorParsers.parseReply(cmd, keyword, response); }, async onionAuthAdd(hsAddress, b64PrivateKey, isPermanent) { return this._withConnection(conn => { return conn.onionAuthAdd(hsAddress, b64PrivateKey, isPermanent); }); }, async onionAuthRemove(hsAddress) { return this._withConnection(conn => { return conn.onionAuthRemove(hsAddress); }); }, async onionAuthViewKeys() { return this._withConnection(conn => { return conn.onionAuthViewKeys(); }); }, // TODO: transform the following 4 functions in getters. At the moment they // are also used in torbutton. Loading Loading @@ -630,6 +648,16 @@ export const TorProtocolService = { } }, async _withConnection(func) { // TODO: Make more robust? const conn = await this._getConnection(); try { return await func(conn); } finally { this._returnConnection(); } }, // If aConn is omitted, the cached connection is closed. _closeConnection() { if (this._controlConnection) { Loading