commit aea5f015fdc344c7da6ba4b979b37afe0cac8004 from: Stefan Sperling date: Mon Dec 24 13:29:50 2018 UTC drop dead code from got_privsep_send_obj_req() commit - 9f2369b01b5aa26b593dd3be183134e1755ad7e4 commit + aea5f015fdc344c7da6ba4b979b37afe0cac8004 blob - dc25646a1852be26f74f2c2fc27edc56e9c5dc0a blob + 265fdf3b2b2444e83f6f86acd875fa01bb1da614 --- lib/got_lib_privsep.h +++ 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, blob - 9ce82be00fc59470b90b2ee9cb29a23b9c840c7f blob + d504c3cf373260971af39d4b5d4a4b4dbbc12f27 --- lib/object.c +++ lib/object.c @@ -345,7 +345,7 @@ request_object(struct got_object **obj, struct got_rep 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; blob - 0ae91bf1e8abddd5bbc2ed48b4324d3e02b023f3 blob + 8d41f1bf27cef89b36cf5213639d66593d68519e --- lib/privsep.c +++ 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);