set error to response if list is empty (avoid ChromeIPass hanging) (reverted from commit c736ba7059)

This commit is contained in:
Frank Nießen 2015-06-21 20:46:09 +02:00
parent c736ba7059
commit 6e8aeea76d

View File

@ -75,19 +75,14 @@ void Server::getLogins(const Request &r, Response *protocolResp)
if (!r.CheckVerifier(key)) if (!r.CheckVerifier(key))
return; return;
protocolResp->setSuccess();
protocolResp->setId(r.id()); protocolResp->setId(r.id());
protocolResp->setVerifier(key); protocolResp->setVerifier(key);
QList<Entry> entries = findMatchingEntries(r.id(), r.url(), r.submitUrl(), r.realm()); //TODO: filtering, request confirmation [in db adaptation layer?] QList<Entry> entries = findMatchingEntries(r.id(), r.url(), r.submitUrl(), r.realm()); //TODO: filtering, request confirmation [in db adaptation layer?]
if (entries.count() == 0) { if (r.sortSelection()) {
protocolResp->setError("url not found!"); //TODO: sorting (in db adaptation layer? here?)
}
else {
if (r.sortSelection()) {
//TODO: sorting (in db adaptation layer? here?)
}
protocolResp->setSuccess();
protocolResp->setEntries(entries);
} }
protocolResp->setEntries(entries);
} }
void Server::getLoginsCount(const Request &r, Response *protocolResp) void Server::getLoginsCount(const Request &r, Response *protocolResp)