Mercurial > dovecot > original-hg > dovecot-1.2
diff src/imap/imap-fetch.c @ 3141:61abed5f7864 HEAD
Moved command-specific variables from struct client to struct
client_command_context and changed code to use it.
author | Timo Sirainen <tss@iki.fi> |
---|---|
date | Sat, 05 Feb 2005 20:07:26 +0200 |
parents | 38fa28004689 |
children | 13dbff915a1a |
line wrap: on
line diff
--- a/src/imap/imap-fetch.c Sat Feb 05 20:05:24 2005 +0200 +++ b/src/imap/imap-fetch.c Sat Feb 05 20:07:26 2005 +0200 @@ -67,7 +67,7 @@ sizeof(struct imap_fetch_handler), imap_fetch_handler_bsearch); if (handler == NULL) { - client_send_command_error(ctx->client, + client_send_command_error(ctx->cmd, t_strconcat("Unknown command ", name, NULL)); return FALSE; } @@ -75,8 +75,9 @@ return handler->init(ctx, name, args); } -struct imap_fetch_context *imap_fetch_init(struct client *client) +struct imap_fetch_context *imap_fetch_init(struct client_command_context *cmd) { + struct client *client = cmd->client; struct imap_fetch_context *ctx; if (fetch_handlers == NULL) { @@ -85,13 +86,14 @@ sizeof(default_handlers[0])); } - ctx = p_new(client->cmd_pool, struct imap_fetch_context, 1); + ctx = p_new(cmd->pool, struct imap_fetch_context, 1); ctx->client = client; + ctx->cmd = cmd; ctx->box = client->mailbox; ctx->cur_str = str_new(default_pool, 8192); - ctx->all_headers_buf = buffer_create_dynamic(client->cmd_pool, 128); - ctx->handlers = buffer_create_dynamic(client->cmd_pool, 128); + ctx->all_headers_buf = buffer_create_dynamic(cmd->pool, 128); + ctx->handlers = buffer_create_dynamic(cmd->pool, 128); ctx->line_finished = TRUE; return ctx; }