Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
openSUSE:Step:15-SP2
wget.36152
wget-libproxy.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File wget-libproxy.patch of Package wget.36152
Index: wget-1.20/configure.ac =================================================================== --- wget-1.20.orig/configure.ac +++ wget-1.20/configure.ac @@ -493,6 +493,22 @@ else fi fi +dnl +dnl libproxy support +dnl +AC_ARG_ENABLE(libproxy, + [ --enable-libproxy libproxy support for system wide proxy configuration]) +if test "${enable_libproxy}" != "no" +then + PKG_CHECK_MODULES([libproxy], [libproxy-1.0], [enable_libproxy=yes], [enable_libproxy=no]) +fi +if test "${enable_libproxy}" = "yes" +then + AC_SUBST(libproxy_CFLAGS) + AC_SUBST(libproxy_LIBS) + AC_DEFINE([HAVE_LIBPROXY], 1, [Define when using libproxy]) +fi + dnl ********************************************************************** dnl Checks for IPv6 dnl ********************************************************************** Index: wget-1.20/src/Makefile.am =================================================================== --- wget-1.20.orig/src/Makefile.am +++ wget-1.20/src/Makefile.am @@ -62,7 +62,7 @@ wget_SOURCES = connect.c convert.c cooki nodist_wget_SOURCES = version.c EXTRA_wget_SOURCES = iri.c LDADD = $(LIBOBJS) ../lib/libgnu.a $(GETADDRINFO_LIB) $(HOSTENT_LIB)\ - $(INET_NTOP_LIB) $(LIBSOCKET) $(LIB_CLOCK_GETTIME) $(LIB_CRYPTO)\ + $(INET_NTOP_LIB) $(LIBSOCKET) $(libproxy_LIBS) $(LIB_CLOCK_GETTIME) $(LIB_CRYPTO)\ $(LIB_NANOSLEEP) $(LIB_POSIX_SPAWN) $(LIB_SELECT) $(LIBICONV) $(LIBINTL)\ $(LIBTHREAD) $(LIBUNISTRING) $(SERVENT_LIB) AM_CPPFLAGS = -I$(top_builddir)/lib -I$(top_srcdir)/lib Index: wget-1.20/src/retr.c =================================================================== --- wget-1.20.orig/src/retr.c +++ wget-1.20/src/retr.c @@ -61,6 +61,10 @@ as that of the covered work. */ #include "iri.h" #include "hsts.h" +#ifdef HAVE_LIBPROXY +#include "proxy.h" +#endif + /* Total size of downloaded files. Used to enforce quota. */ SUM_SIZE_INT total_downloaded_bytes; @@ -1480,7 +1484,40 @@ getproxy (struct url *u) break; } if (!proxy || !*proxy) +#ifdef HAVE_LIBPROXY + { + pxProxyFactory *pf = px_proxy_factory_new(); + if (!pf) + { + debug_logprintf (_("Allocating memory for libproxy failed")); + return NULL; + } + int i; + char direct[] = "direct://"; + + debug_logprintf (_("asking libproxy about url '%s'\n"), u->url); + char **proxies = px_proxy_factory_get_proxies(pf, u->url); + if (proxies[0]) + { + char *check = NULL; + asprintf(&check , "%s", proxies[0]); + debug_logprintf (_("libproxy suggest to use '%s'\n"), check); + if(strcmp(check ,direct) != 0) + { + asprintf(&proxy , "%s", proxies[0]); + debug_logprintf (_("case 2: libproxy setting to use '%s'\n"), proxy); + } + } + for(i=0;proxies[i];i++) free(proxies[i]); + free(proxies); + px_proxy_factory_free(pf); + + if (!proxy || !*proxy) + return NULL; + } +#else return NULL; +#endif /* Handle shorthands. `rewritten_storage' is a kludge to allow getproxy() to return static storage. */ Index: wget-1.20/tests/Makefile.am =================================================================== --- wget-1.20.orig/tests/Makefile.am +++ wget-1.20/tests/Makefile.am @@ -30,6 +30,7 @@ # # Version: @VERSION@ # ++LIBS += $(libproxy_LIBS) ../src/wget$(EXEEXT): cd ../src && $(MAKE) $(AM_MAKEFLAGS)
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor