Remove hast_proto_recv(). It was used only in one place, where
hast_proto_recv_hdr() may be used. This also fixes the issue (introduced by r220523) with hastctl, which crashed on assert in hast_proto_recv_data(). Suggested and approved by: pjd (mentor)
This commit is contained in:
parent
1584693544
commit
4ef25c883e
@ -491,7 +491,7 @@ main(int argc, char *argv[])
|
||||
}
|
||||
nv_free(nv);
|
||||
/* ...and receive reply. */
|
||||
if (hast_proto_recv(NULL, controlconn, &nv, NULL, 0) < 0) {
|
||||
if (hast_proto_recv_hdr(controlconn, &nv) < 0) {
|
||||
pjdlog_exit(EX_UNAVAILABLE,
|
||||
"cannot receive reply from hastd via %s",
|
||||
cfg->hc_controladdr);
|
||||
|
@ -219,21 +219,3 @@ hast_proto_recv_data(const struct hast_resource *res, struct proto_conn *conn,
|
||||
free(dptr);
|
||||
return (ret);
|
||||
}
|
||||
|
||||
int
|
||||
hast_proto_recv(const struct hast_resource *res, struct proto_conn *conn,
|
||||
struct nv **nvp, void *data, size_t size)
|
||||
{
|
||||
struct nv *nv;
|
||||
int ret;
|
||||
|
||||
ret = hast_proto_recv_hdr(conn, &nv);
|
||||
if (ret < 0)
|
||||
return (ret);
|
||||
ret = hast_proto_recv_data(res, conn, nv, data, size);
|
||||
if (ret < 0)
|
||||
nv_free(nv);
|
||||
else
|
||||
*nvp = nv;
|
||||
return (ret);
|
||||
}
|
||||
|
@ -39,8 +39,6 @@
|
||||
|
||||
int hast_proto_send(const struct hast_resource *res, struct proto_conn *conn,
|
||||
struct nv *nv, const void *data, size_t size);
|
||||
int hast_proto_recv(const struct hast_resource *res, struct proto_conn *conn,
|
||||
struct nv **nvp, void *data, size_t size);
|
||||
int hast_proto_recv_hdr(const struct proto_conn *conn, struct nv **nvp);
|
||||
int hast_proto_recv_data(const struct hast_resource *res,
|
||||
struct proto_conn *conn, struct nv *nv, void *data, size_t size);
|
||||
|
Loading…
Reference in New Issue
Block a user