frosix-httpd_mhd.h (1776B)
1 /* 2 This file is part of Frosix 3 Copyright (C) 2014, 2015 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.h 18 * @brief helpers for MHD interaction, used to generate simple responses 19 * @author Florian Dold 20 * @author Benedikt Mueller 21 * @author Christian Grothoff 22 */ 23 #ifndef FROSIX_HTTPD_MHD_H 24 #define FROSIX_HTTPD_MHD_H 25 #include <gnunet/gnunet_util_lib.h> 26 #include <microhttpd.h> 27 #include "frosix-httpd.h" 28 29 30 /** 31 * Function to call to handle the request by sending 32 * back static data from the @a rh. 33 * 34 * @param rh context of the handler 35 * @param connection the MHD connection to handle 36 * @return MHD result code 37 */ 38 MHD_RESULT 39 TMH_MHD_handler_static_response (struct FH_RequestHandler *rh, 40 struct MHD_Connection *connection); 41 42 43 /** 44 * Function to call to handle the request by sending 45 * back a redirect to the AGPL source code. 46 * 47 * @param rh context of the handler 48 * @param connection the MHD connection to handle 49 * @return MHD result code 50 */ 51 MHD_RESULT 52 TMH_MHD_handler_agpl_redirect (struct FH_RequestHandler *rh, 53 struct MHD_Connection *connection); 54 55 56 #endif