mirror of
https://github.com/HeyPuter/puter.git
synced 2025-02-02 14:18:43 +08:00
fix: small workaround for duplicate close
This commit is contained in:
parent
36dc9664ad
commit
06452f5283
@ -165,7 +165,13 @@ export const make_http_api = ({ Socket, DEFAULT_PORT }) => {
|
||||
sock.on('error', (err) => {
|
||||
req.emit('error', err);
|
||||
});
|
||||
let closed = false;
|
||||
sock.on('close', () => {
|
||||
if ( closed ) {
|
||||
console.error('close event after closed');
|
||||
return;
|
||||
}
|
||||
closed = true;
|
||||
if ( buffer ) {
|
||||
console.log('close with buffer', buffer);
|
||||
const bin = encoder.encode(buffer);
|
||||
|
Loading…
Reference in New Issue
Block a user