mirror of
https://gitlab.com/soapbox-pub/ditto.git
synced 2025-12-06 03:19:46 +00:00
Fix memory leak in relay?
This commit is contained in:
parent
497b02002e
commit
8fc0092150
1 changed files with 5 additions and 0 deletions
|
|
@ -171,6 +171,10 @@ function connectStream(socket: WebSocket, ip: string | undefined, opts: ConnectS
|
|||
} else {
|
||||
const [verb, , ...rest] = msg;
|
||||
send([verb, subId, ...rest] as NostrRelayMsg);
|
||||
|
||||
if (verb === 'CLOSED') {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
|
|
@ -182,6 +186,7 @@ function connectStream(socket: WebSocket, ip: string | undefined, opts: ConnectS
|
|||
send(['CLOSED', subId, 'error: something went wrong']);
|
||||
}
|
||||
} finally {
|
||||
controllers.get(subId)?.abort();
|
||||
controllers.delete(subId);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue