frosix

Multiparty signature service (experimental)
Log | Files | Refs | README | LICENSE

frosix-httpd_mhd.c (1921B)


      1 /*
      2   This file is part of Frosix
      3   Copyright (C) 2014, 2015, 2016 Anastasis SARL
      4 
      5   Frosix 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   Frosix 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 Affero General Public License for more details.
     12 
     13   You should have received a copy of the GNU Affero General Public License along with
     14   Frosix; see the file COPYING.  If not, see <http://www.gnu.org/licenses/>
     15 */
     16 /**
     17  * @file frosix-httpd_mhd.c
     18  * @brief helpers for MHD interaction; these are TALER_EXCHANGE_handler_ functions
     19  *        that generate simple MHD replies that do not require any real operations
     20  *        to be performed (error handling, static pages, etc.)
     21  * @author Florian Dold
     22  * @author Benedikt Mueller
     23  * @author Christian Grothoff
     24  */
     25 #include "platform.h"
     26 #include <jansson.h>
     27 #include "frosix-httpd_mhd.h"
     28 
     29 
     30 MHD_RESULT
     31 TMH_MHD_handler_static_response (struct FH_RequestHandler *rh,
     32                                  struct MHD_Connection *connection)
     33 {
     34   if (0 == rh->data_size)
     35     rh->data_size = strlen ((const char *) rh->data);
     36   return TALER_MHD_reply_static (connection,
     37                                  rh->response_code,
     38                                  rh->mime_type,
     39                                  (void *) rh->data,
     40                                  rh->data_size);
     41 }
     42 
     43 
     44 MHD_RESULT
     45 TMH_MHD_handler_agpl_redirect (struct FH_RequestHandler *rh,
     46                                struct MHD_Connection *connection)
     47 {
     48   (void) rh;
     49   return TALER_MHD_reply_agpl (connection,
     50                                "https://git.taler.net/anastasis.git");
     51 }
     52 
     53 
     54 /* end of frosix-httpd_mhd.c */