Skip to content

Commit

Permalink
[ssu] Allow to use ssu behind proxy without connman. Contribute to JB…
Browse files Browse the repository at this point in the history
…#40059

E.g. inside platform SDK chroot.
  • Loading branch information
martyone committed Nov 20, 2017
1 parent c4875af commit f42fd9a
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions libssunetworkproxy/ssunetworkproxy.h
Expand Up @@ -7,14 +7,24 @@

#ifndef _LibSsuNetworkProxy_H
#define _LibSsuNetworkProxy_H

#include <dlfcn.h>

#include <QtCore/QtGlobal>
#include <QtNetwork/QNetworkProxyFactory>

/**
* Set application proxy if the required library is found, otherwise
* do nothing.
* Set application proxy. First check \c http_proxy environment variable, then try to get
* proxy configuration from connman.
*/
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);
if (proxylib) {
typedef void (*ssuproxyinit_t)();
Expand Down

0 comments on commit f42fd9a

Please sign in to comment.