Commit ac93ab38 authored by pvuorela's avatar pvuorela

Merge branch 'jb40059' into 'master'

[ssu] Allow to use ssu behind proxy without connman. Contribute to JB#40059

See merge request !15
parents c4875af8 f42fd9a0
...@@ -7,14 +7,24 @@ ...@@ -7,14 +7,24 @@
#ifndef _LibSsuNetworkProxy_H #ifndef _LibSsuNetworkProxy_H
#define _LibSsuNetworkProxy_H #define _LibSsuNetworkProxy_H
#include <dlfcn.h> #include <dlfcn.h>
#include <QtCore/QtGlobal>
#include <QtNetwork/QNetworkProxyFactory>
/** /**
* Set application proxy if the required library is found, otherwise * Set application proxy. First check \c http_proxy environment variable, then try to get
* do nothing. * proxy configuration from connman.
*/ */
inline void set_application_proxy_factory() inline void set_application_proxy_factory()
{ {
if (qEnvironmentVariableIsSet("http_proxy")) {
qDebug() << "Got http_proxy from environment, will not talk to connman";
QNetworkProxyFactory::setUseSystemConfiguration(true);
return;
}
void *proxylib = dlopen("libssunetworkproxy.so", RTLD_LAZY); void *proxylib = dlopen("libssunetworkproxy.so", RTLD_LAZY);
if (proxylib) { if (proxylib) {
typedef void (*ssuproxyinit_t)(); typedef void (*ssuproxyinit_t)();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment