mirror of
https://gitlab.com/spaceti-app/integrations/common/server-sdk.git
synced 2026-07-12 13:10:43 +02:00
Merge branch 'feat/process-request' into 'master'
ability to check whether networkreply was really created ( rare test ) See merge request spaceti-app/integrations/common/server-sdk!16
This commit is contained in:
commit
24d9578a4e
@ -27,7 +27,7 @@ RequestManager::RequestManager(QObject *parent)
|
||||
*
|
||||
* @param Request
|
||||
*/
|
||||
void RequestManager::processRequest(const std::shared_ptr<Request>& request)
|
||||
bool RequestManager::processRequest(const std::shared_ptr<Request>& request)
|
||||
{
|
||||
QNetworkReply *reply = nullptr;
|
||||
request->logStartTime();
|
||||
@ -46,9 +46,11 @@ void RequestManager::processRequest(const std::shared_ptr<Request>& request)
|
||||
reply = mNetworkAccessManager.put(request->networkRequest(), request->requestData());
|
||||
} else {
|
||||
qCritical(sdknetwork) << "Using request type:" << request->type() << "is not implemented";
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
Q_ASSERT(reply);
|
||||
// Adding reply to final request
|
||||
reply->setParent(nullptr); // ensure QNetworkreply wont be deleted by QNetworkAccessManager ( it is parent of reply )
|
||||
request->setNetworkReply(reply);
|
||||
@ -67,6 +69,8 @@ void RequestManager::processRequest(const std::shared_ptr<Request>& request)
|
||||
emit request->finished(request);
|
||||
emit downloadFinished(request);
|
||||
});
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -19,7 +19,7 @@ class RequestManager : public QObject
|
||||
public:
|
||||
explicit RequestManager(QObject *parent = nullptr);
|
||||
|
||||
void processRequest(const std::shared_ptr<Request>& request);
|
||||
bool processRequest(const std::shared_ptr<Request>& request);
|
||||
|
||||
|
||||
bool ignoreSsl() const;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user