Bug 1497448: Use try/catch for _handle function in ServerSocketConnection. r=ochameau,jdescottes

At first, I wanted it is better to call DebuggerServer.destroy() when
`devtools.debugger.remote-enabled` will set to false. Likewise, call
DebuggerServer.init() in case of true. But, because DebuggerServer.init() is
called by various context such as RemoteDebugger, restoring is difficult after
destroying. In this patch, simply, we make avoiding to call
DebuggerServer.closeAllListener() from inside of ServerSocketConnection.

Depends on D10864

Differential Revision: https://phabricator.services.mozilla.com/D10865

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Daisuke Akatsuka 2018-11-07 02:17:45 +00:00
Родитель 711e30b3ec
Коммит 7f86f123f9
1 изменённых файлов: 10 добавлений и 8 удалений

Просмотреть файл

@ -638,15 +638,17 @@ ServerSocketConnection.prototype = {
* the connection is denied. If the entire process resolves successfully,
* the connection is finally handed off to the |DebuggerServer|.
*/
_handle() {
async _handle() {
dumpn("Debugging connection starting authentication on " + this.address);
const self = this;
(async function() {
self._listenForTLSHandshake();
await self._createTransport();
await self._awaitTLSHandshake();
await self._authenticate();
})().then(() => this.allow()).catch(e => this.deny(e));
try {
this._listenForTLSHandshake();
await this._createTransport();
await this._awaitTLSHandshake();
await this._authenticate();
this.allow();
} catch (e) {
this.deny(e);
}
},
/**