mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-02-25 09:04:53 +00:00
PTY: Disallow infinite writing to slaves.
This way we don't buffer ungodly amounts of output in the kernel when doing e.g "cat /dev/random" on a PTY.
This commit is contained in:
@@ -45,3 +45,8 @@ void MasterPTY::on_slave_write(const byte* data, size_t size)
|
||||
{
|
||||
m_buffer.write(data, size);
|
||||
}
|
||||
|
||||
bool MasterPTY::can_write_from_slave() const
|
||||
{
|
||||
return m_buffer.bytes_in_write_buffer() < 4096;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user