We can now participate in the TCP connection closing handshake. :^)
This implementation is definitely not complete and needs to handle a
bunch of other cases. But it's a huge improvement over not being able
to close connections at all.
Note that we hold on to pending-close sockets indefinitely, until they
are moved into the Closed state. This should also have a timeout but
that's still a FIXME. :^)
Fixes#428.
If we're running more on a TTY that we don't have filesystem access to,
we can't rely on open(ttyname(STDOUT_FILENO)). Since all the stdio fd's
are opened read/write anyway, we can just read from stdout, even if it
feels a bit weird. :^)
It doesn't look healthy to create raw references into an array before
a temporary unlock. In fact, that temporary unlock looks generally
unhealthy, but it's a different problem.
Calling shutdown prevents further reads and/or writes on a socket.
We should do a few more things based on the type of socket, but this
initial implementation just puts the basic mechanism in place.
Work towards #428.
The idea behind WeakPtr<NetworkAdapter> was to support hot-pluggable
network adapters, but on closer thought, that's super impractical so
let's not go down that road.
If there's not enough space in the output buffer for the whole sockaddr
we now simply truncate the address instead of returning EINVAL.
This patch also makes getpeername() actually return the peer address
rather than the local address.. :^)
This patch introduces the GUI::SyntaxHighlighter class, which can be
attached to a GUI::TextEditor to provide syntax highlighting.
The C++ syntax highlighting from HackStudio becomes a new class called
GUI::CppSyntaxHighlighter. This will make it possible to get C++ syntax
highlighting in any app that uses a GUI::TextEditor. :^)
Sidenote: It does feel a bit weird having a C++ lexer in a GUI toolkit
library, and we'll probably end up moving this out to a separate place
as this functionality grows larger.
SystemServer will now track the number of restart attempts and the
run time of a service, and will also pay attention to its exit code.
If a service exits unsuccessfully and too quickly (in less than a
second), SystemServer will only attempt to restart it twice.
This means that if WindowServer crashes on startup, we will now see
just a few copies of the crash instead of the quickly scrolling log
flashing with colors :^)
Some apps (looking at you, VisualBuilder) don't specify an icon
in their .af file, so WindowServer was trying to open an empty path.
That made it print a perror message to the log each time. Let's not
do that ^)
This is not a bug currently, since the first column immediately starts
playing at startup and leaves no time for the user to put notes in it.
However, this is needed for exporting.
The piano roll data definitely belongs in AudioEngine along with the
note and time data. Now RollWidget only has GUI information, much like
the other widgets.
Note that this commit exacerbates issue #1158 which is caused by
RollWidget::paint_event().