31 #define GNUNET_REST_API_NS_COPYING "/copying" 33 #define GNUNET_REST_COPYING_TEXT \ 34 "GNU Affero General Public License version 3 or later. See also: <http://www.gnu.org/licenses/>" 116 struct MHD_Response *resp;
137 struct MHD_Response *resp;
141 MHD_add_response_header (resp,
142 "Access-Control-Allow-Methods",
143 MHD_HTTP_METHOD_GET);
197 static struct Plugin plugin;
202 if (NULL != plugin.
cfg)
204 memset (&plugin, 0,
sizeof(
struct Plugin));
211 _ (
"COPYING REST API initialized\n"));
228 while (NULL != requests_head)
233 "COPYING REST plugin is finished\n");
#define GNUNET_CONTAINER_DLL_remove(head, tail, element)
Remove an element from a DLL.
void(* GNUNET_REST_ResultProcessor)(void *cls, struct MHD_Response *resp, int status)
Iterator called on obtained result for a REST result.
static void cleanup_handle(struct RequestHandle *handle)
Cleanup request handle.
#define GNUNET_CONTAINER_DLL_insert(head, tail, element)
Insert an element at the head of a DLL.
#define GNUNET_REST_API_NS_COPYING
void * cls
The closure of the plugin.
GNUNET_REST_ResultProcessor proc
The plugin result processor.
static enum GNUNET_GenericReturnValue rest_copying_process_request(struct GNUNET_REST_RequestHandle *conndata_handle, GNUNET_REST_ResultProcessor proc, void *proc_cls)
Function processing the REST call.
const struct GNUNET_CONFIGURATION_Handle * cfg
Our configuration.
struct returned by the initialization function of the plugin
GNUNET_GenericReturnValue
Named constants for return values.
#define GNUNET_new(type)
Allocate a struct or union of the given type.
static struct RequestHandle * requests_head
DLL.
void * proc_cls
The closure of the result processor.
#define GNUNET_REST_HANDLER_END
struct GNUNET_BLOCK_PluginFunctions * api
Plugin API.
#define GNUNET_REST_COPYING_TEXT
static void get_cont(struct GNUNET_REST_RequestHandle *con_handle, const char *url, void *cls)
Handle rest request.
static struct GNUNET_DNS_Handle * handle
Handle to transport service.
void * libgnunet_plugin_rest_copying_done(void *cls)
Exit point from the plugin.
int GNUNET_REST_handle_request(struct GNUNET_REST_RequestHandle *conn, const struct GNUNET_REST_RequestHandler *handlers, struct GNUNET_REST_RequestHandlerError *err, void *cls)
struct GNUNET_REST_RequestHandle * rest_handle
Rest connection.
static char * plugin
Solver plugin name as string.
struct RequestHandle * next
DLL.
static struct RequestHandle * requests_tail
DLL.
struct RequestHandle * prev
DLL.
void * libgnunet_plugin_rest_copying_init(void *cls)
Entry point for the plugin.
struct MHD_Response * GNUNET_REST_create_response(const char *data)
Create REST MHD response.
#define GNUNET_log(kind,...)
enum GNUNET_GenericReturnValue(* process_request)(struct GNUNET_REST_RequestHandle *handle, GNUNET_REST_ResultProcessor proc, void *proc_cls)
Function to process a REST call.
static void options_cont(struct GNUNET_REST_RequestHandle *con_handle, const char *url, void *cls)
Handle rest request.
#define GNUNET_free(ptr)
Wrapper around free.