mirror of
https://github.com/linuxkit/linuxkit.git
synced 2025-07-23 19:05:37 +00:00
transfused: use read_exactly in subproto reading
Signed-off-by: David Sheets <dsheets@docker.com>
This commit is contained in:
parent
ac7316427c
commit
9d5309953f
@ -1085,7 +1085,6 @@ void parse_parameters(int argc, char *argv[], parameters *params)
|
||||
|
||||
void serve(parameters *params)
|
||||
{
|
||||
ssize_t read_count;
|
||||
char subproto_selector;
|
||||
pthread_t child;
|
||||
connection_t *conn;
|
||||
@ -1109,10 +1108,7 @@ void serve(parameters *params)
|
||||
if (conn->sock < 0)
|
||||
die(1, params, "accept", "");
|
||||
|
||||
/* TODO: check for socket read conditions e.g.EAGAIN */
|
||||
read_count = read(conn->sock, &subproto_selector, 1);
|
||||
if (read_count <= 0)
|
||||
die(1, params, "read subprotocol selector", "");
|
||||
read_exactly("subproto", conn->sock, &subproto_selector, 1);
|
||||
|
||||
switch (subproto_selector) {
|
||||
case 'm':
|
||||
|
Loading…
Reference in New Issue
Block a user