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:
Mikolaj Golub 2011-04-17 16:18:45 +00:00
parent 0105c5eb47
commit 64acad05cd
3 changed files with 1 additions and 21 deletions

View File

@ -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);

View File

@ -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);
}

View File

@ -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);