diff options
author | Christian Grothoff <christian@grothoff.org> | 2013-10-02 11:40:00 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2013-10-02 11:40:00 +0000 |
commit | 88652b999ab006d0e863234395415edcbcddfbfe (patch) | |
tree | d470e8786ab77715f19056e3a109962c556890ab /src | |
parent | 9200ed3857ac29d11d4947c5eb231e9e3ee5ecfc (diff) | |
download | gnunet-88652b999ab006d0e863234395415edcbcddfbfe.tar.gz gnunet-88652b999ab006d0e863234395415edcbcddfbfe.zip |
-delete does not work in the strong sense due to caching of the encrypted blocks, adjusting tests to reflect this
Diffstat (limited to 'src')
-rw-r--r-- | src/namestore/gnunet-service-namestore.c | 7 | ||||
-rw-r--r-- | src/namestore/plugin_namestore_sqlite.c | 5 | ||||
-rw-r--r-- | src/namestore/test_namestore_api_remove.c | 21 | ||||
-rwxr-xr-x | src/namestore/test_namestore_delete.sh | 4 |
4 files changed, 14 insertions, 23 deletions
diff --git a/src/namestore/gnunet-service-namestore.c b/src/namestore/gnunet-service-namestore.c index 1a675cb1f..4c64dcd29 100644 --- a/src/namestore/gnunet-service-namestore.c +++ b/src/namestore/gnunet-service-namestore.c | |||
@@ -646,8 +646,11 @@ handle_record_store (void *cls, | |||
646 | 646 | ||
647 | if ((rd_count == 0) && (GNUNET_NO == GSN_database->iterate_records (GSN_database->cls, &rp_msg->private_key, 0, NULL, 0))) | 647 | if ((rd_count == 0) && (GNUNET_NO == GSN_database->iterate_records (GSN_database->cls, &rp_msg->private_key, 0, NULL, 0))) |
648 | { | 648 | { |
649 | /* This name does not exist, so cannot be removed */ | 649 | /* This name does not exist, so cannot be removed */ |
650 | res = GNUNET_NO; | 650 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
651 | "Name `%s' does not exist, no deletion required\n", | ||
652 | conv_name); | ||
653 | res = GNUNET_NO; | ||
651 | } | 654 | } |
652 | else | 655 | else |
653 | { | 656 | { |
diff --git a/src/namestore/plugin_namestore_sqlite.c b/src/namestore/plugin_namestore_sqlite.c index f2f884290..4c040cc97 100644 --- a/src/namestore/plugin_namestore_sqlite.c +++ b/src/namestore/plugin_namestore_sqlite.c | |||
@@ -695,7 +695,10 @@ namestore_sqlite_store_records (void *cls, | |||
695 | switch (n) | 695 | switch (n) |
696 | { | 696 | { |
697 | case SQLITE_DONE: | 697 | case SQLITE_DONE: |
698 | GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, "sqlite", "Record stored\n"); | 698 | if (0 != rd_count) |
699 | GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, "sqlite", "Record stored\n"); | ||
700 | else | ||
701 | GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, "sqlite", "Record deleted\n"); | ||
699 | return GNUNET_OK; | 702 | return GNUNET_OK; |
700 | case SQLITE_BUSY: | 703 | case SQLITE_BUSY: |
701 | LOG_SQLITE (plugin, GNUNET_ERROR_TYPE_WARNING | GNUNET_ERROR_TYPE_BULK, | 704 | LOG_SQLITE (plugin, GNUNET_ERROR_TYPE_WARNING | GNUNET_ERROR_TYPE_BULK, |
diff --git a/src/namestore/test_namestore_api_remove.c b/src/namestore/test_namestore_api_remove.c index 4c83cda63..568a0cd8b 100644 --- a/src/namestore/test_namestore_api_remove.c +++ b/src/namestore/test_namestore_api_remove.c | |||
@@ -94,16 +94,12 @@ end (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
94 | res = 0; | 94 | res = 0; |
95 | } | 95 | } |
96 | 96 | ||
97 | static void | ||
98 | name_lookup_proc (void *cls, const struct GNUNET_NAMESTORE_Block *block); | ||
99 | |||
100 | 97 | ||
101 | static void | 98 | static void |
102 | remove_cont (void *cls, | 99 | remove_cont (void *cls, |
103 | int32_t success, | 100 | int32_t success, |
104 | const char *emsg) | 101 | const char *emsg) |
105 | { | 102 | { |
106 | const char *name = cls; | ||
107 | if (GNUNET_YES != success) | 103 | if (GNUNET_YES != success) |
108 | { | 104 | { |
109 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, | 105 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, |
@@ -113,23 +109,12 @@ remove_cont (void *cls, | |||
113 | endbadly_task = GNUNET_SCHEDULER_add_now (&endbadly, NULL); | 109 | endbadly_task = GNUNET_SCHEDULER_add_now (&endbadly, NULL); |
114 | return; | 110 | return; |
115 | } | 111 | } |
116 | |||
117 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, | 112 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, |
118 | "Records were removed, perform lookup\n"); | 113 | "Records were removed, perform lookup\n"); |
119 | |||
120 | removed = GNUNET_YES; | 114 | removed = GNUNET_YES; |
121 | nsqe = GNUNET_NAMESTORE_lookup_block (nsh, &derived_hash, | 115 | if (endbadly_task != GNUNET_SCHEDULER_NO_TASK) |
122 | &name_lookup_proc, (void *) name); | 116 | GNUNET_SCHEDULER_cancel (endbadly_task); |
123 | if (NULL == nsqe) | 117 | GNUNET_SCHEDULER_add_now (&end, NULL); |
124 | { | ||
125 | GNUNET_break (0); | ||
126 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, | ||
127 | _("Namestore cannot perform lookup for removed record\n")); | ||
128 | if (endbadly_task != GNUNET_SCHEDULER_NO_TASK) | ||
129 | GNUNET_SCHEDULER_cancel (endbadly_task); | ||
130 | endbadly_task = GNUNET_SCHEDULER_add_now (&endbadly, NULL); | ||
131 | return; | ||
132 | } | ||
133 | } | 118 | } |
134 | 119 | ||
135 | 120 | ||
diff --git a/src/namestore/test_namestore_delete.sh b/src/namestore/test_namestore_delete.sh index 2b39bbd28..7e5ca97e7 100755 --- a/src/namestore/test_namestore_delete.sh +++ b/src/namestore/test_namestore_delete.sh | |||
@@ -32,8 +32,8 @@ start_peer | |||
32 | gnunet-namestore -p -z testego -a -n $TEST_RECORD_NAME_DNS -t A -V $TEST_IP_PLUS -e never -c $CONFIGURATION | 32 | gnunet-namestore -p -z testego -a -n $TEST_RECORD_NAME_DNS -t A -V $TEST_IP_PLUS -e never -c $CONFIGURATION |
33 | # Delete record | 33 | # Delete record |
34 | gnunet-namestore -p -z testego -d -n $TEST_RECORD_NAME_DNS -t A -V $TEST_IP_PLUS -e never -c $CONFIGURATION | 34 | gnunet-namestore -p -z testego -d -n $TEST_RECORD_NAME_DNS -t A -V $TEST_IP_PLUS -e never -c $CONFIGURATION |
35 | # Lookup specific name | 35 | # List all records |
36 | OUTPUT=`gnunet-namestore -p -z testego -n $TEST_RECORD_NAME_DNS -D` | 36 | OUTPUT=`gnunet-namestore -p -z testego -D` |
37 | FOUND_IP=false | 37 | FOUND_IP=false |
38 | FOUND_NAME=false | 38 | FOUND_NAME=false |
39 | for LINE in $OUTPUT ; | 39 | for LINE in $OUTPUT ; |