commit 48f392b24cd93cef9f59e3365da6e437c46f063e from: Stefan Sperling date: Mon Apr 02 13:17:49 2018 UTC define imsg for loose blobs and trees; allow inline delta stream commit - f717154221cea829e8a246839a38c5c1b983711a commit + 48f392b24cd93cef9f59e3365da6e437c46f063e blob - 3ce39ee952c20c53b582e0d4fc08252fcf667c81 blob + 061e48dc0890aee15864b7360bdd36e1a3024ee8 --- lib/got_lib_privsep.h +++ lib/got_lib_privsep.h @@ -49,12 +49,15 @@ enum got_imsg_type { GOT_IMSG_LOOSE_OBJECT_HEADER_REQUEST, GOT_IMSG_LOOSE_OBJECT_HEADER_REPLY, GOT_IMSG_LOOSE_BLOB_OBJECT_REQUEST, + GOT_IMSG_LOOSE_BLOB_OBJECT_REQUEST_OUTPUT, GOT_IMSG_LOOSE_BLOB_OBJECT_REPLY, GOT_IMSG_LOOSE_TREE_OBJECT_REQUEST, GOT_IMSG_LOOSE_TREE_OBJECT_REPLY, + GOT_IMSG_TREE_ENTRY, GOT_IMSG_LOOSE_COMMIT_OBJECT_REQUEST, GOT_IMSG_LOOSE_COMMIT_OBJECT_REPLY, GOT_IMSG_PACKED_BLOB_OBJECT_REQUEST, + GOT_IMSG_PACKED_BLOB_OBJECT_REQUEST_OUTPUT, GOT_IMSG_PACKED_BLOB_OBJECT_REPLY, GOT_IMSG_PACKED_TREE_OBJECT_REQUEST, GOT_IMSG_PACKED_TREE_OBJECT_REPLY, @@ -78,8 +81,10 @@ struct got_imsg_delta { size_t delta_len; /* - * Followed by DELTA_STREAM messages until delta_len bytes - * of delta stream data have been transmitted. + * Followed by delta stream in remaining bytes of imsg buffer. + * If delta_len exceeds imsg buffer length, followed by one or + * more DELTA_STREAM messages until delta_len bytes of delta + * stream have been transmitted. */ }; @@ -87,7 +92,7 @@ struct got_imsg_delta { struct got_imsg_delta_stream { /* * Empty since the following is implied: - * Read delta stream data from imsg buffer. + * Read additional delta stream data from imsg buffer. */ }; @@ -116,4 +121,44 @@ struct got_imsg_loose_object_header_reply { struct got_imsg_object iobj; }; +/* Structure for GOT_IMSG_LOOSE_BLOB_OBJECT_REQUEST data. */ +struct got_imsg_loose_blob_object_request { + struct got_imsg_object iobj; + + /* + * The following is implied: If imsg fd == -1 then read raw + * blob data from imsg buffer, else read from fd. + */ +}; + +/* Structure for GOT_IMSG_LOOSE_BLOB_OBJECT_REQUEST_OUTPUT data. */ +struct got_imsg_loose_blob_object_request_output { + /* + * Empty since the following is implied: If imsg fd == -1 then + * respond with blob data in imsg buffer, else write to fd. + */ +}; + +/* Structure for GOT_IMSG_LOOSE_TREE_OBJECT_REQUEST data. */ +struct got_imsg_loose_tree_object_request { + struct got_imsg_object iobj; + + /* + * The following is implied: If imsg fd == -1 then read raw tree + * data from imsg buffer, else read from fd. + */ +}; + +/* Structure for GOT_IMSG_TREE_ENTRY. */ +struct got_imsg_tree_entry { + struct got_object_id id; + mode_t mode; + /* Followed by entry's name in remaining data of imsg buffer. */ +}; + +/* Structure for transmitting struct got_tree_object data in an imsg. */ +struct got_imsg_tree_object { + int nentries; /* This many TREE_ENTRY messages follow. */ +}; + /* TODO: Implement the above, and then add more message data types here. */