diff options
author | Liang Qi <liang.qi@qt.io> | 2016-11-24 09:09:01 +0100 |
---|---|---|
committer | Liang Qi <liang.qi@qt.io> | 2016-11-24 10:31:21 +0100 |
commit | 4783de0473a288fdff7e5354c12315ba025ec7e0 (patch) | |
tree | 1dbd12129b4677c5a02307c1046fdb8cff056324 /src/network/socket/qnativesocketengine_winrt.cpp | |
parent | 60054b5940b19f4dd9780e63da1e2dce45baf131 (diff) | |
parent | 38c1057f696c4e3f168305091413428d99007c43 (diff) |
Merge remote-tracking branch 'origin/5.7' into 5.8
Conflicts:
src/network/socket/qnativesocketengine_winrt.cpp
tools/configure/configureapp.cpp
tools/configure/environment.cpp
Change-Id: Ieae6f2ee004a87f041751852b687484f91ee4480
Diffstat (limited to 'src/network/socket/qnativesocketengine_winrt.cpp')
-rw-r--r-- | src/network/socket/qnativesocketengine_winrt.cpp | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/src/network/socket/qnativesocketengine_winrt.cpp b/src/network/socket/qnativesocketengine_winrt.cpp index d0b8bff7f9..8257eec9ea 100644 --- a/src/network/socket/qnativesocketengine_winrt.cpp +++ b/src/network/socket/qnativesocketengine_winrt.cpp @@ -358,25 +358,23 @@ bool QNativeSocketEngine::initialize(qintptr socketDescriptor, QAbstractSocket:: // Start processing incoming data if (d->socketType == QAbstractSocket::TcpSocket) { - HRESULT hr; - QEventDispatcherWinRT::runOnXamlThread([&hr, socket, socketState, this]() { - Q_D(QNativeSocketEngine); + HRESULT hr = QEventDispatcherWinRT::runOnXamlThread([d, socket, socketState, this]() { ComPtr<IBuffer> buffer; HRESULT hr = g->bufferFactory->Create(READ_BUFFER_SIZE, &buffer); - RETURN_OK_IF_FAILED("initialize(): Could not create buffer"); + RETURN_HR_IF_FAILED("initialize(): Could not create buffer"); ComPtr<IInputStream> stream; hr = socket->get_InputStream(&stream); - RETURN_OK_IF_FAILED("initialize(): Could not obtain input stream"); + RETURN_HR_IF_FAILED("initialize(): Could not obtain input stream"); ComPtr<IAsyncBufferOperation> readOp; hr = stream->ReadAsync(buffer.Get(), READ_BUFFER_SIZE, InputStreamOptions_Partial, readOp.GetAddressOf()); - RETURN_OK_IF_FAILED_WITH_ARGS("initialize(): Failed to read from the socket buffer (%s).", - socketDescription(this).constData()); + RETURN_HR_IF_FAILED_WITH_ARGS("initialize(): Failed to read from the socket buffer (%s).", + socketDescription(this).constData()); QMutexLocker locker(&d->readOperationsMutex); d->pendingReadOps.append(readOp); d->socketState = socketState; hr = readOp->put_Completed(Callback<SocketReadCompletedHandler>(d, &QNativeSocketEnginePrivate::handleReadyRead).Get()); - RETURN_OK_IF_FAILED_WITH_ARGS("initialize(): Failed to set socket read callback (%s).", - socketDescription(this).constData()); + RETURN_HR_IF_FAILED_WITH_ARGS("initialize(): Failed to set socket read callback (%s).", + socketDescription(this).constData()); return S_OK; }); if (FAILED(hr)) |