In hast_proto_recv() remove unnecessary check. The size is checked
later in hast_proto_recv_data(). Approved by: pjd (mentor) MFC after: 1 week
This commit is contained in:
parent
1d521b1cbd
commit
a827fe1fdf
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=220523
@ -225,17 +225,12 @@ hast_proto_recv(const struct hast_resource *res, struct proto_conn *conn,
|
|||||||
struct nv **nvp, void *data, size_t size)
|
struct nv **nvp, void *data, size_t size)
|
||||||
{
|
{
|
||||||
struct nv *nv;
|
struct nv *nv;
|
||||||
size_t dsize;
|
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
ret = hast_proto_recv_hdr(conn, &nv);
|
ret = hast_proto_recv_hdr(conn, &nv);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
return (ret);
|
return (ret);
|
||||||
dsize = nv_get_uint32(nv, "size");
|
ret = hast_proto_recv_data(res, conn, nv, data, size);
|
||||||
if (dsize == 0)
|
|
||||||
(void)nv_set_error(nv, 0);
|
|
||||||
else
|
|
||||||
ret = hast_proto_recv_data(res, conn, nv, data, size);
|
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
nv_free(nv);
|
nv_free(nv);
|
||||||
else
|
else
|
||||||
|
Loading…
Reference in New Issue
Block a user