diff options
author | Kitsune Ral <Kitsune-Ral@users.sf.net> | 2019-12-12 19:47:07 +0300 |
---|---|---|
committer | Kitsune Ral <Kitsune-Ral@users.sf.net> | 2019-12-12 19:47:07 +0300 |
commit | f6505a541fc0a2e02f9c79496488121a3e46fb01 (patch) | |
tree | 44ede7438530a49403871dd777eacfddf693df95 /lib/connection.cpp | |
parent | d438c08e11d17dc9c005806a6036e1aeb769c54b (diff) | |
download | libquotient-f6505a541fc0a2e02f9c79496488121a3e46fb01.tar.gz libquotient-f6505a541fc0a2e02f9c79496488121a3e46fb01.zip |
BaseJob: prepare() -> initiate() + refactoring around it
* BaseJob::initiate() now calls ConnectionData::submit()
without relying on Connection to do that
* ConnectionData::submit() is now the only site where a job enters
Pending state
* No more shortcuts to BaseJob::sendRequest(), even retries are sent
through the ConnectionData submission queue
* Additional validation in BaseJob::initiate() that the request data
device is actually open (because QtNetwork API officially
requires that, even if you can get away passing a closed QBuffer
to it)
Diffstat (limited to 'lib/connection.cpp')
-rw-r--r-- | lib/connection.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/lib/connection.cpp b/lib/connection.cpp index 999f4382..c13568f1 100644 --- a/lib/connection.cpp +++ b/lib/connection.cpp @@ -1414,8 +1414,7 @@ void Connection::setLazyLoading(bool newValue) void Connection::run(BaseJob* job, RunningPolicy runningPolicy) const { connect(job, &BaseJob::failure, this, &Connection::requestFailed); - job->prepare(d->data.get(), runningPolicy & BackgroundRequest); - d->data->submit(job); + job->initiate(d->data.get(), runningPolicy & BackgroundRequest); } void Connection::getTurnServers() |