Abort current connection (if any) with new request.
[yandex-traffic] / http_fetcher.cpp
index 543260d..433c990 100644 (file)
@@ -13,16 +13,13 @@ HttpFetcher::HttpFetcher ()
 }
 
 
-bool HttpFetcher::busy () const
-{
-    return _http.currentId () != 0;
-}
-
-
 void HttpFetcher::fetch (const QString& url)
 {
     QUrl u (url);
 
+    if (_http.currentId () != )
+        _http.abort ();
+
     if (u.isValid ()) {
         _http.setHost (u.host ());
         _http.get (u.encodedPath (), &_buffer);
@@ -40,11 +37,3 @@ void HttpFetcher::requestDone (bool err)
     _buffer.setBuffer (NULL);
 }
 
-
-void HttpFetcher::reset ()
-{
-    if (!busy ())
-        return;
-
-    _http.abort ();
-}