gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[taler-exchange] branch master updated: fix matching


From: gnunet
Subject: [taler-exchange] branch master updated: fix matching
Date: Sun, 08 Dec 2019 23:04:45 +0100

This is an automated email from the git hooks/post-receive script.

grothoff pushed a commit to branch master
in repository exchange.

The following commit(s) were added to refs/heads/master by this push:
     new 496b9ba6 fix matching
496b9ba6 is described below

commit 496b9ba6a97ba03f2fa3ca1a8eebae270f008349
Author: Christian Grothoff <address@hidden>
AuthorDate: Sun Dec 8 23:04:41 2019 +0100

    fix matching
---
 src/exchange/taler-exchange-httpd_terms.c | 16 ++++++++++++----
 src/lib/test_exchange_api.conf            |  2 --
 2 files changed, 12 insertions(+), 6 deletions(-)

diff --git a/src/exchange/taler-exchange-httpd_terms.c 
b/src/exchange/taler-exchange-httpd_terms.c
index 499c09a5..b3d7c344 100644
--- a/src/exchange/taler-exchange-httpd_terms.c
+++ b/src/exchange/taler-exchange-httpd_terms.c
@@ -45,7 +45,7 @@ struct Terms
   /**
    * The desired language.
    */
-  const char *language;
+  char *language;
 
   /**
    * Number of bytes in @e terms.
@@ -215,13 +215,21 @@ TEH_handler_terms (struct TEH_RequestHandler *rh,
                           p->mime_type)) )
       {
         if ( (NULL == t) ||
+             (! mime_matches (mime,
+                              t->mime_type)) ||
              (language_matches (lang,
-                                p->mime_type) >
+                                p->language) >
               language_matches (lang,
-                                t->mime_type) ) )
+                                t->language) ) )
           t = p;
       }
     }
+    GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+                "Best match for %s/%s: %s / %s\n",
+                lang,
+                mime,
+                (NULL != t) ? t->mime_type : "<none>",
+                (NULL != t) ? t->language : "<none>");
   }
 
   if (NULL == t)
@@ -440,7 +448,7 @@ load_terms (const char *path,
         struct Terms t = {
           .mime_type = mime,
           .terms = buf,
-          .language = lang,
+          .language = GNUNET_strdup (lang),
           .terms_size = bsize
         };
 
diff --git a/src/lib/test_exchange_api.conf b/src/lib/test_exchange_api.conf
index 813202ae..ccb5a782 100644
--- a/src/lib/test_exchange_api.conf
+++ b/src/lib/test_exchange_api.conf
@@ -26,8 +26,6 @@ PORT = 8083
 
 
 [exchange]
-TERMS_ETAG = 0
-TERMS_DIR = /home/grothoff/share/taler-exchange/tos/
 # how long is one signkey valid?
 signkey_duration = 4 weeks
 

-- 
To stop receiving notification emails like this one, please contact
address@hidden.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]