DCE: we never have to derrive the wire_gateway_url from the payto URI
This commit is contained in:
parent
04b5e7e3e8
commit
c805e9cf20
@ -280,17 +280,6 @@ char *
|
|||||||
TALER_xtalerbank_base_url_from_payto (const char *payto);
|
TALER_xtalerbank_base_url_from_payto (const char *payto);
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Given an x-taler-bank payto:// URL, compute
|
|
||||||
* the HTTP(S) base URL of the account.
|
|
||||||
*
|
|
||||||
* @param payto the payto URL
|
|
||||||
* @return bank URL of the account, NULL if not x-taler-bak payto URL
|
|
||||||
*/
|
|
||||||
char *
|
|
||||||
TALER_xtalerbank_account_url_from_payto (const char *payto);
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Obtain the account name from a payto URL.
|
* Obtain the account name from a payto URL.
|
||||||
*
|
*
|
||||||
|
@ -77,14 +77,6 @@ main (int argc,
|
|||||||
"payto://x-taler-bank/localhost:1080/bob");
|
"payto://x-taler-bank/localhost:1080/bob");
|
||||||
CHECK ("http://localhost:1080/",
|
CHECK ("http://localhost:1080/",
|
||||||
r);
|
r);
|
||||||
r = TALER_xtalerbank_account_url_from_payto (
|
|
||||||
"payto://x-taler-bank/localhost/bob");
|
|
||||||
CHECK ("https://localhost/bob",
|
|
||||||
r);
|
|
||||||
r = TALER_xtalerbank_account_url_from_payto (
|
|
||||||
"payto://x-taler-bank/localhost:1080/alice");
|
|
||||||
CHECK ("http://localhost:1080/alice",
|
|
||||||
r);
|
|
||||||
r = TALER_xtalerbank_account_from_payto (
|
r = TALER_xtalerbank_account_from_payto (
|
||||||
"payto://x-taler-bank/localhost:1080/alice");
|
"payto://x-taler-bank/localhost:1080/alice");
|
||||||
CHECK ("alice",
|
CHECK ("alice",
|
||||||
|
@ -719,49 +719,6 @@ TALER_xtalerbank_base_url_from_payto (const char *payto)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Given an x-taler-bank payto:// URL, compute
|
|
||||||
* the HTTP(S) base URL of the account.
|
|
||||||
*
|
|
||||||
* @param payto the payto URL
|
|
||||||
* @return bank URL of the account, NULL if not x-taler-bak payto URL
|
|
||||||
*/
|
|
||||||
char *
|
|
||||||
TALER_xtalerbank_account_url_from_payto (const char *payto)
|
|
||||||
{
|
|
||||||
const char *start;
|
|
||||||
const char *end;
|
|
||||||
char *ret;
|
|
||||||
int https;
|
|
||||||
const char *colon;
|
|
||||||
unsigned int port;
|
|
||||||
|
|
||||||
if (0 != strncasecmp (payto,
|
|
||||||
"payto://x-taler-bank/",
|
|
||||||
strlen ("payto://x-taler-bank/")))
|
|
||||||
return NULL;
|
|
||||||
start = &payto[strlen ("payto://x-taler-bank/")];
|
|
||||||
end = strchr (start,
|
|
||||||
'/');
|
|
||||||
if (NULL == end)
|
|
||||||
end = &start[strlen (start)];
|
|
||||||
colon = strrchr (start,
|
|
||||||
':');
|
|
||||||
https = GNUNET_YES;
|
|
||||||
if ( (NULL != colon) &&
|
|
||||||
(1 == sscanf (colon + 1,
|
|
||||||
"%u",
|
|
||||||
&port)) &&
|
|
||||||
(443 != port) )
|
|
||||||
https = GNUNET_NO;
|
|
||||||
GNUNET_asprintf (&ret,
|
|
||||||
"%s://%s",
|
|
||||||
(https ? "https" : "http"),
|
|
||||||
start);
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Obtain the account name from a payto URL.
|
* Obtain the account name from a payto URL.
|
||||||
*
|
*
|
||||||
|
Loading…
Reference in New Issue
Block a user