]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-dict: Further remove APPEND
authorAki Tuomi <aki.tuomi@dovecot.fi>
Mon, 25 Apr 2016 08:37:05 +0000 (11:37 +0300)
committerGitLab <gitlab@git.dovecot.net>
Fri, 29 Apr 2016 19:27:34 +0000 (22:27 +0300)
src/lib-dict-extra/dict-fs.c
src/lib-dict/dict-client.h
src/lib-dict/dict-file.c
src/lib-dict/dict-memcached-ascii.c
src/lib-dict/dict-transaction-memory.c
src/lib-dict/dict-transaction-memory.h

index 93d34d0f3d8410c38d475f0aa374d8daaa7e2b58..7a524ce7c85cf17d2cca236109fc36217dc7f0ee 100644 (file)
@@ -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();
                }
index 80dab182ccb38243575d6538bb39b4a26cc8e4bc..bb7f1195bc02adfd45463edac38d5254e30edbd2 100644 (file)
@@ -24,7 +24,6 @@ enum dict_protocol_cmd {
 
        DICT_PROTOCOL_CMD_SET = 'S', /* <id> <key> <value> */
        DICT_PROTOCOL_CMD_UNSET = 'U', /* <id> <key> */
-       DICT_PROTOCOL_CMD_APPEND = 'P', /* <id> <key> <value> */
        DICT_PROTOCOL_CMD_ATOMIC_INC = 'A' /* <id> <key> <diff> */
 };
 
index 01ee71e9525c95528204fde569c4fdbaf994ffa5..10dd409c959a41dec6a1c8a060cc78560303a69d 100644 (file)
@@ -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);
index 3fbfb61b92404d5c6771c0001922c0c47120f2fb..dfa5341e510f7d1c89aa48b1f8e39ffb31d60f76 100644 (file)
@@ -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) {
index 614c18edaff1e177f39a0103a7699db78d374bb6..d9c8744b83aa1a25aab2e510fbf2f04e22fd718f 100644 (file)
@@ -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)
 {
index c07cc7660267f00b6267ff0126ba2d672f5118f8..2164c1e30381a765a84166ae09eb76b45d1db442 100644 (file)
@@ -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);