]> git.ozlabs.org Git - petitboot/commit
discover: Don't free clients on write failure
authorJeremy Kerr <jk@ozlabs.org>
Tue, 15 Oct 2013 02:25:23 +0000 (10:25 +0800)
committerJeremy Kerr <jk@ozlabs.org>
Tue, 15 Oct 2013 03:19:55 +0000 (11:19 +0800)
commiteb2e788746da67787e1a43d7fccfa11ca26efae5
treea513b77dbea1c02c34e928eec9837b334e57bd61
parent2312c424d516862877c45a9566816acfe2da0f06
discover: Don't free clients on write failure

Currently, if we see an error when writing to a client, we free the
client immediately. This means that any pending reads will be discarded.
Additionally, if a client disconnects before we have finished the writes in
discover_server_process_connection, we won't register the waiter to read
from the socket.

Instead of freeing the client on write failure, this change sets a flag
(se we don't continue to write), and we rely on the read EOF to free the
client. This means we don't drop incoming messages.

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
discover/discover-server.c