From 37f294b6add3ff4780b14ad54331e98c47b8453a Mon Sep 17 00:00:00 2001
From: Joseph
Date: Fri, 6 Jan 2023 11:05:05 -0500
Subject: [PATCH 1/7] modifications to batch1
---
.../exchange_do_batch_reserves_in_insert.sql | 50 +++++++++++--------
src/exchangedb/pg_batch2_reserves_in_insert.c | 2 +
2 files changed, 32 insertions(+), 20 deletions(-)
diff --git a/src/exchangedb/exchange_do_batch_reserves_in_insert.sql b/src/exchangedb/exchange_do_batch_reserves_in_insert.sql
index 4e0383f6c..d1cc35d3e 100644
--- a/src/exchangedb/exchange_do_batch_reserves_in_insert.sql
+++ b/src/exchangedb/exchange_do_batch_reserves_in_insert.sql
@@ -32,7 +32,10 @@ CREATE OR REPLACE FUNCTION exchange_do_batch_reserves_in_insert(
OUT ruuid INT8)
LANGUAGE plpgsql
AS $$
-
+DECLARE
+ curs refcursor;
+DECLARE
+ i RECORD;
BEGIN
ruuid= 0;
out_reserve_found = TRUE;
@@ -46,28 +49,35 @@ transaction_duplicate= TRUE;
,in_payto_uri)
ON CONFLICT DO NOTHING;
- INSERT INTO reserves
- (reserve_pub
- ,current_balance_val
- ,current_balance_frac
- ,expiration_date
- ,gc_date)
- VALUES
- (in_reserve_pub
- ,in_credit_val
- ,in_credit_frac
- ,in_expiration_date
- ,in_gc_date)
- ON CONFLICT DO NOTHING
- RETURNING reserves.reserve_uuid INTO ruuid;
+ OPEN curs FOR
+ WITH reserve_changes AS (
+ INSERT INTO reserves
+ (reserve_pub
+ ,current_balance_val
+ ,current_balance_frac
+ ,expiration_date
+ ,gc_date)
+ VALUES
+ (in_reserve_pub
+ ,in_credit_val
+ ,in_credit_frac
+ ,in_expiration_date
+ ,in_gc_date)
+ ON CONFLICT DO NOTHING
+ RETURNING reserve_uuid, reserve_pub)
+ SELECT * FROM reserve_changes;
+ FETCH FROM curs INTO i;
IF FOUND
THEN
-- We made a change, so the reserve did not previously exist.
- out_reserve_found = FALSE;
- ELSE
- -- We made no change, which means the reserve existed.
- out_reserve_found = TRUE;
+ IF in_reserve_pub = i.reserve_pub
+ THEN
+ out_reserve_found = FALSE;
+ ruuid = i.reserve_uuid;
+ END IF;
END IF;
+ CLOSE curs;
+
PERFORM pg_notify(in_notify, NULL);
INSERT INTO reserves_in
(reserve_pub
@@ -92,7 +102,7 @@ transaction_duplicate= TRUE;
transaction_duplicate = FALSE;
ELSE
-- Unhappy...
--- RAISE EXCEPTION 'Reserve did not exist, but INSERT into reserves_in gave conflict';
+ RAISE EXCEPTION 'Reserve did not exist, but INSERT into reserves_in gave conflict';
transaction_duplicate = TRUE;
-- ROLLBACK;
END IF;
diff --git a/src/exchangedb/pg_batch2_reserves_in_insert.c b/src/exchangedb/pg_batch2_reserves_in_insert.c
index a55c518c3..e0208f094 100644
--- a/src/exchangedb/pg_batch2_reserves_in_insert.c
+++ b/src/exchangedb/pg_batch2_reserves_in_insert.c
@@ -763,6 +763,7 @@ TEH_PG_batch2_reserves_in_insert (void *cls,
t_duplicate |= transaction_duplicate[i+1];
t_duplicate |= transaction_duplicate[i+2];
t_duplicate |= transaction_duplicate[i+3];
+ // fprintf(stdout, "reserve_uuid : %ld %ld %ld %ld\n", reserve_uuid[i], reserve_uuid[i+1], reserve_uuid[i+2], reserve_uuid[i+3]);
i += 4;
break;
case 3:
@@ -792,6 +793,7 @@ TEH_PG_batch2_reserves_in_insert (void *cls,
results[i] = (t_duplicate)
? GNUNET_DB_STATUS_SUCCESS_NO_RESULTS
: GNUNET_DB_STATUS_SUCCESS_ONE_RESULT;
+ // fprintf(stdout, "reserve_uuid : %ld %ld\n", reserve_uuid[i], reserve_uuid[i+1]);
i += 2;
break;
case 1:
From 1a94db3d4943b6fbec9e3c3131dc8b9b6ad233f6 Mon Sep 17 00:00:00 2001
From: Joseph
Date: Fri, 6 Jan 2023 11:05:53 -0500
Subject: [PATCH 2/7] some changes to batchtest
---
src/exchangedb/exchange_do_batch2_reserves_in_insert.sql | 1 -
src/exchangedb/exchange_do_batch4_reserves_in_insert.sql | 2 +-
src/exchangedb/test_exchangedb_by_j.c | 2 +-
3 files changed, 2 insertions(+), 3 deletions(-)
diff --git a/src/exchangedb/exchange_do_batch2_reserves_in_insert.sql b/src/exchangedb/exchange_do_batch2_reserves_in_insert.sql
index bda644eca..932f7d813 100644
--- a/src/exchangedb/exchange_do_batch2_reserves_in_insert.sql
+++ b/src/exchangedb/exchange_do_batch2_reserves_in_insert.sql
@@ -55,7 +55,6 @@ DECLARE
DECLARE
k INT8;
BEGIN
- --SIMPLE INSERT ON CONFLICT DO NOTHING
transaction_duplicate=TRUE;
transaction_duplicate2=TRUE;
out_reserve_found = TRUE;
diff --git a/src/exchangedb/exchange_do_batch4_reserves_in_insert.sql b/src/exchangedb/exchange_do_batch4_reserves_in_insert.sql
index c2157f7d3..a70521bcd 100644
--- a/src/exchangedb/exchange_do_batch4_reserves_in_insert.sql
+++ b/src/exchangedb/exchange_do_batch4_reserves_in_insert.sql
@@ -267,7 +267,7 @@ BEGIN
END IF;
k=k+1;
END LOOP;
-
+ /**ROLLBACK TRANSACTION IN SOTRED PROCEDURE IS IT PROSSIBLE ?**/
/*IF transaction_duplicate
OR transaction_duplicate2
OR transaction_duplicate3
diff --git a/src/exchangedb/test_exchangedb_by_j.c b/src/exchangedb/test_exchangedb_by_j.c
index 9769d964b..533871cca 100644
--- a/src/exchangedb/test_exchangedb_by_j.c
+++ b/src/exchangedb/test_exchangedb_by_j.c
@@ -107,7 +107,7 @@ run (void *cls)
const char *sndr = "payto://x-taler-bank/localhost:8080/1";
struct TALER_Amount value;
unsigned int batch_size = batches[i];
- unsigned int iterations = 16;//1024*10;
+ unsigned int iterations = 10000;//1024*10;
struct TALER_ReservePublicKeyP reserve_pubs[iterations];
struct GNUNET_TIME_Absolute now;
struct GNUNET_TIME_Timestamp ts;
From 28c3ae47de7428b4f7019db9158390f8d14ca93d Mon Sep 17 00:00:00 2001
From: Joseph
Date: Fri, 6 Jan 2023 11:15:32 -0500
Subject: [PATCH 3/7] try batch1 with cursor
---
.../exchange_do_batch_reserves_in_insert.sql | 20 ++++++++++++-------
src/exchangedb/pg_batch2_reserves_in_insert.c | 2 +-
src/exchangedb/test_exchangedb_by_j.c | 2 +-
3 files changed, 15 insertions(+), 9 deletions(-)
diff --git a/src/exchangedb/exchange_do_batch_reserves_in_insert.sql b/src/exchangedb/exchange_do_batch_reserves_in_insert.sql
index d1cc35d3e..c95f75c3c 100644
--- a/src/exchangedb/exchange_do_batch_reserves_in_insert.sql
+++ b/src/exchangedb/exchange_do_batch_reserves_in_insert.sql
@@ -36,6 +36,8 @@ DECLARE
curs refcursor;
DECLARE
i RECORD;
+DECLARE
+ curs_trans refcursor;
BEGIN
ruuid= 0;
out_reserve_found = TRUE;
@@ -79,6 +81,8 @@ transaction_duplicate= TRUE;
CLOSE curs;
PERFORM pg_notify(in_notify, NULL);
+ OPEN curs_trans FOR
+ WITH reserve_transaction AS(
INSERT INTO reserves_in
(reserve_pub
,wire_reference
@@ -95,16 +99,18 @@ transaction_duplicate= TRUE;
,in_exchange_account_name
,in_wire_source_h_payto
,in_expiration_date)
- ON CONFLICT DO NOTHING;
+ ON CONFLICT DO NOTHING
+ RETURNING reserve_pub)
+ SELECT * FROM reserve_transaction;
+ FETCH FROM curs_trans INTO i;
IF FOUND
THEN
+ IF i.reserve_pub = in_reserve_pub
+ THEN
-- HAPPY PATH THERE IS NO DUPLICATE TRANS
- transaction_duplicate = FALSE;
- ELSE
- -- Unhappy...
- RAISE EXCEPTION 'Reserve did not exist, but INSERT into reserves_in gave conflict';
- transaction_duplicate = TRUE;
--- ROLLBACK;
+ transaction_duplicate = FALSE;
+ END IF;
END IF;
+ CLOSE curs_trans;
RETURN;
END $$;
diff --git a/src/exchangedb/pg_batch2_reserves_in_insert.c b/src/exchangedb/pg_batch2_reserves_in_insert.c
index e0208f094..1ef9045da 100644
--- a/src/exchangedb/pg_batch2_reserves_in_insert.c
+++ b/src/exchangedb/pg_batch2_reserves_in_insert.c
@@ -817,7 +817,7 @@ TEH_PG_batch2_reserves_in_insert (void *cls,
}
need_update |= conflicts[i];
t_duplicate |= transaction_duplicate[i];
- // fprintf(stdout, "reserve uuid : %ld c :%d t:%d\n", reserve_uuid[i], conflicts[i], transaction_duplicate[i]);
+ // fprintf(stdout, "reserve uuid : %ld c :%d t:%d\n", reserve_uuid[i], conflicts[i], transaction_duplicate[i]);
i += 1;
break;
case 0:
diff --git a/src/exchangedb/test_exchangedb_by_j.c b/src/exchangedb/test_exchangedb_by_j.c
index 533871cca..9769d964b 100644
--- a/src/exchangedb/test_exchangedb_by_j.c
+++ b/src/exchangedb/test_exchangedb_by_j.c
@@ -107,7 +107,7 @@ run (void *cls)
const char *sndr = "payto://x-taler-bank/localhost:8080/1";
struct TALER_Amount value;
unsigned int batch_size = batches[i];
- unsigned int iterations = 10000;//1024*10;
+ unsigned int iterations = 16;//1024*10;
struct TALER_ReservePublicKeyP reserve_pubs[iterations];
struct GNUNET_TIME_Absolute now;
struct GNUNET_TIME_Timestamp ts;
From 6cb8b68bd08ddb5edff396e293b6776e0e989ded Mon Sep 17 00:00:00 2001
From: Christian Grothoff
Date: Fri, 6 Jan 2023 22:22:14 +0100
Subject: [PATCH 4/7] support md in TOS
---
contrib/Makefile.am | 2 ++
contrib/update-pp.sh | 4 ++++
contrib/update-tos.sh | 4 ++++
src/mhd/mhd_legal.c | 1 +
4 files changed, 11 insertions(+)
diff --git a/contrib/Makefile.am b/contrib/Makefile.am
index cc1cf4d7f..99927e7e6 100644
--- a/contrib/Makefile.am
+++ b/contrib/Makefile.am
@@ -26,6 +26,7 @@ rdatadir=$(datadir)/taler/exchange
tosen_DATA = \
tos/en/*.txt \
+ tos/en/*.md \
tos/en/*.pdf \
tos/en/*.epub \
tos/en/*.xml \
@@ -33,6 +34,7 @@ tosen_DATA = \
ppen_DATA = \
pp/en/*.txt \
+ pp/en/*.md \
pp/en/*.pdf \
pp/en/*.epub \
pp/en/*.xml \
diff --git a/contrib/update-pp.sh b/contrib/update-pp.sh
index 948f6af35..728216c58 100755
--- a/contrib/update-pp.sh
+++ b/contrib/update-pp.sh
@@ -29,6 +29,10 @@ do
else
mv _build/$f/${VERSION}.$f $l/${VERSION}.$f
fi
+ if test $f = "txt"
+ then
+ cp $l/${VERSION}.$f $l/${VERSION}.md
+ fi
done
done
cd ..
diff --git a/contrib/update-tos.sh b/contrib/update-tos.sh
index 67db7c031..dcf9e3919 100755
--- a/contrib/update-tos.sh
+++ b/contrib/update-tos.sh
@@ -29,6 +29,10 @@ do
else
mv _build/$f/${VERSION}.$f $l/${VERSION}.$f
fi
+ if test $f = "txt"
+ then
+ cp $l/${VERSION}.$f $l/${VERSION}.md
+ fi
done
done
cd ..
diff --git a/src/mhd/mhd_legal.c b/src/mhd/mhd_legal.c
index c801f84cd..25435210e 100644
--- a/src/mhd/mhd_legal.c
+++ b/src/mhd/mhd_legal.c
@@ -388,6 +388,7 @@ load_terms (struct TALER_MHD_Legal *legal,
{ .ext = ".html", .mime = "text/html", .priority = 100 },
{ .ext = ".htm", .mime = "text/html", .priority = 99 },
{ .ext = ".txt", .mime = "text/plain", .priority = 50 },
+ { .ext = ".md", .mime = "text/markdown", .priority = 50 },
{ .ext = ".pdf", .mime = "application/pdf", .priority = 25 },
{ .ext = ".jpg", .mime = "image/jpeg" },
{ .ext = ".jpeg", .mime = "image/jpeg" },
From 854e9fda1ee848b18fc34b2e02c62852c12096cc Mon Sep 17 00:00:00 2001
From: Christian Grothoff
Date: Fri, 6 Jan 2023 22:23:44 +0100
Subject: [PATCH 5/7] update md files
---
contrib/pp/en/pp-v0.epub | Bin 14943 -> 14943 bytes
contrib/pp/en/pp-v0.html | 2 +-
contrib/pp/en/pp-v0.md | 237 ++++++++++++++++++++++++++
contrib/pp/en/pp-v0.pdf | Bin 77785 -> 77874 bytes
contrib/tos/en/tos-v0.epub | Bin 24308 -> 24313 bytes
contrib/tos/en/tos-v0.html | 4 +-
contrib/tos/en/tos-v0.md | 337 +++++++++++++++++++++++++++++++++++++
contrib/tos/en/tos-v0.pdf | Bin 82064 -> 82566 bytes
8 files changed, 577 insertions(+), 3 deletions(-)
create mode 100644 contrib/pp/en/pp-v0.md
create mode 100644 contrib/tos/en/tos-v0.md
diff --git a/contrib/pp/en/pp-v0.epub b/contrib/pp/en/pp-v0.epub
index b564671b89da7ba8986ffee54c6e4f9d9e7fafcc..2827fcbeecceb32c276f822776adbd0393a4fe80 100644
GIT binary patch
delta 929
zcmca#a=&DQ93#iGO=@A6M2_v9tj4HbAL%#w&;}6^-ATS;jF0kmX=Y@l2v78ww&c%`
z-+dZC-dQ$Mu#>)IP8m%Vmb%6OHpj$Sx*^Um_hSv>0&nRo^pJrs@j
zw53cg%YELyiT>aF`MV#gUYvI4{@)6P=8B4+mJfd2(9KR4Q0kuR&gXR_^V_+u>H}Pt
z5~uJidQvrM+2Rt5dZ{J*cL`^gTj#!JGnr$S@YiZ_>xYDF^Hmprd+5C2o?!OIW}$iR
z`?^`u!n%{pSuB{9mh^bp)VdevOIJAG30YOziT%MQz6;o4?1(H+yaPvG7>du3cLfsMMGmSv|bW
z)uDH?e2?EPv-7*Q9shp8@b&%=KjQrSmo6SPXO()F_!NQaO!5GFC
e77&qq3sVSVg@rYQ@!aAogz>=A4#H5fvIPLrs=Da_
delta 929
zcmca#a=&DQ93w|_WNv6c%BzW!)fm<5Px?(hv_V8fcapCdC
z-g?QC@JA;7RjQNA&z%ViE>>HM_Z@^Sq^EHP=kMcIeAND+&_dV8U!?kd$gA4v$XAenQZ9X@5(KaC-sf>-1$3L08
zH%?sVb!3^f%@(06Q{Mi+ueIk3@09IfdOIT~N8k0>*jIn4E_wCp1Dx8u$Lmf#+^{I8
zzE)dIY{&I)4m%=mcW(Ie|-78p!t!!Nb6>S$hS5{0f+oHmxtYP
zmYk$sIq%8i-!}7~EUxz~`?uPDdTEhcJ_Y55!lY%V@CuT=c%n|814L)(s-A&EZs*SN2LvCQ*_R}$ZvOWp@($Hx2@
zdA3+yY+VZPIew4Me1m-)s$o-f3jDZVZS{D3Urg(y@P4y^3kEYe_~xaou3z%WIAqSF
zKLLm4E&Nf`eCT+|)(?)~lyq{wFIi~Hxvt$tnR%A+NwW`@8a7%HdzB9tChb!^7XJJG
zj*D#HZ&&gN<{X3f#_1;D{*|LU-y7v-w^yHt{
zRG!LQ`sxn5!*hSfWj_U;Kaxzh?Kl5czdF6ec%wO6aQYIarfu@a4kSEcIcu@~!J#wi
zQ@1G8{P|{j@6z5Z1A8%%)i)wK|0Y}C7858wcD%Cv`(1%%uMIyI9?SZ*YwH4)I#aHy
z^Xa?-v6J6d%xy92-&J;i|AMCUz7J311H748L>L$tI2b?)KlX`KtNVX2$VLds1i%?-iAlmEdO
g#ugS3k$ekN2xEnXHH7ip;wyylz|s!FP_nWG0KXEood5s;
diff --git a/contrib/pp/en/pp-v0.html b/contrib/pp/en/pp-v0.html
index e248db2e0..57b942607 100644
--- a/contrib/pp/en/pp-v0.html
+++ b/contrib/pp/en/pp-v0.html
@@ -202,4 +202,4 @@ privacy practices that are not addressed in this Privacy Statement.