PROXY: merge proxy methods into buildsystem

From the original patch by Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> 26 Feb 2008
This patch adds the code and rules to build the various proxy methods.
This commit is contained in:
Bob Mottram 2016-04-14 11:35:53 +01:00
commit 3bc24696a4
2 changed files with 49 additions and 0 deletions

View file

@ -33,6 +33,12 @@ libcore_a_SOURCES = \
network-openssl.c \
network-proxy.c \
network-proxy.h \
network-proxy-simple.c \
network-proxy-simple.h \
network-proxy-http.c \
network-proxy-http.h \
network-proxy-socks5.c \
network-proxy-socks5.h \
network-proxy-priv.h \
nicklist.c \
nickmatch-cache.c \

43
src/core/network-proxy.c Normal file
View file

@ -0,0 +1,43 @@
/*
network-proxy.c : irssi
Copyright (C) 2008 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; version 2 and/or 3 of the License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "module.h"
#include "network-proxy.h"
#include <string.h>
#include "network-proxy-simple.h"
#include "network-proxy-http.h"
#include "network-proxy-socks5.h"
struct network_proxy *network_proxy_create(const char *type)
{
if (type==NULL)
return NULL;
if (strcmp(type, "simple")==0 || type[0]=='\0')
return network_proxy_simple_create();
if (strcmp(type, "http")==0)
return network_proxy_http_create();
if (strcmp(type, "socks5")==0)
return network_proxy_socks5_create();
g_error("unsupported proxy type '%s'", type);
return NULL;
}