2 * Copyright (C) 2010 Martin Willi
3 * Copyright (C) 2010 revosec AG
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License as published by the
7 * Free Software Foundation; either version 2 of the License, or (at your
8 * option) any later version. See <http://www.fsf.org/copyleft/gpl.txt>.
10 * This program is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
12 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
16 #include "soup_plugin.h"
17 #include "soup_fetcher.h"
20 #include <glib-object.h>
24 typedef struct private_soup_plugin_t private_soup_plugin_t
;
27 * private data of soup_plugin
29 struct private_soup_plugin_t
{
37 METHOD(plugin_t
, get_name
, char*,
38 private_soup_plugin_t
*this)
43 METHOD(plugin_t
, destroy
, void,
44 private_soup_plugin_t
*this)
46 lib
->fetcher
->remove_fetcher(lib
->fetcher
,
47 (fetcher_constructor_t
)soup_fetcher_create
);
54 plugin_t
*soup_plugin_create()
56 private_soup_plugin_t
*this;
59 if (!g_thread_get_initialized())
67 .get_name
= _get_name
,
68 .reload
= (void*)return_false
,
74 lib
->fetcher
->add_fetcher(lib
->fetcher
,
75 (fetcher_constructor_t
)soup_fetcher_create
, "http://");
76 lib
->fetcher
->add_fetcher(lib
->fetcher
,
77 (fetcher_constructor_t
)soup_fetcher_create
, "https://");
79 return &this->public.plugin
;