summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVivien Kraus <vivien@planete-kraus.eu>2021-07-07 09:24:36 +0200
committerVivien Kraus <vivien@planete-kraus.eu>2021-07-08 16:53:14 +0200
commit2e8df3574c4f7b3cde2b77aa096f13ef2bdbfe3d (patch)
tree1d9a03784d33db583740c9a26ef7ac9be4c68e1a
parent67fc110e8c35e747768d88d12958badd444bcd20 (diff)
Start client requests in a new POSIX thread.
-rw-r--r--po/fr.po118
-rw-r--r--po/webid-oidc.pot118
-rw-r--r--src/scm/webid-oidc/program.scm133
3 files changed, 203 insertions, 166 deletions
diff --git a/po/fr.po b/po/fr.po
index aa86dfe..95398ec 100644
--- a/po/fr.po
+++ b/po/fr.po
@@ -2,7 +2,7 @@ msgid ""
msgstr ""
"Project-Id-Version: webid-oidc 0.0.0\n"
"Report-Msgid-Bugs-To: vivien@planete-kraus.eu\n"
-"POT-Creation-Date: 2021-07-06 13:24+0200\n"
+"POT-Creation-Date: 2021-07-08 00:38+0200\n"
"PO-Revision-Date: 2021-07-06 13:25+0200\n"
"Last-Translator: Vivien Kraus <vivien@planete-kraus.eu>\n"
"Language-Team: French <vivien@planete-kraus.eu>\n"
@@ -993,15 +993,15 @@ msgid "Warning: ~a\n"
msgstr "Avertissement : ~a\n"
#: src/scm/webid-oidc/hello-world.scm:48 src/scm/webid-oidc/example-app.scm:116
-#: src/scm/webid-oidc/program.scm:163
+#: src/scm/webid-oidc/program.scm:226
msgid "command-line|version"
msgstr "version"
-#: src/scm/webid-oidc/hello-world.scm:50 src/scm/webid-oidc/program.scm:165
+#: src/scm/webid-oidc/hello-world.scm:50 src/scm/webid-oidc/program.scm:228
msgid "command-line|complete-corresponding-source"
msgstr "code-source-correspondant-complet"
-#: src/scm/webid-oidc/hello-world.scm:52 src/scm/webid-oidc/program.scm:167
+#: src/scm/webid-oidc/hello-world.scm:52 src/scm/webid-oidc/program.scm:230
msgid "command-line|help"
msgstr "aide"
@@ -1009,11 +1009,11 @@ msgstr "aide"
msgid "command-line|port"
msgstr "port"
-#: src/scm/webid-oidc/hello-world.scm:56 src/scm/webid-oidc/program.scm:197
+#: src/scm/webid-oidc/hello-world.scm:56 src/scm/webid-oidc/program.scm:260
msgid "command-line|log-file"
msgstr "fichier-journal"
-#: src/scm/webid-oidc/hello-world.scm:58 src/scm/webid-oidc/program.scm:199
+#: src/scm/webid-oidc/hello-world.scm:58 src/scm/webid-oidc/program.scm:262
msgid "command-line|error-file"
msgstr "fichier-erreur"
@@ -1072,12 +1072,12 @@ msgstr ""
" redirige la sortie d’erreur du programme vers ce fichier.\n"
#: src/scm/webid-oidc/hello-world.scm:103
-#: src/scm/webid-oidc/example-app.scm:159 src/scm/webid-oidc/program.scm:453
+#: src/scm/webid-oidc/example-app.scm:159 src/scm/webid-oidc/program.scm:516
#, scheme-format
msgid "~a version ~a\n"
msgstr "~a version ~a\n"
-#: src/scm/webid-oidc/hello-world.scm:112 src/scm/webid-oidc/program.scm:461
+#: src/scm/webid-oidc/hello-world.scm:112 src/scm/webid-oidc/program.scm:524
msgid ""
"You are legally required to link to the complete corresponding source code.\n"
msgstr ""
@@ -1239,12 +1239,12 @@ msgstr ""
msgid "There was an error: ~a\n"
msgstr "Il y a eu une erreur : ~a\n"
-#: src/scm/webid-oidc/program.scm:88
+#: src/scm/webid-oidc/program.scm:122
#, scheme-format
msgid "~a: ~a: Internal server error: ~a\n"
msgstr "~a : ~a : Erreur interne du serveur : ~a\n"
-#: src/scm/webid-oidc/program.scm:101
+#: src/scm/webid-oidc/program.scm:136
#, scheme-format
msgid ""
"The client locale ~s can’t be approximated by system locale ~s (because ~a), "
@@ -1253,83 +1253,83 @@ msgstr ""
"La locale du client ~s ne peut pas être approchée par la locale système ~s "
"(parce que ~a), on utilise C.\n"
-#: src/scm/webid-oidc/program.scm:124
+#: src/scm/webid-oidc/program.scm:160
#, scheme-format
msgid "~a: ~s ~a ~s ~a\n"
msgstr "~a : ~s ~a ~s ~a\n"
-#: src/scm/webid-oidc/program.scm:126
+#: src/scm/webid-oidc/program.scm:162
#, scheme-format
msgid "~a: ~a (~a)"
msgstr "~a : ~a (~a)"
-#: src/scm/webid-oidc/program.scm:130
+#: src/scm/webid-oidc/program.scm:166
#, scheme-format
msgid "~a: ~a"
msgstr "~a : ~a"
-#: src/scm/webid-oidc/program.scm:140
+#: src/scm/webid-oidc/program.scm:176
#, scheme-format
msgid "(there was an error: ~a)"
msgstr "(il y a eu une erreur : ~a)"
-#: src/scm/webid-oidc/program.scm:169
+#: src/scm/webid-oidc/program.scm:232
msgid "command-line|server|port"
msgstr "port"
-#: src/scm/webid-oidc/program.scm:171
+#: src/scm/webid-oidc/program.scm:234
msgid "command-line|server|server-name"
msgstr "nom-du-serveur"
-#: src/scm/webid-oidc/program.scm:173
+#: src/scm/webid-oidc/program.scm:236
msgid "command-line|server|reverse-proxy|backend-uri"
msgstr "uri-arrière-plan"
-#: src/scm/webid-oidc/program.scm:175
+#: src/scm/webid-oidc/program.scm:238
msgid "command-line|server|reverse-proxy|header"
msgstr "en-tête"
-#: src/scm/webid-oidc/program.scm:177
+#: src/scm/webid-oidc/program.scm:240
msgid "command-line|server|issuer|key-file"
msgstr "fichier-clé"
-#: src/scm/webid-oidc/program.scm:179
+#: src/scm/webid-oidc/program.scm:242
msgid "command-line|server|issuer|subject"
msgstr "sujet"
-#: src/scm/webid-oidc/program.scm:181
+#: src/scm/webid-oidc/program.scm:244
msgid "command-line|server|issuer|encrypted-password"
msgstr "mot-de-passe-chiffré"
-#: src/scm/webid-oidc/program.scm:183
+#: src/scm/webid-oidc/program.scm:246
msgid "command-line|server|issuer|jwks-uri"
msgstr "uri-jwks"
-#: src/scm/webid-oidc/program.scm:185
+#: src/scm/webid-oidc/program.scm:248
msgid "command-line|server|issuer|authorization-endpoint-uri"
msgstr "uri-terminal-autorisation"
-#: src/scm/webid-oidc/program.scm:187
+#: src/scm/webid-oidc/program.scm:250
msgid "command-line|server|issuer|token-endpoint-uri"
msgstr "uri-terminal-jeton"
-#: src/scm/webid-oidc/program.scm:189
+#: src/scm/webid-oidc/program.scm:252
msgid "command-line|server|client-id"
msgstr "id-client"
-#: src/scm/webid-oidc/program.scm:191
+#: src/scm/webid-oidc/program.scm:254
msgid "command-line|server|redirect-uri"
msgstr "uri-redirection"
-#: src/scm/webid-oidc/program.scm:193
+#: src/scm/webid-oidc/program.scm:256
msgid "command-line|server|client-name"
msgstr "nom-client"
-#: src/scm/webid-oidc/program.scm:195
+#: src/scm/webid-oidc/program.scm:258
msgid "command-line|server|client-uri"
msgstr "uri-client"
-#: src/scm/webid-oidc/program.scm:224
+#: src/scm/webid-oidc/program.scm:287
#, scheme-format
msgid ""
"Usage: ~a COMMAND [OPTIONS]...\n"
@@ -1641,57 +1641,57 @@ msgstr ""
"Si vous trouvez une erreur dans le programme, envoyez-en un rapport à\n"
"~a.\n"
-#: src/scm/webid-oidc/program.scm:374 src/scm/webid-oidc/program.scm:432
-#: src/scm/webid-oidc/program.scm:535
+#: src/scm/webid-oidc/program.scm:437 src/scm/webid-oidc/program.scm:495
+#: src/scm/webid-oidc/program.scm:597
msgid "command-line|command|reverse-proxy"
msgstr "proxy-inversé"
-#: src/scm/webid-oidc/program.scm:375 src/scm/webid-oidc/program.scm:439
-#: src/scm/webid-oidc/program.scm:557
+#: src/scm/webid-oidc/program.scm:438 src/scm/webid-oidc/program.scm:502
+#: src/scm/webid-oidc/program.scm:621
msgid "command-line|command|identity-provider"
msgstr "fournisseur-identité"
-#: src/scm/webid-oidc/program.scm:376 src/scm/webid-oidc/program.scm:446
-#: src/scm/webid-oidc/program.scm:601
+#: src/scm/webid-oidc/program.scm:439 src/scm/webid-oidc/program.scm:509
+#: src/scm/webid-oidc/program.scm:667
msgid "command-line|command|client-service"
msgstr "service-client"
-#: src/scm/webid-oidc/program.scm:377 src/scm/webid-oidc/program.scm:630
+#: src/scm/webid-oidc/program.scm:440 src/scm/webid-oidc/program.scm:696
msgid "command-line|command|server"
msgstr "serveur"
-#: src/scm/webid-oidc/program.scm:413 src/scm/webid-oidc/program.scm:417
-#: src/scm/webid-oidc/program.scm:421 src/scm/webid-oidc/program.scm:425
+#: src/scm/webid-oidc/program.scm:476 src/scm/webid-oidc/program.scm:480
+#: src/scm/webid-oidc/program.scm:484 src/scm/webid-oidc/program.scm:488
#, scheme-format
msgid "an environment variable| It is currently set to ~s."
msgstr " Elle vaut actuellement ~s."
-#: src/scm/webid-oidc/program.scm:415 src/scm/webid-oidc/program.scm:419
-#: src/scm/webid-oidc/program.scm:423 src/scm/webid-oidc/program.scm:427
+#: src/scm/webid-oidc/program.scm:478 src/scm/webid-oidc/program.scm:482
+#: src/scm/webid-oidc/program.scm:486 src/scm/webid-oidc/program.scm:490
msgid "an environment variable| It is currently unset."
msgstr " Elle n’est actuellement pas définie."
-#: src/scm/webid-oidc/program.scm:468
+#: src/scm/webid-oidc/program.scm:531
#, scheme-format
msgid "The --~a argument must be a number, not ~s.\n"
msgstr "L’argument de --~a doit être un nombre, pas ~s.\n"
-#: src/scm/webid-oidc/program.scm:474
+#: src/scm/webid-oidc/program.scm:537
#, scheme-format
msgid "The --~a argument must be an integer, not ~s.\n"
msgstr "L’argument de --~a doit être un entier, pas ~s.\n"
-#: src/scm/webid-oidc/program.scm:480
+#: src/scm/webid-oidc/program.scm:543
#, scheme-format
msgid "The --~a argument must be positive, ~s is invalid.\n"
msgstr "L’argument de --~a doit être positif, ~s est invalide.\n"
-#: src/scm/webid-oidc/program.scm:485
+#: src/scm/webid-oidc/program.scm:548
#, scheme-format
msgid "The --~a argument must be less than 65536, ~s is invalid.\n"
msgstr "L’argument de --~a doit être inférieur à 65536, ~s est invalide.\n"
-#: src/scm/webid-oidc/program.scm:527
+#: src/scm/webid-oidc/program.scm:590
#, scheme-format
msgid ""
"Usage: ~a COMMAND [OPTIONS]...\n"
@@ -1700,18 +1700,18 @@ msgstr ""
"Utilisation : ~a COMMANDE [OPTIONS]...\n"
"Voir --~a (-h).\n"
-#: src/scm/webid-oidc/program.scm:538 src/scm/webid-oidc/program.scm:560
-#: src/scm/webid-oidc/program.scm:632
+#: src/scm/webid-oidc/program.scm:600 src/scm/webid-oidc/program.scm:624
+#: src/scm/webid-oidc/program.scm:698
#, scheme-format
msgid "You must pass --~a to set the server name.\n"
msgstr "Vous devez passer --~a pour définir le nom du serveur.\n"
-#: src/scm/webid-oidc/program.scm:542
+#: src/scm/webid-oidc/program.scm:604
#, scheme-format
msgid "You must pass --~a to set the backend URI.\n"
msgstr "Vous devez passer --~a pour définir l'URI du service d’arrière-plan.\n"
-#: src/scm/webid-oidc/program.scm:564 src/scm/webid-oidc/program.scm:636
+#: src/scm/webid-oidc/program.scm:628 src/scm/webid-oidc/program.scm:702
#, scheme-format
msgid ""
"You must pass --~a to set the file where to store the identity provider "
@@ -1720,59 +1720,59 @@ msgstr ""
"Vous devez passer --~a pour définir le nom du fichier pour sauvegarder\n"
"la clé du fournisseur d’identité.\n"
-#: src/scm/webid-oidc/program.scm:568 src/scm/webid-oidc/program.scm:640
+#: src/scm/webid-oidc/program.scm:632 src/scm/webid-oidc/program.scm:706
#, scheme-format
msgid "You must pass --~a to set the subject of the identity provider.\n"
msgstr ""
"Vous devez passer --~a pour définir le sujet du fournisseur d’identité.\n"
-#: src/scm/webid-oidc/program.scm:572 src/scm/webid-oidc/program.scm:644
+#: src/scm/webid-oidc/program.scm:636 src/scm/webid-oidc/program.scm:710
#, scheme-format
msgid "You must pass --~a to set the subject’s encrypted password.\n"
msgstr ""
"Vous devez passer --~a pour définir le mot de passe chiffré du sujet.\n"
-#: src/scm/webid-oidc/program.scm:576 src/scm/webid-oidc/program.scm:648
+#: src/scm/webid-oidc/program.scm:640 src/scm/webid-oidc/program.scm:714
#, scheme-format
msgid "You must pass --~a to set the JWKS URI.\n"
msgstr "Vous devez passer --~a pour définir l'URI du JWKS.\n"
-#: src/scm/webid-oidc/program.scm:580 src/scm/webid-oidc/program.scm:652
+#: src/scm/webid-oidc/program.scm:644 src/scm/webid-oidc/program.scm:718
#, scheme-format
msgid "You must pass --~a to set the authorization endpoint URI.\n"
msgstr ""
"Vous devez passer --~a pour définir l'URI du terminal d'autorisation.\n"
-#: src/scm/webid-oidc/program.scm:584 src/scm/webid-oidc/program.scm:656
+#: src/scm/webid-oidc/program.scm:648 src/scm/webid-oidc/program.scm:722
#, scheme-format
msgid "You must pass --~a to set the token endpoint URI.\n"
msgstr "Vous devez passer --~a pour définir l'URI du terminal de jeton.\n"
-#: src/scm/webid-oidc/program.scm:604
+#: src/scm/webid-oidc/program.scm:670
#, scheme-format
msgid "You must pass --~a to set the application web ID.\n"
msgstr ""
"Vous devez passer --~a pour définir l'identifiant web de l’application.\n"
-#: src/scm/webid-oidc/program.scm:608
+#: src/scm/webid-oidc/program.scm:674
#, scheme-format
msgid "You must pass --~a to set the redirection URI.\n"
msgstr "Vous devez passer --~a pour définir l'URI de redirection.\n"
-#: src/scm/webid-oidc/program.scm:612
+#: src/scm/webid-oidc/program.scm:678
#, scheme-format
msgid "You must pass --~a to set the informative client name.\n"
msgstr ""
"Vous devez passer --~a pour donner un nom pour l’application à titre "
"informatif.\n"
-#: src/scm/webid-oidc/program.scm:616
+#: src/scm/webid-oidc/program.scm:682
#, scheme-format
msgid "You must pass --~a to set the informative client URI.\n"
msgstr ""
"Vous devez passer --~a pour définir l'URI du client, à titre informatif.\n"
-#: src/scm/webid-oidc/program.scm:703
+#: src/scm/webid-oidc/program.scm:773
#, scheme-format
msgid "Unknown command ~s\n"
msgstr "Commande inconnue ~s\n"
diff --git a/po/webid-oidc.pot b/po/webid-oidc.pot
index 992caa2..ad294e9 100644
--- a/po/webid-oidc.pot
+++ b/po/webid-oidc.pot
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: webid-oidc SNAPSHOT\n"
"Report-Msgid-Bugs-To: vivien@planete-kraus.eu\n"
-"POT-Creation-Date: 2021-07-06 13:24+0200\n"
+"POT-Creation-Date: 2021-07-08 00:38+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@@ -950,15 +950,15 @@ msgid "Warning: ~a\n"
msgstr ""
#: src/scm/webid-oidc/hello-world.scm:48 src/scm/webid-oidc/example-app.scm:116
-#: src/scm/webid-oidc/program.scm:163
+#: src/scm/webid-oidc/program.scm:226
msgid "command-line|version"
msgstr ""
-#: src/scm/webid-oidc/hello-world.scm:50 src/scm/webid-oidc/program.scm:165
+#: src/scm/webid-oidc/hello-world.scm:50 src/scm/webid-oidc/program.scm:228
msgid "command-line|complete-corresponding-source"
msgstr ""
-#: src/scm/webid-oidc/hello-world.scm:52 src/scm/webid-oidc/program.scm:167
+#: src/scm/webid-oidc/hello-world.scm:52 src/scm/webid-oidc/program.scm:230
msgid "command-line|help"
msgstr ""
@@ -966,11 +966,11 @@ msgstr ""
msgid "command-line|port"
msgstr ""
-#: src/scm/webid-oidc/hello-world.scm:56 src/scm/webid-oidc/program.scm:197
+#: src/scm/webid-oidc/hello-world.scm:56 src/scm/webid-oidc/program.scm:260
msgid "command-line|log-file"
msgstr ""
-#: src/scm/webid-oidc/hello-world.scm:58 src/scm/webid-oidc/program.scm:199
+#: src/scm/webid-oidc/hello-world.scm:58 src/scm/webid-oidc/program.scm:262
msgid "command-line|error-file"
msgstr ""
@@ -1004,12 +1004,12 @@ msgid ""
msgstr ""
#: src/scm/webid-oidc/hello-world.scm:103
-#: src/scm/webid-oidc/example-app.scm:159 src/scm/webid-oidc/program.scm:453
+#: src/scm/webid-oidc/example-app.scm:159 src/scm/webid-oidc/program.scm:516
#, scheme-format
msgid "~a version ~a\n"
msgstr ""
-#: src/scm/webid-oidc/hello-world.scm:112 src/scm/webid-oidc/program.scm:461
+#: src/scm/webid-oidc/hello-world.scm:112 src/scm/webid-oidc/program.scm:524
msgid ""
"You are legally required to link to the complete corresponding source code.\n"
msgstr ""
@@ -1128,95 +1128,95 @@ msgstr ""
msgid "There was an error: ~a\n"
msgstr ""
-#: src/scm/webid-oidc/program.scm:88
+#: src/scm/webid-oidc/program.scm:122
#, scheme-format
msgid "~a: ~a: Internal server error: ~a\n"
msgstr ""
-#: src/scm/webid-oidc/program.scm:101
+#: src/scm/webid-oidc/program.scm:136
#, scheme-format
msgid ""
"The client locale ~s can’t be approximated by system locale ~s (because ~a), "
"using C.\n"
msgstr ""
-#: src/scm/webid-oidc/program.scm:124
+#: src/scm/webid-oidc/program.scm:160
#, scheme-format
msgid "~a: ~s ~a ~s ~a\n"
msgstr ""
-#: src/scm/webid-oidc/program.scm:126
+#: src/scm/webid-oidc/program.scm:162
#, scheme-format
msgid "~a: ~a (~a)"
msgstr ""
-#: src/scm/webid-oidc/program.scm:130
+#: src/scm/webid-oidc/program.scm:166
#, scheme-format
msgid "~a: ~a"
msgstr ""
-#: src/scm/webid-oidc/program.scm:140
+#: src/scm/webid-oidc/program.scm:176
#, scheme-format
msgid "(there was an error: ~a)"
msgstr ""
-#: src/scm/webid-oidc/program.scm:169
+#: src/scm/webid-oidc/program.scm:232
msgid "command-line|server|port"
msgstr ""
-#: src/scm/webid-oidc/program.scm:171
+#: src/scm/webid-oidc/program.scm:234
msgid "command-line|server|server-name"
msgstr ""
-#: src/scm/webid-oidc/program.scm:173
+#: src/scm/webid-oidc/program.scm:236
msgid "command-line|server|reverse-proxy|backend-uri"
msgstr ""
-#: src/scm/webid-oidc/program.scm:175
+#: src/scm/webid-oidc/program.scm:238
msgid "command-line|server|reverse-proxy|header"
msgstr ""
-#: src/scm/webid-oidc/program.scm:177
+#: src/scm/webid-oidc/program.scm:240
msgid "command-line|server|issuer|key-file"
msgstr ""
-#: src/scm/webid-oidc/program.scm:179
+#: src/scm/webid-oidc/program.scm:242
msgid "command-line|server|issuer|subject"
msgstr ""
-#: src/scm/webid-oidc/program.scm:181
+#: src/scm/webid-oidc/program.scm:244
msgid "command-line|server|issuer|encrypted-password"
msgstr ""
-#: src/scm/webid-oidc/program.scm:183
+#: src/scm/webid-oidc/program.scm:246
msgid "command-line|server|issuer|jwks-uri"
msgstr ""
-#: src/scm/webid-oidc/program.scm:185
+#: src/scm/webid-oidc/program.scm:248
msgid "command-line|server|issuer|authorization-endpoint-uri"
msgstr ""
-#: src/scm/webid-oidc/program.scm:187
+#: src/scm/webid-oidc/program.scm:250
msgid "command-line|server|issuer|token-endpoint-uri"
msgstr ""
-#: src/scm/webid-oidc/program.scm:189
+#: src/scm/webid-oidc/program.scm:252
msgid "command-line|server|client-id"
msgstr ""
-#: src/scm/webid-oidc/program.scm:191
+#: src/scm/webid-oidc/program.scm:254
msgid "command-line|server|redirect-uri"
msgstr ""
-#: src/scm/webid-oidc/program.scm:193
+#: src/scm/webid-oidc/program.scm:256
msgid "command-line|server|client-name"
msgstr ""
-#: src/scm/webid-oidc/program.scm:195
+#: src/scm/webid-oidc/program.scm:258
msgid "command-line|server|client-uri"
msgstr ""
-#: src/scm/webid-oidc/program.scm:224
+#: src/scm/webid-oidc/program.scm:287
#, scheme-format
msgid ""
"Usage: ~a COMMAND [OPTIONS]...\n"
@@ -1371,127 +1371,127 @@ msgid ""
"If you find a bug, then please send a report to ~a.\n"
msgstr ""
-#: src/scm/webid-oidc/program.scm:374 src/scm/webid-oidc/program.scm:432
-#: src/scm/webid-oidc/program.scm:535
+#: src/scm/webid-oidc/program.scm:437 src/scm/webid-oidc/program.scm:495
+#: src/scm/webid-oidc/program.scm:597
msgid "command-line|command|reverse-proxy"
msgstr ""
-#: src/scm/webid-oidc/program.scm:375 src/scm/webid-oidc/program.scm:439
-#: src/scm/webid-oidc/program.scm:557
+#: src/scm/webid-oidc/program.scm:438 src/scm/webid-oidc/program.scm:502
+#: src/scm/webid-oidc/program.scm:621
msgid "command-line|command|identity-provider"
msgstr ""
-#: src/scm/webid-oidc/program.scm:376 src/scm/webid-oidc/program.scm:446
-#: src/scm/webid-oidc/program.scm:601
+#: src/scm/webid-oidc/program.scm:439 src/scm/webid-oidc/program.scm:509
+#: src/scm/webid-oidc/program.scm:667
msgid "command-line|command|client-service"
msgstr ""
-#: src/scm/webid-oidc/program.scm:377 src/scm/webid-oidc/program.scm:630
+#: src/scm/webid-oidc/program.scm:440 src/scm/webid-oidc/program.scm:696
msgid "command-line|command|server"
msgstr ""
-#: src/scm/webid-oidc/program.scm:413 src/scm/webid-oidc/program.scm:417
-#: src/scm/webid-oidc/program.scm:421 src/scm/webid-oidc/program.scm:425
+#: src/scm/webid-oidc/program.scm:476 src/scm/webid-oidc/program.scm:480
+#: src/scm/webid-oidc/program.scm:484 src/scm/webid-oidc/program.scm:488
#, scheme-format
msgid "an environment variable| It is currently set to ~s."
msgstr ""
-#: src/scm/webid-oidc/program.scm:415 src/scm/webid-oidc/program.scm:419
-#: src/scm/webid-oidc/program.scm:423 src/scm/webid-oidc/program.scm:427
+#: src/scm/webid-oidc/program.scm:478 src/scm/webid-oidc/program.scm:482
+#: src/scm/webid-oidc/program.scm:486 src/scm/webid-oidc/program.scm:490
msgid "an environment variable| It is currently unset."
msgstr ""
-#: src/scm/webid-oidc/program.scm:468
+#: src/scm/webid-oidc/program.scm:531
#, scheme-format
msgid "The --~a argument must be a number, not ~s.\n"
msgstr ""
-#: src/scm/webid-oidc/program.scm:474
+#: src/scm/webid-oidc/program.scm:537
#, scheme-format
msgid "The --~a argument must be an integer, not ~s.\n"
msgstr ""
-#: src/scm/webid-oidc/program.scm:480
+#: src/scm/webid-oidc/program.scm:543
#, scheme-format
msgid "The --~a argument must be positive, ~s is invalid.\n"
msgstr ""
-#: src/scm/webid-oidc/program.scm:485
+#: src/scm/webid-oidc/program.scm:548
#, scheme-format
msgid "The --~a argument must be less than 65536, ~s is invalid.\n"
msgstr ""
-#: src/scm/webid-oidc/program.scm:527
+#: src/scm/webid-oidc/program.scm:590
#, scheme-format
msgid ""
"Usage: ~a COMMAND [OPTIONS]...\n"
"See --~a (-h).\n"
msgstr ""
-#: src/scm/webid-oidc/program.scm:538 src/scm/webid-oidc/program.scm:560
-#: src/scm/webid-oidc/program.scm:632
+#: src/scm/webid-oidc/program.scm:600 src/scm/webid-oidc/program.scm:624
+#: src/scm/webid-oidc/program.scm:698
#, scheme-format
msgid "You must pass --~a to set the server name.\n"
msgstr ""
-#: src/scm/webid-oidc/program.scm:542
+#: src/scm/webid-oidc/program.scm:604
#, scheme-format
msgid "You must pass --~a to set the backend URI.\n"
msgstr ""
-#: src/scm/webid-oidc/program.scm:564 src/scm/webid-oidc/program.scm:636
+#: src/scm/webid-oidc/program.scm:628 src/scm/webid-oidc/program.scm:702
#, scheme-format
msgid ""
"You must pass --~a to set the file where to store the identity provider "
"key.\n"
msgstr ""
-#: src/scm/webid-oidc/program.scm:568 src/scm/webid-oidc/program.scm:640
+#: src/scm/webid-oidc/program.scm:632 src/scm/webid-oidc/program.scm:706
#, scheme-format
msgid "You must pass --~a to set the subject of the identity provider.\n"
msgstr ""
-#: src/scm/webid-oidc/program.scm:572 src/scm/webid-oidc/program.scm:644
+#: src/scm/webid-oidc/program.scm:636 src/scm/webid-oidc/program.scm:710
#, scheme-format
msgid "You must pass --~a to set the subject’s encrypted password.\n"
msgstr ""
-#: src/scm/webid-oidc/program.scm:576 src/scm/webid-oidc/program.scm:648
+#: src/scm/webid-oidc/program.scm:640 src/scm/webid-oidc/program.scm:714
#, scheme-format
msgid "You must pass --~a to set the JWKS URI.\n"
msgstr ""
-#: src/scm/webid-oidc/program.scm:580 src/scm/webid-oidc/program.scm:652
+#: src/scm/webid-oidc/program.scm:644 src/scm/webid-oidc/program.scm:718
#, scheme-format
msgid "You must pass --~a to set the authorization endpoint URI.\n"
msgstr ""
-#: src/scm/webid-oidc/program.scm:584 src/scm/webid-oidc/program.scm:656
+#: src/scm/webid-oidc/program.scm:648 src/scm/webid-oidc/program.scm:722
#, scheme-format
msgid "You must pass --~a to set the token endpoint URI.\n"
msgstr ""
-#: src/scm/webid-oidc/program.scm:604
+#: src/scm/webid-oidc/program.scm:670
#, scheme-format
msgid "You must pass --~a to set the application web ID.\n"
msgstr ""
-#: src/scm/webid-oidc/program.scm:608
+#: src/scm/webid-oidc/program.scm:674
#, scheme-format
msgid "You must pass --~a to set the redirection URI.\n"
msgstr ""
-#: src/scm/webid-oidc/program.scm:612
+#: src/scm/webid-oidc/program.scm:678
#, scheme-format
msgid "You must pass --~a to set the informative client name.\n"
msgstr ""
-#: src/scm/webid-oidc/program.scm:616
+#: src/scm/webid-oidc/program.scm:682
#, scheme-format
msgid "You must pass --~a to set the informative client URI.\n"
msgstr ""
-#: src/scm/webid-oidc/program.scm:703
+#: src/scm/webid-oidc/program.scm:773
#, scheme-format
msgid "Unknown command ~s\n"
msgstr ""
diff --git a/src/scm/webid-oidc/program.scm b/src/scm/webid-oidc/program.scm
index be72f75..069c5e8 100644
--- a/src/scm/webid-oidc/program.scm
+++ b/src/scm/webid-oidc/program.scm
@@ -29,8 +29,9 @@
#:use-module (ice-9 receive)
#:use-module (ice-9 i18n)
#:use-module (ice-9 getopt-long)
- #:use-module (ice-9 suspendable-ports)
#:use-module (ice-9 control)
+ #:use-module (ice-9 threads)
+ #:use-module (ice-9 futures)
#:use-module (srfi srfi-19)
#:use-module (rnrs bytevectors)
#:use-module (web uri)
@@ -47,24 +48,30 @@
(car (reverse (string-split text #\|)))
out)))
+(define logging-mutex (make-mutex))
+
(define* (http-get-with-log uri #:key (headers '()))
(define date (date->string (time-utc->date (current-time))))
(define uri-string (if (uri? uri) (uri->string uri) uri))
- (format (current-error-port) "~a: GET ~a ~s...\n"
- date uri-string headers)
- (receive (response response-body) (http-get uri #:headers headers)
- (format (current-error-port) "~a: GET ~a ~s: ~s ~a bytes\n"
- date uri-string headers response
- (cond
- ((bytevector? response-body)
- (bytevector-length response-body))
- ((string? response-body)
- (string-length response-body))
- (else 0)))
+ (with-mutex logging-mutex
+ (format (current-error-port) "~a: GET ~a ~s...\n"
+ date uri-string headers))
+ (receive (response response-body)
+ (http-get uri #:headers headers)
+ (with-mutex logging-mutex
+ (format (current-error-port) "~a: GET ~a ~s: ~s ~a bytes\n"
+ date uri-string headers response
+ (cond
+ ((bytevector? response-body)
+ (bytevector-length response-body))
+ ((string? response-body)
+ (string-length response-body))
+ (else 0))))
(values response response-body)))
(define cache-http-get
- (with-cache #:http-get http-get-with-log))
+ (with-cache
+ #:http-get http-get-with-log))
(define (request-ip-address request)
;; The IP address of the remote end
@@ -84,11 +91,12 @@
(lambda (return)
(with-exception-handler
(lambda (error)
- (format (current-error-port)
- (G_ "~a: ~a: Internal server error: ~a\n")
- (date->string (time-utc->date (current-time)))
- (request-ip-address request)
- (error->str error))
+ (with-mutex logging-mutex
+ (format (current-error-port)
+ (G_ "~a: ~a: Internal server error: ~a\n")
+ (date->string (time-utc->date (current-time)))
+ (request-ip-address request)
+ (error->str error)))
(return
(build-response #:code 500
#:reason-phrase "Internal Server Error"
@@ -97,11 +105,12 @@
(lambda ()
(with-exception-handler
(lambda (error)
- (format (current-error-port)
- (G_ "The client locale ~s can’t be approximated by system locale ~s (because ~a), using C.\n")
- ((record-accessor &unknown-client-locale 'web-locale) error)
- ((record-accessor &unknown-client-locale 'c-locale) error)
- (error->str error)))
+ (with-mutex logging-mutex
+ (format (current-error-port)
+ (G_ "The client locale ~s can’t be approximated by system locale ~s (because ~a), using C.\n")
+ ((record-accessor &unknown-client-locale 'web-locale) error)
+ ((record-accessor &unknown-client-locale 'c-locale) error)
+ (error->str error))))
(lambda ()
(receive (response response-body user cause)
(call-with-values
@@ -120,26 +129,27 @@
;; That’s an error
(current-error-port)
(current-output-port)))))
- (format logging-port
- (G_ "~a: ~s ~a ~s ~a\n")
- (if user
- (format #f (G_ "~a: ~a (~a)")
- (date->string (time-utc->date (current-time)))
- (uri->string user)
- (request-ip-address request))
- (format #f (G_ "~a: ~a")
- (date->string (time-utc->date (current-time)))
- (request-ip-address request)))
- (request-method request)
- (uri-path (request-uri request))
- (response-code response)
- (if cause
- (string-append
- (response-reason-phrase response)
- " "
- (format #f (G_ "(there was an error: ~a)")
- (error->str cause)))
- (response-reason-phrase response))))
+ (with-mutex logging-mutex
+ (format logging-port
+ (G_ "~a: ~s ~a ~s ~a\n")
+ (if user
+ (format #f (G_ "~a: ~a (~a)")
+ (date->string (time-utc->date (current-time)))
+ (uri->string user)
+ (request-ip-address request))
+ (format #f (G_ "~a: ~a")
+ (date->string (time-utc->date (current-time)))
+ (request-ip-address request)))
+ (request-method request)
+ (uri-path (request-uri request))
+ (response-code response)
+ (if cause
+ (string-append
+ (response-reason-phrase response)
+ " "
+ (format #f (G_ "(there was an error: ~a)")
+ (error->str cause)))
+ (response-reason-phrase response)))))
(return
(build-response
#:version (response-version response)
@@ -153,6 +163,34 @@
#:unwind? #t
#:unwind-for-type &unknown-client-locale)))))))
+(define (serve-one-client* handler implementation server state)
+ ;; Same as serve-one-client, except it is served in a promise.
+ (call-with-values
+ (lambda ()
+ (read-client implementation server))
+ (lambda (client request body)
+ (future
+ (if client
+ (receive (response body state)
+ (handle-request handler request body state)
+ (write-client implementation server client response body)
+ state)
+ state)))))
+
+(define* (run-server*
+ handler
+ #:optional
+ (implementation 'http)
+ (open-params '())
+ . state)
+ ;; Same as the traditional run-server, but the requests are handled
+ ;; in a future and the state is discarded.
+ (let* ((implementation (lookup-server-impl implementation))
+ (server (open-server implementation open-params)))
+ (let lp ()
+ (serve-one-client* handler implementation server state)
+ (lp))))
+
(define-public (main)
(setvbuf (current-output-port) 'none)
(setvbuf (current-error-port) 'none)
@@ -528,7 +566,6 @@ If you find a bug, then please send a report to ~a.
(car (command-line))
help-sym)
(exit 1))
- (install-suspendable-ports!)
(let ((command (car rest))
(non-options (cdr rest)))
(cond
@@ -542,7 +579,7 @@ If you find a bug, then please send a report to ~a.
(format (current-error-port) (G_ "You must pass --~a to set the backend URI.\n")
backend-uri-sym)
(exit 1))
- (run-server
+ (run-server*
(handler-with-log
(option-ref options log-file-sym #f)
(option-ref options error-file-sym #f)
@@ -591,7 +628,7 @@ If you find a bug, then please send a report to ~a.
(make-jti-list)
#:current-time current-time
#:http-get cache-http-get)))
- (run-server
+ (run-server*
(handler-with-log
(option-ref options log-file-sym #f)
(option-ref options error-file-sym #f)
@@ -620,7 +657,7 @@ If you find a bug, then please send a report to ~a.
(serve-application client-id redirect-uri
#:client-name client-name
#:client-uri client-uri)))
- (run-server
+ (run-server*
(handler-with-log
(option-ref options log-file-sym #f)
(option-ref options error-file-sym #f)
@@ -684,7 +721,7 @@ If you find a bug, then please send a report to ~a.
#:current-time current-time
#:http-get cache-http-get)))
(create-root server-name subject)
- (run-server
+ (run-server*
(handler-with-log
(option-ref options log-file-sym #f)
(option-ref options error-file-sym #f)