diff options
Diffstat (limited to 'src/modules/objects/qthttp')
| -rw-r--r-- | src/modules/objects/qthttp/qhttp.cpp | 60 | ||||
| -rw-r--r-- | src/modules/objects/qthttp/qhttpauthenticator.cpp | 10 |
2 files changed, 35 insertions, 35 deletions
diff --git a/src/modules/objects/qthttp/qhttp.cpp b/src/modules/objects/qthttp/qhttp.cpp index f6de5e6a5..ad865d31a 100644 --- a/src/modules/objects/qthttp/qhttp.cpp +++ b/src/modules/objects/qthttp/qhttp.cpp @@ -99,10 +99,10 @@ public: Q_DECLARE_PUBLIC(QHttp) inline QHttpPrivate(QHttp * parent) - : socket(0), reconnectAttempts(2), + : socket(nullptr), reconnectAttempts(2), deleteSocket(0), state(QHttp::Unconnected), error(QHttp::NoError), port(0), mode(QHttp::ConnectionModeHttp), - toDevice(0), postDevice(0), bytesDone(0), chunkedSize(-1), + toDevice(nullptr), postDevice(nullptr), bytesDone(0), chunkedSize(-1), repost(false), pendingPost(false), q_ptr(parent) { } @@ -245,7 +245,7 @@ private: void QHttpNormalRequest::start(QHttp * http) { if(!http->d->socket) - http->d->setSock(0); + http->d->setSock(nullptr); http->d->header = header; if(is_ba) @@ -254,7 +254,7 @@ void QHttpNormalRequest::start(QHttp * http) if(http->d->buffer.size() >= 0) http->d->header.setContentLength(http->d->buffer.size()); - http->d->postDevice = 0; + http->d->postDevice = nullptr; } else { @@ -268,14 +268,14 @@ void QHttpNormalRequest::start(QHttp * http) } else { - http->d->postDevice = 0; + http->d->postDevice = nullptr; } } if(to && (to->isOpen() || to->open(QIODevice::WriteOnly))) http->d->toDevice = to; else - http->d->toDevice = 0; + http->d->toDevice = nullptr; http->d->reconnectAttempts = 2; http->d->_q_slotSendRequest(); @@ -294,7 +294,7 @@ QHttpRequestHeader QHttpNormalRequest::requestHeader() QIODevice * QHttpNormalRequest::sourceDevice() { if(is_ba) - return 0; + return nullptr; return data.dev; } @@ -358,11 +358,11 @@ public: QIODevice * sourceDevice() { - return 0; + return nullptr; } QIODevice * destinationDevice() { - return 0; + return nullptr; } private: @@ -407,11 +407,11 @@ public: QIODevice * sourceDevice() { - return 0; + return nullptr; } QIODevice * destinationDevice() { - return 0; + return nullptr; } private: @@ -456,11 +456,11 @@ public: inline QIODevice * sourceDevice() { - return 0; + return nullptr; } inline QIODevice * destinationDevice() { - return 0; + return nullptr; } private: @@ -486,11 +486,11 @@ public: QIODevice * sourceDevice() { - return 0; + return nullptr; } QIODevice * destinationDevice() { - return 0; + return nullptr; } private: @@ -519,11 +519,11 @@ public: QIODevice * sourceDevice() { - return 0; + return nullptr; } QIODevice * destinationDevice() { - return 0; + return nullptr; } }; @@ -1963,7 +1963,7 @@ qint64 QHttp::bytesAvailable() const */ qint64 QHttp::read(char * data, qint64 maxlen) { - if(data == 0 && maxlen != 0) + if(data == nullptr && maxlen != 0) { qWarning("QHttp::read: Null pointer error"); return -1; @@ -2059,7 +2059,7 @@ QHttpResponseHeader QHttp::lastResponse() const QIODevice * QHttp::currentSourceDevice() const { if(d->pending.isEmpty()) - return 0; + return nullptr; return d->pending.first()->sourceDevice(); } @@ -2076,7 +2076,7 @@ QIODevice * QHttp::currentSourceDevice() const QIODevice * QHttp::currentDestinationDevice() const { if(d->pending.isEmpty()) - return 0; + return nullptr; return d->pending.first()->destinationDevice(); } @@ -2285,7 +2285,7 @@ int QHttp::get(const QString & path, QIODevice * to) { QHttpRequestHeader header(QLatin1String("GET"), path); header.setValue(QLatin1String("Connection"), QLatin1String("Keep-Alive")); - return d->addRequest(new QHttpPGHRequest(header, (QIODevice *)0, to)); + return d->addRequest(new QHttpPGHRequest(header, (QIODevice *)nullptr, to)); } /*! @@ -2359,7 +2359,7 @@ int QHttp::head(const QString & path) { QHttpRequestHeader header(QLatin1String("HEAD"), path); header.setValue(QLatin1String("Connection"), QLatin1String("Keep-Alive")); - return d->addRequest(new QHttpPGHRequest(header, (QIODevice *)0, 0)); + return d->addRequest(new QHttpPGHRequest(header, (QIODevice *)nullptr, nullptr)); } /*! @@ -2688,7 +2688,7 @@ void QHttpPrivate::_q_slotClosed() finishedWithError(QLatin1String(QT_TRANSLATE_NOOP("QHttp", "Server closed connection unexpectedly")), QHttp::UnexpectedClose); } - postDevice = 0; + postDevice = nullptr; if(state != QHttp::Closing) setState(QHttp::Closing); QMetaObject::invokeMethod(q, "_q_slotDoFinished", Qt::QueuedConnection); @@ -2741,7 +2741,7 @@ void QHttpPrivate::_q_slotConnected() void QHttpPrivate::_q_slotError(QAbstractSocket::SocketError err) { Q_Q(QHttp); - postDevice = 0; + postDevice = nullptr; if(state == QHttp::Connecting || state == QHttp::Reading || state == QHttp::Sending) { @@ -2830,7 +2830,7 @@ void QHttpPrivate::postMoreData() } if(postDevice->atEnd()) { - postDevice = 0; + postDevice = nullptr; } socket->write(arr, n); @@ -3023,7 +3023,7 @@ void QHttpPrivate::_q_slotReadyRead() else { qint64 n = socket->bytesAvailable(); - QByteArray * arr = 0; + QByteArray * arr = nullptr; if(chunkedSize != -1) { // transfer-encoding is chunked @@ -3138,7 +3138,7 @@ void QHttpPrivate::_q_slotReadyRead() qint64 bytesWritten; bytesWritten = toDevice->write(*arr, n); delete arr; - arr = 0; + arr = nullptr; // if writing to the device does not succeed, quit with error if(bytesWritten == -1 || bytesWritten < n) { @@ -3161,7 +3161,7 @@ void QHttpPrivate::_q_slotReadyRead() char * ptr = rba.reserve(arr->size()); memcpy(ptr, arr->data(), arr->size()); delete arr; - arr = 0; + arr = nullptr; #if defined(QHTTP_DEBUG) qDebug("QHttp::_q_slotReadyRead(): read %lld bytes (%lld bytes done)", n, bytesDone + q->bytesAvailable()); #endif @@ -3262,7 +3262,7 @@ void QHttpPrivate::closeConn() if(state == QHttp::Closing || state == QHttp::Unconnected) return; - postDevice = 0; + postDevice = nullptr; setState(QHttp::Closing); // Already closed ? @@ -3288,7 +3288,7 @@ void QHttpPrivate::setSock(QTcpSocket * sock) delete socket; // use the new QTcpSocket socket, or create one if socket is 0. - deleteSocket = (sock == 0); + deleteSocket = (sock == nullptr); socket = sock; if(!socket) { diff --git a/src/modules/objects/qthttp/qhttpauthenticator.cpp b/src/modules/objects/qthttp/qhttpauthenticator.cpp index afe462a98..9cb7b8d6a 100644 --- a/src/modules/objects/qthttp/qhttpauthenticator.cpp +++ b/src/modules/objects/qthttp/qhttpauthenticator.cpp @@ -132,7 +132,7 @@ static QByteArray qNtlmPhase3(QHttpAuthenticatorPrivate * ctx, const QByteArray Constructs an empty authentication object */ QHttpAuthenticator::QHttpAuthenticator() - : d(0) + : d(nullptr) { } @@ -443,7 +443,7 @@ void QHttpAuthenticatorPrivate::parseHttpResponse(const QList<QPair<QByteArray, QByteArray QHttpAuthenticatorPrivate::calculateResponse(const QByteArray & requestMethod, const QByteArray & path) { QByteArray response; - const char * methodString = 0; + const char * methodString = nullptr; switch(method) { case QHttpAuthenticatorPrivate::None: @@ -1219,7 +1219,7 @@ QByteArray qEncodeHmacMd5(QByteArray & key, const QByteArray & message) static QByteArray qCreatev2Hash(const QHttpAuthenticatorPrivate * ctx, QNtlmPhase3Block * phase3) { - Q_ASSERT(phase3 != 0); + Q_ASSERT(phase3 != nullptr); // since v2 Hash is need for both NTLMv2 and LMv2 it is calculated // only once and stored and reused if(phase3->v2Hash.size() == 0) @@ -1277,7 +1277,7 @@ static QByteArray qEncodeNtlmv2Response(const QHttpAuthenticatorPrivate * ctx, const QNtlmPhase2Block & ch, QNtlmPhase3Block * phase3) { - Q_ASSERT(phase3 != 0); + Q_ASSERT(phase3 != nullptr); // return value stored in phase3 qCreatev2Hash(ctx, phase3); @@ -1352,7 +1352,7 @@ static QByteArray qEncodeLmv2Response(const QHttpAuthenticatorPrivate * ctx, const QNtlmPhase2Block & ch, QNtlmPhase3Block * phase3) { - Q_ASSERT(phase3 != 0); + Q_ASSERT(phase3 != nullptr); // return value stored in phase3 qCreatev2Hash(ctx, phase3); |
