summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@intel.com>2017-11-23 14:42:54 -0800
committerTimur Pocheptsov <timur.pocheptsov@qt.io>2017-11-25 20:50:55 +0000
commit6a9d076e87f0c8aa4fb49bbcc2f56eefd85af2e3 (patch)
tree459c554bb27ebb095df8a847b98b429a4b26388a
parentfa2a653b3b934783065bb3ea264788e9f8bbdc27 (diff)
QUdpSocket: Work around WSARecvMsg quirk relating to no control block
WSARecvMsg does not return the sender in WSAMSG::name if WSAMSG::Control isn't set. This makes no sense, so I'm assuming it's an API quirk we need to work around. [ChangeLog][QtNetwork][QUdpSocket] Fixed a regression from Qt 5.9.3 caused by an apparent Win32 API quirk we triggered when using readDatagram(), resulting in an invalid QHostAddress sender address. receiveDatagram() was not affected. Task-number: QTBUG-64718 Change-Id: I71488efd29b645f7b228fffd14f9d84cc205c4b3 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
-rw-r--r--src/network/socket/qnativesocketengine_win.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/network/socket/qnativesocketengine_win.cpp b/src/network/socket/qnativesocketengine_win.cpp
index 3ecfb06411..a1f7f36700 100644
--- a/src/network/socket/qnativesocketengine_win.cpp
+++ b/src/network/socket/qnativesocketengine_win.cpp
@@ -1215,10 +1215,8 @@ qint64 QNativeSocketEnginePrivate::nativeReceiveDatagram(char *data, qint64 maxL
msg.dwBufferCount = 1;
msg.name = reinterpret_cast<LPSOCKADDR>(&aa);
msg.namelen = sizeof(aa);
- if (options & (QAbstractSocketEngine::WantDatagramHopLimit | QAbstractSocketEngine::WantDatagramDestination)) {
- msg.Control.buf = cbuf;
- msg.Control.len = sizeof(cbuf);
- }
+ msg.Control.buf = cbuf;
+ msg.Control.len = sizeof(cbuf);
DWORD flags = 0;
DWORD bytesRead = 0;