bug 1324952 - don't asyncWait on the input stream if we've been stopped in test_be_conservative.js r=mcmanus

MozReview-Commit-ID: 3wkbicHLuUG

--HG--
extra : rebase_source : 5d5aaf89640a62efab203f527dbced441144f677
This commit is contained in:
David Keeler 2017-02-06 15:02:01 -08:00
Родитель af866b1d42
Коммит 906fda1f23
1 изменённых файлов: 9 добавлений и 0 удалений

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

@ -81,18 +81,27 @@ class TLSServerSecurityObserver {
this.input = input;
this.output = output;
this.callbacks = [];
this.stopped = false;
}
onHandshakeDone(socket, status) {
do_print("TLS handshake done");
do_print(`TLS version used: ${status.tlsVersionUsed}`);
if (this.stopped) {
do_print("handshake done callback stopped - closing streams and bailing");
this.input.close();
this.output.close();
return;
}
let callback = new InputStreamCallback(this.output);
this.callbacks.push(callback);
this.input.asyncWait(callback, 0, 0, Services.tm.currentThread);
}
stop() {
this.stopped = true;
this.callbacks.forEach((callback) => {
callback.stop();
});