GOT_IMSG_ACK isn't needed; just fill the pipe, reading responses will block
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98
diff --git a/lib/fetch.c b/lib/fetch.c
index d1b0036..0a308b0 100644
--- a/lib/fetch.c
+++ b/lib/fetch.c
@@ -314,9 +314,6 @@ got_clone(char *uri, char *branch_filter, char *dirname)
err = got_privsep_send_fetch_req(&ibuf, fetchfd);
if (err != NULL)
return err;
- err = got_privsep_wait_ack(&ibuf);
- if (err != NULL)
- return err;
err = got_privsep_send_tmpfd(&ibuf, npackfd);
if (err != NULL)
return err;
@@ -343,9 +340,6 @@ got_clone(char *uri, char *branch_filter, char *dirname)
err = got_privsep_send_index_pack_req(&ibuf, npackfd, packhash);
if (err != NULL)
return err;
- err = got_privsep_wait_ack(&ibuf);
- if (err != NULL)
- return err;
err = got_privsep_send_tmpfd(&ibuf, nidxfd);
if (err != NULL)
return err;
diff --git a/lib/got_lib_privsep.h b/lib/got_lib_privsep.h
index 0c4a043..12c2aa8 100644
--- a/lib/got_lib_privsep.h
+++ b/lib/got_lib_privsep.h
@@ -85,9 +85,6 @@ enum got_imsg_type {
/* Stop the child process. */
GOT_IMSG_STOP,
- /* We got a message as part of a sequence */
- GOT_IMSG_ACK,
-
/*
* Messages concerned with read access to objects in a repository.
* Object and pack files are opened by the main process, where
diff --git a/lib/privsep.c b/lib/privsep.c
index b5ea8d2..90f056a 100644
--- a/lib/privsep.c
+++ b/lib/privsep.c
@@ -231,31 +231,6 @@ got_privsep_send_stop(int fd)
}
const struct got_error *
-got_privsep_send_ack(struct imsgbuf *ibuf)
-{
- if (imsg_compose(ibuf, GOT_IMSG_ACK, 0, 0, -1, NULL, 0) == -1)
- return got_error_from_errno("imsg_compose ACK");
- return flush_imsg(ibuf);
-}
-
-const struct got_error *
-got_privsep_wait_ack(struct imsgbuf *ibuf)
-{
- const struct got_error *err = NULL;
- struct imsg imsg;
-
- err = got_privsep_recv_imsg(&imsg, ibuf, 0);
- if (err)
- return err;
- if (imsg.hdr.type == GOT_IMSG_ACK && imsg.hdr.len - IMSG_HEADER_SIZE == 0)
- return NULL;
- else
- return got_error(GOT_ERR_PRIVSEP_MSG);
- imsg_free(&imsg);
-}
-
-
-const struct got_error *
got_privsep_send_obj_req(struct imsgbuf *ibuf, int fd)
{
if (imsg_compose(ibuf, GOT_IMSG_OBJECT_REQUEST, 0, 0, fd, NULL, 0)
diff --git a/libexec/got-fetch-pack/got-fetch-pack.c b/libexec/got-fetch-pack/got-fetch-pack.c
index 8d96080..f47aa8e 100644
--- a/libexec/got-fetch-pack/got-fetch-pack.c
+++ b/libexec/got-fetch-pack/got-fetch-pack.c
@@ -429,7 +429,6 @@ main(int argc, char **argv)
goto done;
}
fetchfd = imsg.fd;
- got_privsep_send_ack(&ibuf);
if((err = got_privsep_recv_imsg(&imsg, &ibuf, 0)) != 0) {
if (err->code == GOT_ERR_PRIVSEP_PIPE)
diff --git a/libexec/got-index-pack/got-index-pack.c b/libexec/got-index-pack/got-index-pack.c
index c000f2c..cd6e4f4 100644
--- a/libexec/got-index-pack/got-index-pack.c
+++ b/libexec/got-index-pack/got-index-pack.c
@@ -1236,7 +1236,6 @@ main(int argc, char **argv)
}
packfd = imsg.fd;
memcpy(packhash.sha1, imsg.data, SHA1_DIGEST_LENGTH);
- got_privsep_send_ack(&ibuf);
if((err = got_privsep_recv_imsg(&imsg, &ibuf, 0)) != 0) {
if (err->code == GOT_ERR_PRIVSEP_PIPE)