From: Aki Tuomi Date: Mon, 25 Apr 2016 08:37:05 +0000 (+0300) Subject: lib-dict: Further remove APPEND X-Git-Tag: 2.3.0.rc1~3886 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=3fd02e831c32598deda589ae536fdaa4022d9750;p=thirdparty%2Fdovecot%2Fcore.git lib-dict: Further remove APPEND --- diff --git a/src/lib-dict-extra/dict-fs.c b/src/lib-dict-extra/dict-fs.c index 93d34d0f3d..7a524ce7c8 100644 --- a/src/lib-dict-extra/dict-fs.c +++ b/src/lib-dict-extra/dict-fs.c @@ -237,7 +237,6 @@ static int fs_dict_write_changes(struct dict_transaction_memory_context *ctx) } fs_file_deinit(&file); break; - case DICT_CHANGE_TYPE_APPEND: case DICT_CHANGE_TYPE_INC: i_unreached(); } diff --git a/src/lib-dict/dict-client.h b/src/lib-dict/dict-client.h index 80dab182cc..bb7f1195bc 100644 --- a/src/lib-dict/dict-client.h +++ b/src/lib-dict/dict-client.h @@ -24,7 +24,6 @@ enum dict_protocol_cmd { DICT_PROTOCOL_CMD_SET = 'S', /* */ DICT_PROTOCOL_CMD_UNSET = 'U', /* */ - DICT_PROTOCOL_CMD_APPEND = 'P', /* */ DICT_PROTOCOL_CMD_ATOMIC_INC = 'A' /* */ }; diff --git a/src/lib-dict/dict-file.c b/src/lib-dict/dict-file.c index 01ee71e952..10dd409c95 100644 --- a/src/lib-dict/dict-file.c +++ b/src/lib-dict/dict-file.c @@ -353,18 +353,6 @@ static void file_dict_apply_changes(struct dict_transaction_memory_context *ctx, } hash_table_update(dict->hash, key, value); break; - case DICT_CHANGE_TYPE_APPEND: - if (key == NULL) - key = p_strdup(dict->hash_pool, change->key); - if (old_value == NULL) { - value = p_strdup(dict->hash_pool, - change->value.str); - } else { - value = p_strconcat(dict->hash_pool, old_value, - change->value.str, NULL); - } - hash_table_update(dict->hash, key, value); - break; case DICT_CHANGE_TYPE_UNSET: if (old_value != NULL) hash_table_remove(dict->hash, key); diff --git a/src/lib-dict/dict-memcached-ascii.c b/src/lib-dict/dict-memcached-ascii.c index 3fbfb61b92..dfa5341e51 100644 --- a/src/lib-dict/dict-memcached-ascii.c +++ b/src/lib-dict/dict-memcached-ascii.c @@ -16,7 +16,7 @@ enum memcached_ascii_input_state { /* GET: expecting VALUE or END */ MEMCACHED_INPUT_STATE_GET, - /* SET/(APPEND+ADD): expecting STORED / NOT_STORED */ + /* SET: expecting STORED / NOT_STORED */ MEMCACHED_INPUT_STATE_STORED, /* DELETE: expecting DELETED */ MEMCACHED_INPUT_STATE_DELETED, @@ -554,16 +554,6 @@ memcached_send_change(struct dict_memcached_ascii_commit_ctx *ctx, state = MEMCACHED_INPUT_STATE_DELETED; str_printfa(ctx->str, "delete %s\r\n", key); break; - case DICT_CHANGE_TYPE_APPEND: - state = MEMCACHED_INPUT_STATE_STORED; - str_printfa(ctx->str, "append %s 0 0 %"PRIuSIZE_T"\r\n%s\r\n", - key, strlen(change->value.str), change->value.str); - array_append(&ctx->dict->input_states, &state, 1); - /* we'd preferably want an append that always works, but - this kludge works for that too.. */ - str_printfa(ctx->str, "add %s 0 0 %"PRIuSIZE_T"\r\n%s\r\n", - key, strlen(change->value.str), change->value.str); - break; case DICT_CHANGE_TYPE_INC: state = MEMCACHED_INPUT_STATE_INCRDECR; if (change->value.diff > 0) { diff --git a/src/lib-dict/dict-transaction-memory.c b/src/lib-dict/dict-transaction-memory.c index 614c18edaf..d9c8744b83 100644 --- a/src/lib-dict/dict-transaction-memory.c +++ b/src/lib-dict/dict-transaction-memory.c @@ -45,19 +45,6 @@ void dict_transaction_memory_unset(struct dict_transaction_context *_ctx, change->key = p_strdup(ctx->pool, key); } -void dict_transaction_memory_append(struct dict_transaction_context *_ctx, - const char *key, const char *value) -{ - struct dict_transaction_memory_context *ctx = - (struct dict_transaction_memory_context *)_ctx; - struct dict_transaction_memory_change *change; - - change = array_append_space(&ctx->changes); - change->type = DICT_CHANGE_TYPE_APPEND; - change->key = p_strdup(ctx->pool, key); - change->value.str = p_strdup(ctx->pool, value); -} - void dict_transaction_memory_atomic_inc(struct dict_transaction_context *_ctx, const char *key, long long diff) { diff --git a/src/lib-dict/dict-transaction-memory.h b/src/lib-dict/dict-transaction-memory.h index c07cc76602..2164c1e303 100644 --- a/src/lib-dict/dict-transaction-memory.h +++ b/src/lib-dict/dict-transaction-memory.h @@ -6,7 +6,6 @@ enum dict_change_type { DICT_CHANGE_TYPE_SET, DICT_CHANGE_TYPE_UNSET, - DICT_CHANGE_TYPE_APPEND, DICT_CHANGE_TYPE_INC }; @@ -33,8 +32,6 @@ void dict_transaction_memory_set(struct dict_transaction_context *ctx, const char *key, const char *value); void dict_transaction_memory_unset(struct dict_transaction_context *ctx, const char *key); -void dict_transaction_memory_append(struct dict_transaction_context *_ctx, - const char *key, const char *value); void dict_transaction_memory_atomic_inc(struct dict_transaction_context *ctx, const char *key, long long diff);