diff options
author | Christian Grothoff <christian@grothoff.org> | 2021-10-29 11:35:34 +0200 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2021-10-29 11:35:34 +0200 |
commit | ab3042243df1432068e08f6d7f659d761ad6384c (patch) | |
tree | 0e1d943cf73f4e890b251086a4aac2635376d94e /src | |
parent | 9968a34a1dd7fb22ebe3a334857d8c33d6889a4a (diff) | |
download | exchange-ab3042243df1432068e08f6d7f659d761ad6384c.tar.xz |
address most FIXMEs in pg plugin
Diffstat (limited to 'src')
-rw-r--r-- | src/exchangedb/plugin_exchangedb_postgres.c | 22 | ||||
-rw-r--r-- | src/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 index e4565aa0e..27870f524 100644 --- 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 index f6db76942..e582025b1 100644 --- 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 |