LCOV - code coverage report
Current view: top level - bank-lib - fakebank_bank_get_root.c (source / functions) Coverage Total Hit
Test: coverage.info Lines: 100.0 % 5 5
Test Date: 2026-01-12 22:36:41 Functions: 100.0 % 1 1

            Line data    Source code
       1              : /*
       2              :   This file is part of TALER
       3              :   (C) 2016-2023 Taler Systems SA
       4              : 
       5              :   TALER is free software; you can redistribute it and/or
       6              :   modify it under the terms of the GNU General Public License
       7              :   as published by the Free Software Foundation; either version 3,
       8              :   or (at your option) any later version.
       9              : 
      10              :   TALER is distributed in the hope that it will be useful,
      11              :   but WITHOUT ANY WARRANTY; without even the implied warranty of
      12              :   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
      13              :   GNU General Public License for more details.
      14              : 
      15              :   You should have received a copy of the GNU General Public
      16              :   License along with TALER; see the file COPYING.  If not,
      17              :   see <http://www.gnu.org/licenses/>
      18              : */
      19              : /**
      20              :  * @file bank-lib/fakebank_bank_get_root.c
      21              :  * @brief handle a GET "/" request for the bank API
      22              :  * @author Christian Grothoff <christian@grothoff.org>
      23              :  */
      24              : #include "taler/platform.h"
      25              : #include "taler/taler_fakebank_lib.h"
      26              : #include "taler/taler_bank_service.h"
      27              : #include "taler/taler_mhd_lib.h"
      28              : #include <gnunet/gnunet_mhd_compat.h>
      29              : #include "fakebank.h"
      30              : #include "fakebank_bank_get_root.h"
      31              : 
      32              : 
      33              : /**
      34              :  * Handle incoming HTTP request for "/" (home page).
      35              :  *
      36              :  * @param h the fakebank handle
      37              :  * @param connection the connection
      38              :  * @return MHD result code
      39              :  */
      40              : MHD_RESULT
      41            3 : TALER_FAKEBANK_bank_get_root_ (struct TALER_FAKEBANK_Handle *h,
      42              :                                struct MHD_Connection *connection)
      43              : {
      44              :   MHD_RESULT ret;
      45              :   struct MHD_Response *resp;
      46              : #define HELLOMSG "Hello, Fakebank!"
      47              : 
      48              :   (void) h;
      49            3 :   resp = MHD_create_response_from_buffer_static (
      50              :     strlen (HELLOMSG),
      51              :     HELLOMSG);
      52            3 :   ret = MHD_queue_response (connection,
      53              :                             MHD_HTTP_OK,
      54              :                             resp);
      55            3 :   MHD_destroy_response (resp);
      56            3 :   return ret;
      57              : }
        

Generated by: LCOV version 2.0-1