ssu
ssunetworkproxy.h
Go to the documentation of this file.
1 
8 #ifndef _LibSsuNetworkProxy_H
9 #define _LibSsuNetworkProxy_H
10 
11 #include <dlfcn.h>
12 
13 #include <QtCore/QtGlobal>
14 #include <QtNetwork/QNetworkProxyFactory>
15 
21 {
22  if (qEnvironmentVariableIsSet("http_proxy")) {
23  qDebug() << "Got http_proxy from environment, will not talk to connman";
24  QNetworkProxyFactory::setUseSystemConfiguration(true);
25  return;
26  }
27 
28  void *proxylib = dlopen("libssunetworkproxy.so", RTLD_LAZY);
29  if (proxylib) {
30  typedef void (*ssuproxyinit_t)();
31  dlerror();
32  ssuproxyinit_t proxy_init = (ssuproxyinit_t) dlsym(proxylib, "initialize");
33  const char *dlsym_err = dlerror();
34  if (!dlsym_err) {
35  proxy_init();
36  }
37  dlclose(proxylib);
38  }
39 }
40 
41 #endif
set_application_proxy_factory
void set_application_proxy_factory()
Definition: ssunetworkproxy.h:20