Fix up VideoStreamer stability, it was user error
This commit is contained in:
parent
4ae2facba7
commit
26e25ec2ed
@ -42,16 +42,16 @@ function pipeStreamOverResponse(res, readStream, totalSize) {
|
||||
}
|
||||
return false;
|
||||
});
|
||||
|
||||
/* Register async abortion handlers */
|
||||
res.onAborted(() => {
|
||||
console.log('Res is no longer valid!');
|
||||
readStream.destroy();
|
||||
});
|
||||
}
|
||||
}).on('end', () => {
|
||||
/* Todo: handle errors of the stream, probably good to simply close the response */
|
||||
});
|
||||
|
||||
/* If you plan to asyncronously respond later on, you MUST listen to onAborted BEFORE returning */
|
||||
res.onAborted(() => {
|
||||
console.log('Res is no longer valid!');
|
||||
readStream.destroy();
|
||||
});
|
||||
}
|
||||
|
||||
/* Yes, you can easily swap to SSL streaming by uncommenting here */
|
||||
|
Loading…
Reference in New Issue
Block a user