exchange

Base system with REST service to issue digital coins, run by the payment service provider
Log | Files | Refs | Submodules | README | LICENSE

commit ab3042243df1432068e08f6d7f659d761ad6384c
parent 9968a34a1dd7fb22ebe3a334857d8c33d6889a4a
Author: Christian Grothoff <christian@grothoff.org>
Date:   Fri, 29 Oct 2021 11:35:34 +0200

address most FIXMEs in pg plugin

Diffstat:
Msrc/exchangedb/plugin_exchangedb_postgres.c | 22++++++++++++++++++++--
Msrc/exchangedb/test-exchange-db-postgres.conf | 2++
2 files changed, 22 insertions(+), 2 deletions(-)

diff --git a/src/exchangedb/plugin_exchangedb_postgres.c b/src/exchangedb/plugin_exchangedb_postgres.c @@ -3694,12 +3694,30 @@ postgres_inselect_wallet_kyc_status ( { char *rps; + unsigned int skip; + const char *extra = ""; + int url_len; rps = GNUNET_STRINGS_data_to_string_alloc (reserve_pub, sizeof (*reserve_pub)); + skip = 0; + if (0 == strncasecmp (pg->exchange_url, + "http://", + strlen ("http://"))) + skip = strlen ("http://"); + if (0 == strncasecmp (pg->exchange_url, + "https://", + strlen ("https://"))) + skip = strlen ("https://"); + url_len = strlen (pg->exchange_url); + if ('/' == pg->exchange_url[url_len - 1]) + url_len--; + url_len -= skip; GNUNET_asprintf (&payto_uri, - "taler://reserve/%s/%s", - pg->exchange_url, + "taler%s://reserve/%.*s/%s", + extra, + url_len, + pg->exchange_url + skip, rps); GNUNET_free (rps); } diff --git a/src/exchangedb/test-exchange-db-postgres.conf b/src/exchangedb/test-exchange-db-postgres.conf @@ -2,6 +2,8 @@ #The DB plugin to use DB = postgres +BASE_URL = http://localhost/ + [exchangedb-postgres] #The connection string the plugin has to use for connecting to the database