address most FIXMEs in pg plugin

This commit is contained in:
Christian Grothoff 2021-10-29 11:35:34 +02:00
parent 9968a34a1d
commit ab3042243d
No known key found for this signature in database
GPG Key ID: 939E6BE1E29FC3CC
2 changed files with 22 additions and 2 deletions

View File

@ -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);
}

View File

@ -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