diff --git a/proxyface/autoproxy.hxx b/proxyface/autoproxy.hxx index d3b30e6..f4feaff 100644 --- a/proxyface/autoproxy.hxx +++ b/proxyface/autoproxy.hxx @@ -85,7 +85,9 @@ namespace proxy { //! Keep your instance as long as possible, because of caching. Interface() { #ifdef QT_NETWORK_LIB - if (!connect(&_timeout, SIGNAL(timeout()), SLOT(timeout()))) + if (!connect(&_timeout1, SIGNAL(timeout()), SLOT(timeout()))) + qFatal("connect failed"); + if (!connect(&_timeout2, SIGNAL(timeout()), SLOT(timeout()))) qFatal("connect failed"); #endif } @@ -104,10 +106,11 @@ namespace proxy { @param url the url to find a proxy for @param timeout [ms] time to give up search */ - void proxy(const std::string& url, int timeout=2000) { + void proxy(const std::string& url, int timeout1=1000, int timeout2=9000) { qDebug()<<"Search proxy for URL, direct and default" - <<"url="<error()<errorString(); if (reply->error()!=QNetworkReply::NoError) return; // wait for timeout - _timeout.stop(); + _timeout1.stop(); + _timeout2.stop(); QNetworkProxy prxy(_requests[reply].second); QUrl url(reply->url()); for (Requests::iterator it(_requests.begin()); it!=_requests.end(); ++it) @@ -222,7 +233,8 @@ namespace proxy { Requests; Requests _requests; bool _direct; - QTimer _timeout; + QTimer _timeout1; + QTimer _timeout2; #endif }; }