imap-send: drop unused fields from imap_cmd_cb
The imap_cmd_cb struct has several fields which are totally unused. Presumably they did useful things in the upstream isync code from which this is derived, but they don't in our more limited program. This is particularly confusing for the "done" callback, which (as of the previous patch) no longer matches the signature of the adjacent "cont" callback. Since we're unlikely to share code with isync going forward, we should feel free to simplify the code here. Note that "done" is examined but never set, so we can also drop a little bit of code outside of the struct definition. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Jeff King committed
Jul 3, 2023 at 02:34 UTC
d378637d2fe9eed3bd3bd0858e6cc79a8f23510a
1 file changed
-4
imap-send.c
-4
@@ -138,11 +138,9 @@ struct imap_store {
138
139
struct imap_cmd_cb {
140
int (*cont)(struct imap_store *ctx, const char *prompt);
141
- void (*done)(struct imap_store *ctx, struct imap_cmd *cmd, int response);
141
void *ctx;
142
char *data;
143
int dlen;
145
- int uid;
144
};
145
146
struct imap_cmd {
@@ -828,8 +826,6 @@ static int get_cmd_result(struct imap_store *ctx, struct imap_cmd *tcmd)
826
}
827
if ((resp2 = parse_response_code(ctx, &cmdp->cb, cmd)) > resp)
828
resp = resp2;
831
- if (cmdp->cb.done)
832
- cmdp->cb.done(ctx, cmdp, resp);
829
free(cmdp->cb.data);
830
free(cmdp->cmd);
831
free(cmdp);