gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] [taler-exchange] branch stable updated (7ba2ee0 -> 5f5babc)


From: gnunet
Subject: [GNUnet-SVN] [taler-exchange] branch stable updated (7ba2ee0 -> 5f5babc)
Date: Fri, 10 Mar 2017 16:17:24 +0100

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

dold pushed a change to branch stable
in repository exchange.

    from 7ba2ee0  test more of /wire, fix off-by-one
     add 5f5babc  fix #4851

No new revisions were added by this update.

Summary of changes:
 src/exchange/taler-exchange-httpd.c         | 13 +++++++------
 src/exchange/taler-exchange-httpd_db.c      |  2 +-
 src/exchange/taler-exchange-httpd_wire.c    | 25 ++++++++++++++++++++++---
 src/exchange/taler-exchange-httpd_wire.h    | 10 ++++++++++
 src/exchangedb/plugin_exchangedb_postgres.c |  4 ++--
 5 files changed, 42 insertions(+), 12 deletions(-)

diff --git a/src/exchange/taler-exchange-httpd.c 
b/src/exchange/taler-exchange-httpd.c
index 11cf00d..fa000d0 100644
--- a/src/exchange/taler-exchange-httpd.c
+++ b/src/exchange/taler-exchange-httpd.c
@@ -625,10 +625,6 @@ exchange_serve_process_config ()
     return GNUNET_SYSERR;
   }
   if (GNUNET_OK !=
-      TEH_VALIDATION_init (cfg))
-    return GNUNET_SYSERR;
-
-  if (GNUNET_OK !=
       GNUNET_CONFIGURATION_get_value_string (cfg,
                                              "exchange",
                                              "master_public_key",
@@ -637,7 +633,6 @@ exchange_serve_process_config ()
     GNUNET_log_config_missing (GNUNET_ERROR_TYPE_ERROR,
                                "exchange",
                                "master_public_key");
-    TEH_VALIDATION_done ();
     return GNUNET_SYSERR;
   }
   if (GNUNET_OK !=
@@ -648,11 +643,17 @@ exchange_serve_process_config ()
     fprintf (stderr,
              "Invalid master public key given in exchange configuration.");
     GNUNET_free (TEH_master_public_key_str);
-    TEH_VALIDATION_done ();
     return GNUNET_SYSERR;
   }
   GNUNET_free (TEH_master_public_key_str);
 
+  if ( (GNUNET_OK !=
+        TEH_VALIDATION_init (cfg)) ||
+       (GNUNET_OK !=
+        TEH_WIRE_init ()) )
+    return GNUNET_SYSERR;
+
+
   if (NULL ==
       (TEH_plugin = TALER_EXCHANGEDB_plugin_load (cfg)))
   {
diff --git a/src/exchange/taler-exchange-httpd_db.c 
b/src/exchange/taler-exchange-httpd_db.c
index 9257cbe..589229f 100644
--- a/src/exchange/taler-exchange-httpd_db.c
+++ b/src/exchange/taler-exchange-httpd_db.c
@@ -615,7 +615,7 @@ TEH_DB_execute_reserve_status (struct MHD_Connection 
*connection,
                                          "error", "Reserve not found",
                                          "parameter", "withdraw_pub");
   res = TEH_RESPONSE_reply_reserve_status_success (connection,
-                                                    rh);
+                                                   rh);
   TEH_plugin->free_reserve_history (TEH_plugin->cls,
                                     rh);
   return res;
diff --git a/src/exchange/taler-exchange-httpd_wire.c 
b/src/exchange/taler-exchange-httpd_wire.c
index 9c8b2ff..26cbb18 100644
--- a/src/exchange/taler-exchange-httpd_wire.c
+++ b/src/exchange/taler-exchange-httpd_wire.c
@@ -120,9 +120,7 @@ TEH_WIRE_handler_wire (struct TEH_RequestHandler *rh,
                        const char *upload_data,
                        size_t *upload_data_size)
 {
-  if (NULL == wire_methods)
-    wire_methods = TEH_VALIDATION_get_wire_methods ("exchange-wire-incoming");
-
+  GNUNET_assert (NULL != wire_methods);
   return TEH_RESPONSE_reply_json (connection,
                                   wire_methods,
                                   MHD_HTTP_OK);
@@ -130,6 +128,27 @@ TEH_WIRE_handler_wire (struct TEH_RequestHandler *rh,
 
 
 /**
+ * Initialize wire subsystem.
+ *
+ * @return #GNUNET_OK on success, #GNUNET_SYSERR if we found no valid
+ *         wire methods
+ */
+int
+TEH_WIRE_init ()
+{
+  wire_methods = TEH_VALIDATION_get_wire_methods ("exchange-wire-incoming");
+  if ( (NULL == wire_methods) ||
+       (0 == json_object_size (wire_methods)) )
+  {
+    GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+                "Failed to find properly configured wire transfer method\n");
+    return GNUNET_SYSERR;
+  }
+  return GNUNET_OK;
+}
+
+
+/**
  * Initialize libgcrypt.
  */
 void  __attribute__ ((destructor))
diff --git a/src/exchange/taler-exchange-httpd_wire.h 
b/src/exchange/taler-exchange-httpd_wire.h
index a85fde6..72dd219 100644
--- a/src/exchange/taler-exchange-httpd_wire.h
+++ b/src/exchange/taler-exchange-httpd_wire.h
@@ -27,6 +27,16 @@
 
 
 /**
+ * Initialize wire subsystem.
+ *
+ * @return #GNUNET_OK on success, #GNUNET_SYSERR if we found no valid
+ *         wire methods
+ */
+int
+TEH_WIRE_init (void);
+
+
+/**
  * Obtain fee structure for @a wire_plugin_name wire transfers.
  *
  * @param wire_plugin_name name of the plugin to load fees for
diff --git a/src/exchangedb/plugin_exchangedb_postgres.c 
b/src/exchangedb/plugin_exchangedb_postgres.c
index 179d609..febbf0c 100644
--- a/src/exchangedb/plugin_exchangedb_postgres.c
+++ b/src/exchangedb/plugin_exchangedb_postgres.c
@@ -2186,8 +2186,8 @@ postgres_get_reserve_history (void *cls,
     GNUNET_assert (NULL != rh_tail);
     GNUNET_assert (NULL == rh_tail->next);
     result = GNUNET_PQ_exec_prepared (session->conn,
-                                     "get_reserves_out",
-                                     params);
+                                      "get_reserves_out",
+                                      params);
     if (PGRES_TUPLES_OK != PQresultStatus (result))
     {
       QUERY_ERR (result);

-- 
To stop receiving notification emails like this one, please contact
address@hidden



reply via email to

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