LCOV - code coverage report
Current view: top level - backend - taler-merchant-httpd_config.c (source / functions) Hit Total Coverage
Test: GNU Taler merchant coverage report Lines: 4 4 100.0 %
Date: 2021-08-30 06:54:17 Functions: 1 1 100.0 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : /*
       2             :   This file is part of TALER
       3             :   (C) 2019, 2020, 2021 Taler Systems SA
       4             : 
       5             :   TALER is free software; you can redistribute it and/or modify it under the
       6             :   terms of the GNU Affero General Public License as published by the Free Software
       7             :   Foundation; either version 3, or (at your option) any later version.
       8             : 
       9             :   TALER is distributed in the hope that it will be useful, but WITHOUT ANY
      10             :   WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
      11             :   A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
      12             : 
      13             :   You should have received a copy of the GNU General Public License along with
      14             :   TALER; see the file COPYING.  If not, see <http://www.gnu.org/licenses/>
      15             : */
      16             : /**
      17             :  * @file taler-merchant-httpd_config.c
      18             :  * @brief implement API for querying configuration data of the backend
      19             :  * @author Florian Dold
      20             :  */
      21             : #include "platform.h"
      22             : #include <jansson.h>
      23             : #include <taler/taler_util.h>
      24             : #include <taler/taler_json_lib.h>
      25             : #include "taler-merchant-httpd.h"
      26             : #include "taler-merchant-httpd_mhd.h"
      27             : #include "taler-merchant-httpd_exchanges.h"
      28             : 
      29             : 
      30             : /**
      31             :  * Taler protocol version in the format CURRENT:REVISION:AGE
      32             :  * as used by GNU libtool.  See
      33             :  * https://www.gnu.org/software/libtool/manual/html_node/Libtool-versioning.html
      34             :  *
      35             :  * Please be very careful when updating and follow
      36             :  * https://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html#Updating-version-info
      37             :  * precisely.  Note that this version has NOTHING to do with the
      38             :  * release version, and the format is NOT the same that semantic
      39             :  * versioning uses either.
      40             :  *
      41             :  * When changing this version, you likely want to also update
      42             :  * #MERCHANT_PROTOCOL_CURRENT and #MERCHANT_PROTOCOL_AGE in
      43             :  * merchant_api_config.c!
      44             :  */
      45             : #define MERCHANT_PROTOCOL_VERSION "1:0:0"
      46             : 
      47             : MHD_RESULT
      48          16 : MH_handler_config (struct TMH_RequestHandler *rh,
      49             :                    struct MHD_Connection *connection,
      50             :                    struct TMH_HandlerContext *hc)
      51             : {
      52             :   static struct MHD_Response *response;
      53             : 
      54             :   (void) rh;
      55             :   (void) hc;
      56          16 :   if (NULL == response)
      57             :   {
      58          10 :     response = TALER_MHD_MAKE_JSON_PACK (
      59             :       GNUNET_JSON_pack_string ("currency",
      60             :                                TMH_currency),
      61             :       GNUNET_JSON_pack_string ("name",
      62             :                                "taler-merchant"),
      63             :       GNUNET_JSON_pack_string ("version",
      64             :                                MERCHANT_PROTOCOL_VERSION));
      65             :   }
      66          16 :   return MHD_queue_response (connection,
      67             :                              MHD_HTTP_OK,
      68             :                              response);
      69             : }
      70             : 
      71             : 
      72             : /* end of taler-merchant-httpd_config.c */

Generated by: LCOV version 1.14