drop dead code from got_privsep_send_obj_req()
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
diff --git a/lib/got_lib_privsep.h b/lib/got_lib_privsep.h
index dc25646..265fdf3 100644
--- a/lib/got_lib_privsep.h
+++ b/lib/got_lib_privsep.h
@@ -217,8 +217,7 @@ const struct got_error *got_privsep_send_stop(int);
const struct got_error *got_privsep_recv_imsg(struct imsg *, struct imsgbuf *,
size_t);
void got_privsep_send_error(struct imsgbuf *, const struct got_error *);
-const struct got_error *got_privsep_send_obj_req(struct imsgbuf *, int,
- struct got_object *);
+const struct got_error *got_privsep_send_obj_req(struct imsgbuf *, int);
const struct got_error *got_privsep_send_commit_req(struct imsgbuf *, int,
struct got_object_id *, int);
const struct got_error *got_privsep_send_tree_req(struct imsgbuf *, int,
diff --git a/lib/object.c b/lib/object.c
index 9ce82be..d504c3c 100644
--- a/lib/object.c
+++ b/lib/object.c
@@ -345,7 +345,7 @@ request_object(struct got_object **obj, struct got_repository *repo, int fd)
ibuf = repo->privsep_children[GOT_REPO_PRIVSEP_CHILD_OBJECT].ibuf;
- err = got_privsep_send_obj_req(ibuf, fd, NULL);
+ err = got_privsep_send_obj_req(ibuf, fd);
if (err)
return err;
diff --git a/lib/privsep.c b/lib/privsep.c
index 0ae91bf..8d41f1b 100644
--- a/lib/privsep.c
+++ b/lib/privsep.c
@@ -221,45 +221,10 @@ got_privsep_send_stop(int fd)
}
const struct got_error *
-got_privsep_send_obj_req(struct imsgbuf *ibuf, int fd, struct got_object *obj)
+got_privsep_send_obj_req(struct imsgbuf *ibuf, int fd)
{
- struct got_imsg_object iobj, *iobjp = NULL;
- size_t iobj_size = 0;
- int imsg_code = GOT_IMSG_OBJECT_REQUEST;
-
- if (obj) {
- switch (obj->type) {
- case GOT_OBJ_TYPE_TREE:
- imsg_code = GOT_IMSG_TREE_REQUEST;
- break;
- case GOT_OBJ_TYPE_COMMIT:
- abort(); /* should not get here */
- break;
- case GOT_OBJ_TYPE_BLOB:
- imsg_code = GOT_IMSG_BLOB_REQUEST;
- break;
- case GOT_OBJ_TYPE_TAG:
- imsg_code = GOT_IMSG_TAG_REQUEST;
- break;
- default:
- return got_error(GOT_ERR_OBJ_TYPE);
- }
-
- memcpy(iobj.id, obj->id.sha1, sizeof(iobj.id));
- iobj.type = obj->type;
- iobj.flags = obj->flags;
- iobj.hdrlen = obj->hdrlen;
- iobj.size = obj->size;
- if (iobj.flags & GOT_OBJ_FLAG_PACKED) {
- iobj.pack_offset = obj->pack_offset;
- iobj.pack_idx = obj->pack_idx;
- }
-
- iobjp = &iobj;
- iobj_size = sizeof(iobj);
- }
-
- if (imsg_compose(ibuf, imsg_code, 0, 0, fd, iobjp, iobj_size) == -1)
+ if (imsg_compose(ibuf, GOT_IMSG_OBJECT_REQUEST, 0, 0, fd, NULL, 0)
+ == -1)
return got_error_from_errno();
return flush_imsg(ibuf);