Pier Angelo Vendrame pushed to branch tor-browser-102.9.0esr-12.5-1 at The Tor Project / Applications / Tor Browser
Commits:
-
50201d24
by Pier Angelo Vendrame at 2023-03-31T17:43:49+02:00
1 changed file:
Changes:
... | ... | @@ -135,6 +135,18 @@ class AsyncSocket { |
135 | 135 | this.inputQueue.push({
|
136 | 136 | onInputStreamReady: stream => {
|
137 | 137 | try {
|
138 | + if (!this.scriptableInputStream.available()) {
|
|
139 | + // This means EOF, but not closed yet. However, arriving at EOF
|
|
140 | + // should be an error condition for us, since we are in a socket,
|
|
141 | + // and EOF should mean peer disconnected.
|
|
142 | + // If the stream has been closed, this function itself should
|
|
143 | + // throw.
|
|
144 | + reject(
|
|
145 | + new Error("onInputStreamReady called without available bytes.")
|
|
146 | + );
|
|
147 | + return;
|
|
148 | + }
|
|
149 | + |
|
138 | 150 | // read our string from input stream
|
139 | 151 | let str = this.scriptableInputStream.read(
|
140 | 152 | this.scriptableInputStream.available()
|