firewall-safe proxy detection 1st try
This commit is contained in:
@@ -203,6 +203,9 @@ namespace proxy {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
void replyFinished(QNetworkReply* reply) {
|
void replyFinished(QNetworkReply* reply) {
|
||||||
|
qDebug()<<"Proxydetection got reply with status:"
|
||||||
|
<<reply->error()<<reply->errorString();
|
||||||
|
if (reply->error()!=QNetworkReply::NoError) return; // wait for timeout
|
||||||
_timeout.stop();
|
_timeout.stop();
|
||||||
QNetworkProxy prxy(_requests[reply].second);
|
QNetworkProxy prxy(_requests[reply].second);
|
||||||
QUrl url(reply->url());
|
QUrl url(reply->url());
|
||||||
|
@@ -18,7 +18,7 @@
|
|||||||
|
|
||||||
#include <QtCore/QDebug>
|
#include <QtCore/QDebug>
|
||||||
|
|
||||||
class Proxy: public QDialog, private Ui::Proxy {
|
class Proxy: public QDialog, public Ui::Proxy {
|
||||||
|
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
|
@@ -11,7 +11,11 @@
|
|||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
#include <winhttp.h>
|
#include <winhttp.h>
|
||||||
|
|
||||||
|
#ifdef QT_NETWORK_LIB
|
||||||
|
#include <QtCore/QDebug> // debug
|
||||||
|
#else
|
||||||
#include <iostream> // debug
|
#include <iostream> // debug
|
||||||
|
#endif
|
||||||
|
|
||||||
namespace proxy {
|
namespace proxy {
|
||||||
|
|
||||||
@@ -50,7 +54,11 @@ namespace proxy {
|
|||||||
throw exc::error();
|
throw exc::error();
|
||||||
|
|
||||||
std::wstring list(proxyInfo.lpszProxy);
|
std::wstring list(proxyInfo.lpszProxy);
|
||||||
|
#ifdef QT_NETWORK_LIB
|
||||||
|
qDebug()<<"LIST=\""<<proxyInfo.lpszProxy<<"\"";
|
||||||
|
#else
|
||||||
std::wcout<<"LIST=\""<<list<<"\""<<std::endl;
|
std::wcout<<"LIST=\""<<list<<"\""<<std::endl;
|
||||||
|
#endif
|
||||||
for (std::wstring::size_type oldpos(0), pos(0);
|
for (std::wstring::size_type oldpos(0), pos(0);
|
||||||
(pos=list.find(L";", oldpos))!=std::wstring::npos;
|
(pos=list.find(L";", oldpos))!=std::wstring::npos;
|
||||||
oldpos=++pos) {
|
oldpos=++pos) {
|
||||||
|
Reference in New Issue
Block a user