Changed search to retry automatically couple of times before failing.
[jenirok] / src / common / mobil1881.cpp
index 6ded070..a51d293 100644 (file)
@@ -95,7 +95,6 @@ void Mobil1881::handleHttpError(int id)
         if(pendingSearches_.at(i) && pendingSearches_.at(i)->searchIds.find(id) !=
             pendingSearches_.at(i)->searchIds.end())
         {
-
             setError(Source::CONNECTION_FAILURE, http_.errorString());
             emitRequestFinished(pendingSearches_.at(i), true, i);
             break;
@@ -107,6 +106,14 @@ void Mobil1881::addNumbers(SearchData* searchData,
                            QString const& data,
                            int index)
 {
+    if(data.isEmpty())
+    {
+        qDebug() << "Server returned no data";
+        setError(CONNECTION_FAILURE, "Server returned no data");
+        emitRequestFinished(searchData, true, index);
+        return;
+    }
+
     if(data.indexOf("<b>Last ned vCard</b>") > 0)
     {
         addOnlyNumber(searchData, data, index);