qemu-e2k/nbd
Eric Blake ef2e35fcc8 nbd/client: Drop pointless buf variable
There's no need to read into a temporary buffer (oversized
since commit 7d3123e1) followed by a byteswap into a uint64_t
to check for a magic number via memcmp(), when the code
immediately below demonstrates reading into the uint64_t then
byteswapping in place and checking for a magic number via
integer math.  What's more, having a different error message
when the server's first reply byte is 0 is unusual - it's no
different from any other wrong magic number, and we already
detected short reads. That whole strlen() issue has been
present and useless since commit 1d45f8b5 in 2010; perhaps it
was leftover debugging (since the correct magic number happens
to be ASCII)?  Make the error messages more consistent and
detailed while touching things.

Signed-off-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Richard W.M. Jones <rjones@redhat.com>
Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Message-Id: <20181215135324.152629-9-eblake@redhat.com>
2019-01-05 07:53:22 -06:00
..
client.c nbd/client: Drop pointless buf variable 2019-01-05 07:53:22 -06:00
common.c
Makefile.objs
nbd-internal.h nbd/client: Drop pointless buf variable 2019-01-05 07:53:22 -06:00
server.c nbd/server: Advertise all contexts in response to bare LIST 2018-11-30 13:55:18 -06:00
trace-events nbd/client: Trace all server option error messages 2019-01-04 17:34:58 -06:00