gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[taler-anastasis] branch master updated: small fix indent


From: gnunet
Subject: [taler-anastasis] branch master updated: small fix indent
Date: Fri, 11 Sep 2020 17:26:07 +0200

This is an automated email from the git hooks/post-receive script.

ds-meister pushed a commit to branch master
in repository anastasis.

The following commit(s) were added to refs/heads/master by this push:
     new 3e1fd2b  small fix indent
3e1fd2b is described below

commit 3e1fd2bc020a224db9ff11c2572dc24d9a9d6ef0
Author: Dominik Meister <dominik.meister@hotmail.ch>
AuthorDate: Fri Sep 11 17:25:41 2020 +0200

    small fix indent
---
 src/stasis/plugin_anastasis_postgres.c | 161 +++++++++++++++++----------------
 1 file changed, 81 insertions(+), 80 deletions(-)

diff --git a/src/stasis/plugin_anastasis_postgres.c 
b/src/stasis/plugin_anastasis_postgres.c
index 51892a3..b67a144 100644
--- a/src/stasis/plugin_anastasis_postgres.c
+++ b/src/stasis/plugin_anastasis_postgres.c
@@ -1416,14 +1416,14 @@ postgres_get_recovery_document (void *cls,
 }
 
 /**
- * Verify the provided code with the code on the server. 
+ * Verify the provided code with the code on the server.
  * If the code matches the function will return with success, if the code
  * does not match, the retry counter will be decreased by one.
  *
  * @param cls closure
  * @param truth_pub identification of the challenge which the code corresponds 
to
  * @param code code which the user provided and wants to verify
-  (already verified that this is a uint64_t no checks needed) 
+  (already verified that this is a uint64_t no checks needed)
  * @return transaction status
  */
 enum ANASTASIS_DB_QueryStatus
@@ -1437,40 +1437,40 @@ postgres_verify_challenge_code (void *cls,
   enum ANASTASIS_DB_QueryStatus qs;
   uint64_t server_code;
   {
-  struct GNUNET_PQ_QueryParam params[] = {
-    GNUNET_PQ_query_param_auto_from_type (truth_pub),
-    GNUNET_PQ_query_param_end
-  };
-  struct GNUNET_PQ_ResultSpec rs[] = {
-    GNUNET_PQ_result_spec_uint64 ("code",
-                                  &server_code),
-    GNUNET_PQ_result_spec_end
-  };
+    struct GNUNET_PQ_QueryParam params[] = {
+      GNUNET_PQ_query_param_auto_from_type (truth_pub),
+      GNUNET_PQ_query_param_end
+    };
+    struct GNUNET_PQ_ResultSpec rs[] = {
+      GNUNET_PQ_result_spec_uint64 ("code",
+                                    &server_code),
+      GNUNET_PQ_result_spec_end
+    };
 
-  check_connection (pg);
-  qs = GNUNET_PQ_eval_prepared_singleton_select (pg->conn,
-                                                 "challengecode_select",
-                                                 params,
-                                                 rs);
-  switch (qs)
-  {
-  case GNUNET_DB_STATUS_HARD_ERROR:
-    return ANASTASIS_DB_STATUS_HARD_ERROR;
-  case GNUNET_DB_STATUS_SOFT_ERROR:
-    GNUNET_break (0);
-    return ANASTASIS_DB_STATUS_SOFT_ERROR;
-  case GNUNET_DB_STATUS_SUCCESS_NO_RESULTS:
-    return ANASTASIS_DB_STATUS_NO_RESULTS;
-  case GNUNET_DB_STATUS_SUCCESS_ONE_RESULT:
-    if (server_code == code)
+    check_connection (pg);
+    qs = GNUNET_PQ_eval_prepared_singleton_select (pg->conn,
+                                                   "challengecode_select",
+                                                   params,
+                                                   rs);
+    switch (qs)
     {
-      return ANASTASIS_DB_STATUS_SUCCESS_ONE_RESULT;
+    case GNUNET_DB_STATUS_HARD_ERROR:
+      return ANASTASIS_DB_STATUS_HARD_ERROR;
+    case GNUNET_DB_STATUS_SOFT_ERROR:
+      GNUNET_break (0);
+      return ANASTASIS_DB_STATUS_SOFT_ERROR;
+    case GNUNET_DB_STATUS_SUCCESS_NO_RESULTS:
+      return ANASTASIS_DB_STATUS_NO_RESULTS;
+    case GNUNET_DB_STATUS_SUCCESS_ONE_RESULT:
+      if (server_code == code)
+      {
+        return ANASTASIS_DB_STATUS_SUCCESS_ONE_RESULT;
+      }
+      break;
+    default:
+      GNUNET_break (0);
+      return ANASTASIS_DB_STATUS_HARD_ERROR;
     }
-    break;
-  default:
-    GNUNET_break (0);
-    return ANASTASIS_DB_STATUS_HARD_ERROR;
-  }
   }
   if (GNUNET_OK != begin_transaction (pg,
                                       "update_challenge_retry"))
@@ -1478,12 +1478,12 @@ postgres_verify_challenge_code (void *cls,
     GNUNET_break (0);
     return ANASTASIS_DB_STATUS_HARD_ERROR;
   }
-  
+
   struct GNUNET_PQ_QueryParam params[] = {
     GNUNET_PQ_query_param_auto_from_type (truth_pub),
     GNUNET_PQ_query_param_end
   };
-  
+
   qs = GNUNET_PQ_eval_prepared_non_select (pg->conn,
                                            "challengecode_update_retry",
                                            params);
@@ -1506,7 +1506,7 @@ postgres_verify_challenge_code (void *cls,
     GNUNET_break (0);
     return ANASTASIS_DB_STATUS_HARD_ERROR;
   }
-  
+
   qs = commit_transaction (pg);
   if (qs < 0)
   {
@@ -1528,12 +1528,13 @@ postgres_verify_challenge_code (void *cls,
  * @param retry_counter amount of retries allowed
  * @return transaction status
  */
- 
+
 enum ANASTASIS_DB_QueryStatus
 postgres_store_challenge_code (void *cls,
                                const struct
-                               ANASTASIS_CRYPTO_TruthPublicKeyP 
*truth_public_key,
-                               uint64_t code, 
+                               ANASTASIS_CRYPTO_TruthPublicKeyP *
+                               truth_public_key,
+                               uint64_t code,
                                struct GNUNET_TIME_Relative expiration_time,
                                unsigned int retry_counter)
 {
@@ -1544,44 +1545,44 @@ postgres_store_challenge_code (void *cls,
   GNUNET_TIME_round_abs (&creation_date);
   expiration_date = GNUNET_TIME_absolute_add (creation_date,
                                               expiration_time);
-                                              
-  /*Check if there is already a valid code */                                  
          
-  /*FIXME maybe put this in a function code reusage*/                          
                   
+
+  /*Check if there is already a valid code */
+  /*FIXME maybe put this in a function code reusage*/
   uint64_t server_code;
   {
-  struct GNUNET_PQ_QueryParam params[] = {
-    GNUNET_PQ_query_param_auto_from_type (truth_public_key),
-    TALER_PQ_query_param_absolute_time (&creation_date),
-    GNUNET_PQ_query_param_end
-  };
-  struct GNUNET_PQ_ResultSpec rs[] = {
-    GNUNET_PQ_result_spec_uint64 ("code",
-                                  &server_code),                              
-    GNUNET_PQ_result_spec_end
-  };
+    struct GNUNET_PQ_QueryParam params[] = {
+      GNUNET_PQ_query_param_auto_from_type (truth_public_key),
+      TALER_PQ_query_param_absolute_time (&creation_date),
+      GNUNET_PQ_query_param_end
+    };
+    struct GNUNET_PQ_ResultSpec rs[] = {
+      GNUNET_PQ_result_spec_uint64 ("code",
+                                    &server_code),
+      GNUNET_PQ_result_spec_end
+    };
 
-  check_connection (pg);
-  qs = GNUNET_PQ_eval_prepared_singleton_select (pg->conn,
-                                                 "challengecode_select",
-                                                 params,
-                                                 rs);
-  switch (qs)
-  {
-  case GNUNET_DB_STATUS_HARD_ERROR:
-    return ANASTASIS_DB_STATUS_HARD_ERROR;
-  case GNUNET_DB_STATUS_SOFT_ERROR:
-    GNUNET_break (0);
-    return ANASTASIS_DB_STATUS_SOFT_ERROR;
-  case GNUNET_DB_STATUS_SUCCESS_NO_RESULTS:
-    break;
-  case GNUNET_DB_STATUS_SUCCESS_ONE_RESULT:
-    return ANASTASIS_DB_STATUS_VALID_CODE_STORED;
-  default:
-    GNUNET_break (0);
-    return ANASTASIS_DB_STATUS_HARD_ERROR;
+    check_connection (pg);
+    qs = GNUNET_PQ_eval_prepared_singleton_select (pg->conn,
+                                                   "challengecode_select",
+                                                   params,
+                                                   rs);
+    switch (qs)
+    {
+    case GNUNET_DB_STATUS_HARD_ERROR:
+      return ANASTASIS_DB_STATUS_HARD_ERROR;
+    case GNUNET_DB_STATUS_SOFT_ERROR:
+      GNUNET_break (0);
+      return ANASTASIS_DB_STATUS_SOFT_ERROR;
+    case GNUNET_DB_STATUS_SUCCESS_NO_RESULTS:
+      break;
+    case GNUNET_DB_STATUS_SUCCESS_ONE_RESULT:
+      return ANASTASIS_DB_STATUS_VALID_CODE_STORED;
+    default:
+      GNUNET_break (0);
+      return ANASTASIS_DB_STATUS_HARD_ERROR;
+    }
   }
-  }   
-                                              
+
   check_connection (pg);
   if (GNUNET_OK != begin_transaction (pg,
                                       "store_challenge_code"))
@@ -1599,7 +1600,7 @@ postgres_store_challenge_code (void *cls,
       GNUNET_PQ_query_param_uint32 (&retry_counter),
       GNUNET_PQ_query_param_end
     };
-    
+
     qs = GNUNET_PQ_eval_prepared_non_select (pg->conn,
                                              "challengecode_insert",
                                              params);
@@ -1651,8 +1652,8 @@ postgres_challenge_gc (void *cls)
   check_connection (pg);
   postgres_preflight (pg);
   return GNUNET_PQ_eval_prepared_non_select (pg->conn,
-                                           "gc_challengecodes",
-                                           params);
+                                             "gc_challengecodes",
+                                             params);
 }
 
 
@@ -1707,13 +1708,13 @@ libanastasis_plugin_db_postgres_init (void *cls)
       " recovery_data BYTEA NOT NULL,"
       " PRIMARY KEY (user_id, version)"
       ");"),
-      GNUNET_PQ_make_execute (
+    GNUNET_PQ_make_execute (
       "CREATE TABLE IF NOT EXISTS anastasis_challengecode"
       "( truth_public_key BYTEA NOT NULL,"
       " code INT8 NOT NULL,"
       " creation_date TIMESTAMP NOT NULL DEFAULT NOW(),"
       " expiration_date TIMESTAMP NOT NULL,"
-      " retry_counter INT4 NOT NULL)"
+      " retry_counter INT4 NOT NULL"
       ");"),
     GNUNET_PQ_EXECUTE_STATEMENT_END
   };
@@ -1917,7 +1918,7 @@ libanastasis_plugin_db_postgres_init (void *cls)
                             "AND (expiration_date > $2) "
                             "AND (retry_counter > 0);",
                             2),
-    
+
     GNUNET_PQ_make_prepare ("challengecode_update_retry",
                             "UPDATE anastasis_challengecode "
                             "SET "
@@ -1929,7 +1930,7 @@ libanastasis_plugin_db_postgres_init (void *cls)
                             "DELETE FROM anastasis_challengecode "
                             "WHERE "
                             "expiration_date < $1;",
-                            1),                        
+                            1),
     GNUNET_PQ_PREPARED_STATEMENT_END
   };
 

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]