commit ea7396b906790eb988c713e93d2444993fd370e8 from: Stefan Sperling date: Wed Mar 18 16:11:32 2020 UTC rename imsg FETCH_PROGRESS to FETCH_REF commit - 9fa5181270fbedcfc50c8aaaac50a4aec0fd1dbd commit + ea7396b906790eb988c713e93d2444993fd370e8 blob - 9b2faf40409610d2dc3c08c75caabcf5b9d0f60b blob + 5b5d6f6c9f80056a8ccc1e8fdc9b798eff0f2dc8 --- lib/got_lib_privsep.h +++ lib/got_lib_privsep.h @@ -111,7 +111,7 @@ enum got_imsg_type { /* Messages related to networking. */ GOT_IMSG_FETCH_REQUEST, GOT_IMSG_FETCH_SYMREFS, - GOT_IMSG_FETCH_PROGRESS, + GOT_IMSG_FETCH_REF, GOT_IMSG_FETCH_SERVER_PROGRESS, GOT_IMSG_FETCH_DONE, GOT_IMSG_IDXPACK_REQUEST, @@ -262,8 +262,8 @@ struct got_imsg_fetch_symrefs { /* Followed by nsymrefs times of got_imsg_fetch_symref data. */ } __attribute__((__packed__)); -/* Structure for GOT_IMSG_FETCH_PROGRESS data. */ -struct got_imsg_fetch_progress { +/* Structure for GOT_IMSG_FETCH_REF data. */ +struct got_imsg_fetch_ref { /* Describes a reference which will be fetched. */ uint8_t refid[SHA1_DIGEST_LENGTH]; /* Followed by reference name in remaining data of imsg buffer. */ @@ -355,7 +355,7 @@ const struct got_error *got_privsep_send_fetch_req(str struct got_pathlist_head *); const struct got_error *got_privsep_send_fetch_symrefs(struct imsgbuf *, struct got_pathlist_head *); -const struct got_error *got_privsep_send_fetch_progress(struct imsgbuf *, +const struct got_error *got_privsep_send_fetch_ref(struct imsgbuf *, struct got_object_id *, const char *); const struct got_error *got_privsep_send_fetch_server_progress(struct imsgbuf *, const char *, size_t); blob - bbd1527cce0abf93067edaea6b101c04a7c0e8d8 blob + 6aabc63d20518ccca1b4c176ee56c4af7e7f9adc --- lib/privsep.c +++ lib/privsep.c @@ -537,29 +537,29 @@ got_privsep_send_fetch_symrefs(struct imsgbuf *ibuf, } const struct got_error * -got_privsep_send_fetch_progress(struct imsgbuf *ibuf, +got_privsep_send_fetch_ref(struct imsgbuf *ibuf, struct got_object_id *refid, const char *refname) { const struct got_error *err = NULL; struct ibuf *wbuf; size_t len, reflen = strlen(refname); - len = sizeof(struct got_imsg_fetch_progress) + reflen; + len = sizeof(struct got_imsg_fetch_ref) + reflen; if (len >= MAX_IMSGSIZE - IMSG_HEADER_SIZE) return got_error(GOT_ERR_NO_SPACE); - wbuf = imsg_create(ibuf, GOT_IMSG_FETCH_PROGRESS, 0, 0, len); + wbuf = imsg_create(ibuf, GOT_IMSG_FETCH_REF, 0, 0, len); if (wbuf == NULL) - return got_error_from_errno("imsg_create FETCH_PROGRESS"); - - /* Keep in sync with struct got_imsg_fetch_progress definition! */ + return got_error_from_errno("imsg_create FETCH_REF"); + + /* Keep in sync with struct got_imsg_fetch_ref definition! */ if (imsg_add(wbuf, refid->sha1, SHA1_DIGEST_LENGTH) == -1) { - err = got_error_from_errno("imsg_add FETCH_PROGRESS"); + err = got_error_from_errno("imsg_add FETCH_REF"); ibuf_free(wbuf); return err; } if (imsg_add(wbuf, refname, reflen) == -1) { - err = got_error_from_errno("imsg_add FETCH_PROGRESS"); + err = got_error_from_errno("imsg_add FETCH_REF"); ibuf_free(wbuf); return err; } @@ -682,7 +682,7 @@ got_privsep_recv_fetch_progress(int *done, struct got_ } } break; - case GOT_IMSG_FETCH_PROGRESS: + case GOT_IMSG_FETCH_REF: if (datalen <= SHA1_DIGEST_LENGTH) { err = got_error(GOT_ERR_PRIVSEP_MSG); break; blob - 40fbe8e20ba6e580c268f219a7ccf362d9e6242b blob + e2d60c1f1a1133e774780389a8ae5acc9ee95b42 --- libexec/got-fetch-pack/got-fetch-pack.c +++ libexec/got-fetch-pack/got-fetch-pack.c @@ -584,7 +584,7 @@ fetch_pack(int fd, int packfd, struct got_object_id *p if (err) goto done; - err = got_privsep_send_fetch_progress(ibuf, &want[nref], + err = got_privsep_send_fetch_ref(ibuf, &want[nref], refname); if (err) goto done;