paivana

HTTP paywall reverse proxy
Log | Files | Refs | Submodules | README | LICENSE

paivana-httpd_pay.h (2115B)


      1 /*
      2      This file is part of GNUnet.
      3      Copyright (C) 2026 Taler Systems SA
      4 
      5      Paivana 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
      8      3, or (at your option) any later version.
      9 
     10      Paivana is distributed in the hope that it will be useful,
     11      but WITHOUT ANY WARRANTY; without even the implied warranty
     12      of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
     13      the GNU General Public License for more details.
     14 
     15      You should have received a copy of the GNU General Public
     16      License along with Paivana; see the file COPYING.  If not,
     17      write to the Free Software Foundation, Inc., 51 Franklin
     18      Street, Fifth Floor, Boston, MA 02110-1301, USA.
     19 */
     20 
     21 /**
     22  * @author Christian Grothoff
     23  * @file paivana-httpd_pay.h
     24  *
     25  * @brief payment processing logic
     26  */
     27 #ifndef PAIVANA_HTTPD_PAY_H
     28 #define PAIVANA_HTTPD_PAY_H
     29 
     30 #include <gnunet/gnunet_util_lib.h>
     31 #include <microhttpd.h>
     32 #include "paivana-httpd.h"
     33 
     34 /**
     35  * Handle for processing actual payment.
     36  */
     37 struct PayRequest;
     38 
     39 /**
     40  * The server is shutting down, clean up suspended requests.
     41  */
     42 void
     43 PAIVANA_HTTPD_payment_shutdown (void);
     44 
     45 
     46 /**
     47  * Create context for handling a request to check a payment.
     48  *
     49  * @param connection the request context
     50  */
     51 struct PayRequest *
     52 PAIVANA_HTTPD_payment_create (struct MHD_Connection *connection);
     53 
     54 
     55 /**
     56  * Make progress on handling the upload of the client.
     57  *
     58  * @param[in,out] pr payment request handle
     59  * @param upload_data data uploaded by the client
     60  * @param[in,out] upload_data_size number of bytes uploaded,
     61  *          set to the number of bytes of upload that were not handled
     62  * @return MHD status code to return
     63  */
     64 enum MHD_Result
     65 PAIVANA_HTTPD_payment_handle (struct PayRequest *pr,
     66                               const char *upload_data,
     67                               size_t *upload_data_size);
     68 
     69 /**
     70  * Clean up payment request handle.
     71  *
     72  * @param[in] ph handle to clean up
     73  */
     74 void
     75 PAIVANA_HTTPD_payment_destroy (struct PayRequest *ph);
     76 
     77 
     78 #endif