summaryrefslogtreecommitdiffstats
path: root/src/network/socket/qnativesocketengine_unix.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Fix -Wimplicit-fallthrough for clangTim Blechmann2024-03-011-0/+1
| | | | | | | | | | | | | | | | | | | Clang's `-Wimplicit-fallthrough` warnings are a little stricter than gcc's interpretation: switch (i) { case 0: foo(); case 4: break; } While gcc accepts the implicit fallthrough, if the following statement is a trivial `break`, clang will warn about it. Pick-to: 6.7 Change-Id: I38e0817f1bc034fbb552aeac21de1516edcbcbb0 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Handle EWOULDBLOCK the same way as EAGAIN when writing to sockets on UnixŁukasz Matysiak2024-01-281-0/+3
| | | | | | | | | | | | | | | On most platforms EWOULDBLOCK is defined to be equal to EAGAIN. However on some platforms (like VxWorks) it is not the case. Because of that, error returned from ::write is not handled properly on such platform. Since C++ does not allow duplicate switch labels, check if EWOULDBLOCK and EAGAIN have different values before adding EWOULDBLOCK to the switch statement. Task-number: QTBUG-115777 Pick-to: 6.7 Change-Id: I659cb946f239733f5c57b2000fb4e3d296ed9153 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Rename EINTR_LOOP -> QT_EINTR_LOOPMarc Mutz2023-11-301-2/+2
| | | | | | | | | | | | | | | This non-namespaced macro was defined in a header, and while that header is private, we shouldn't define non-namespaced macros in our headers. The macro also clashed with one of the same name defined in forkfd.c, which broke unity-builds including the forkfd_qt.cpp TU. This rename fixes that, too, so we can now remove forkfd_qt.cpp from NO_UNITY_BUILD_SOURCES. Pick-to: 6.6 6.5 Change-Id: Ic4bb4e4d7a632ca87905e48913db788a7c202314 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* qcore_unix: port qt_safe_poll to QDeadlineTimerAhmad Samir2023-10-241-1/+1
| | | | | | | | | | | | | | | | | | | | | | Remove qt_poll_msecs() since the "forever" state can be simply expressed with a QDeadlineTimer::Forever arg, instead of passing a nullptr timespec, and the negative timeouts treated as "run forever" is also encapsulated by QDealineTimer. Use the QDealineTimer(qint64) constructor in the call sites where the timeout could be negative, so that it creates a Forever timer (the QDeadlineTimer(chrono::duration) constructor uses setRemainingTime(duration) which handles negative timeouts by creating expired timers). Remove qt_gettime() (and do_gettime()). Drive-by changes: - Fix a narrowing conversion warning, qt_make_pollfd() takes an int - Remove an unused include Change-Id: I096319af5e191e28c3d39295fb1aafe9d69841e6 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QAbstractSocketEngine: port to QDeadlineTimerAhmad Samir2023-10-071-9/+13
| | | | | | | | | | | | | | | | qnativesocketengine_win.cpp: don't check if timeout is < 0, because remainingTimeAsDuration() doesn't return negative values. All the changes done in one go, not function by function, as that causes the least churn. You can think of them as a couple of very similar changes repeated various times. Drive-by change: replace `forever {` with `for (;;)` Task-number: QTBUG-113518 Change-Id: Ie9f20031bf0d4ff19e5b2da5034822ba61f9cbc3 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* QNativeSocketEngine: fix build with FreeBSD: sockaddr_dl wasn't declaredThiago Macieira2023-09-261-0/+3
| | | | | | | | | | | This partially reverts fcb548878bfae3db34d482f3ad97074aca76b410. qnativesocketengine_unix.cpp:872:40: error: unknown type name 'sockaddr_dl'; did you mean 'sockaddr_in'? Pick-to: 6.6 Change-Id: Ifeb6206a9fa04424964bfffd178844096ee7741b Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* CMake/Network: limit the testing for some network iface featuresThiago Macieira2023-08-301-13/+0
| | | | | | | | | | | | | | | | | | | | | These features are now only used for qnetworkinterface_unix.cpp, so they aren't needed for Windows or for Linux with AF_NETLINK support. This commit removes the last couple of placess outside of that file where they were used (the qnativesocketengine_unix.cpp code looked stale anyway). These tests cost us approximately 1300 ms during CMake time. This commit does not change that because the tests are checked even if the condition has already been forced OFF by previous conditions. [ChangeLog][Build system] The QT_NO_GETIFADDRS and QT_NO_IPV6IFNAME macros are deprecated. On a standard Linux build, they will be defined to 1, even if the system does support getifaddrs() and ifnametoindex(). Task-number: QTBUG-107248 Task-number: QTBUG-115705 Change-Id: Ifbf974a4d10745b099b1fffd17775822a1a6e55f Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Network: Fix IFF_UP conflict on Linux with unity buildsMårten Nordheim2023-05-261-0/+4
| | | | | | | | | | | I cannot repro this myself, but from the bug report it seems to be defined in two headers, so we should consistently use the same one. Fixes: QTBUG-113787 Pick-to: 6.5 Change-Id: I9f1cc51e379c33dbbf659946340a5207aaeb448a Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* QtNetwork: Split out QNativeSocketEnginePrivateFriedemann Kleint2023-02-021-1/+1
| | | | | | | | | | | The aim is to have fewer files including <windows.h>. Pick-to: 6.5 Task-number: QTBUG-109394 Change-Id: Id9cc08f54b5daf6d7e317fad27036dc2efaacbb8 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Amir Masoud Abdol <amir.abdol@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Port from container.count()/length() to size()Marc Mutz2022-10-041-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is semantic patch using ClangTidyTransformator: auto QtContainerClass = expr(hasType(namedDecl(hasAnyName(<classes>)))).bind(o) makeRule(cxxMemberCallExpr(on(QtContainerClass), callee(cxxMethodDecl(hasAnyName({"count", "length"), parameterCountIs(0))))), changeTo(cat(access(o, cat("size"), "()"))), cat("use 'size()' instead of 'count()/length()'")) a.k.a qt-port-to-std-compatible-api with config Scope: 'Container'. <classes> are: // sequential: "QByteArray", "QList", "QQueue", "QStack", "QString", "QVarLengthArray", "QVector", // associative: "QHash", "QMultiHash", "QMap", "QMultiMap", "QSet", // Qt has no QMultiSet Change-Id: Ibe8837be96e8d30d1846881ecd65180c1bc459af Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Make sockets' accept() methods return qintptrMårten Nordheim2022-08-241-2/+2
| | | | | | | | | | | Not necessarily relevant outside windows, where the socket descriptor is SOCKET (= unsigned 64-bit). Also follow their recommendation to not compare to -1, but rather to INVALID_SOCKET. Pick-to: 6.4 6.3 6.2 Change-Id: I0cfa4dfd9e147469132e2e72de22b30eab01e15c Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* wasm: add support for blocking socketsMorten Johan Sørvig2022-06-021-0/+25
| | | | | | | | | | | | | | | | | | | | | Add support for blocking sockets on secondary threads and on the main thread with asyncify. This extends the support for websockify tunneled TCP sockets, which was previously limited to async sockets on the main thread. Blocking sockets support is implemented by emulating select() on top of emscripten's socket notification support. This is requires synchronization between the blockee threads and the main thread, since we get socket notification callbacks on the main thread. The synchronized state is held in g_socketState where the main thread registers socket readiness state and blocking threads register themselves. Blocking using asyncify on the main thread is similar to blocking on a secondary thread, with the exception that the main thread suspends with qt_asyncify_suspend() instead of waiting on a wait condition. Change-Id: Idb5a493644e1e6634057dc2f64f2e99e82e3c01e Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
* Use SPDX license identifiersLucie Gérard2022-05-161-39/+3
| | | | | | | | | | | | | Replace the current license disclaimer in files by a SPDX-License-Identifier. Files that have to be modified by hand are modified. License files are organized under LICENSES directory. Task-number: QTBUG-67283 Change-Id: Id880c92784c40f3bbde861c0d93f58151c18b9f1 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* Fix getsockopt option_value initial initializationPasi Petäjäjärvi2022-02-241-2/+3
| | | | | | | | | | | | | On some platforms, some of the options we're getting the value for may be a single byte, so attempting to read the full int produces garbage. Found with IP_MULTICAST_TTL and IP_MULTICAST_LOOP on QNX. See: https://www.qnx.com/developers/docs/7.1/index.html#com.qnx.doc.neutrino.lib_ref/topic/g/getsockopt.html#getsockopt__IP_MULTICAST_TTL Pick-to: 5.15 6.2 6.3 Change-Id: Id9f7f249c6c4be0c3f94c5904d402b4ec4e17b59 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Consolidate debug string generationAlex Trotsenko2021-05-311-42/+7
| | | | | | | | | | | | | | Several QIODevice subclasses use the qt_prettyDebug() function to get a printable representation of the buffer data for debug output. Rather than having this feature statically implemented in each respective file, this patch introduces a generic function in the QtDebugUtils namespace. Accordingly, some inaccuracies in the use-cases have been corrected. Change-Id: I1a8465cab08c8acf5fdcdba5085182511b1cbb7b Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Add Solaris support in cmake buildNiclas Rosenvik2021-04-211-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | Add SOLARIS cmake platform definition. Add settings for QT_DEFAULT_MKSPEC so that qplatformdefs.h can be found. Solaris has its gssapi symbols in libgss. Solaris supports @ORIGIN. Solaris ld does not support --dynamic-list needed for reduce relocations. Make solaris fail the reduce relocation test. getauxval is specific to GNU libc and some other libc implementations on Linux but sys/auxv.h is not. The bootstrap uses sys/aux.h as the only indication for getauxval. This breaks builds on Solaris, so only make sys/auxv.h an indicator for getauxval on linux or glibc based systems. Solaris uses X11 so add it to the X11_SUPPORTED list. Solaris network libraries for sockets etc are in socket and nsl. ifreq does not have a member ifr_ifindex on Solaris, it uses ifr_index. Add test to check if ifr_index is a member of ifreq. The first struct in the in_addr union on solaris is defined as four uint8_t, therefore four arguments are needed for its initializer list. Change-Id: Ieed4c1bbac8559a7ae1db9c4e1e91f609f150270 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Remove redundant invalid socket checkEdward Welbourne2021-02-181-5/+3
| | | | | | | | | It happens after the same socket check has lead to an early return. Prompted by a PVS-studio article. Change-Id: I63b42abed9102df73d29e6ff8a89a475751d4b91 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Port Q_STATIC_ASSERT(_X) to static_assertGiuseppe D'Angelo2020-06-191-1/+1
| | | | | | | | | | | | | | | | | There is no reason for keep using our macro now that we have C++17. The macro itself is left in for the moment being, as well as its detection logic, because it's needed for C code (not everything supports C11 yet). A few more cleanups will arrive in the next few patches. Note that this is a mere search/replace; some places were using double braces to work around the presence of commas in a macro, no attempt has been done to fix those. tst_qglobal had just some minor changes to keep testing the macro. Change-Id: I1c1c397d9f3e63db3338842bf350c9069ea57639 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Tidy nullptr usageAllan Sandfeld Jensen2019-12-061-3/+3
| | | | | | | | | | | Move away from using 0 as pointer literal. Done using clang-tidy. This is not complete as run-clang-tidy can't handle all of qtbase in one go. Change-Id: I1076a21f32aac0dab078af6f175f7508145eece0 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* QNativeSocketEngine: disable sign-compare warning-turned-error on ClangMarc Mutz2019-07-131-0/+3
| | | | | | | | | | | | | | | | | | On the WASM platform, the macro CMDG_NEXTHDR, which is not under our control, emits a warning about comparing ulong and long with each other, which -Werror turns into an error: qnativesocketengine_unix.cpp:1004:24: error: comparison of integers of different signs: 'unsigned long' and 'long' [-Werror,-Wsign-compare] cmsgptr = CMSG_NXTHDR(&msg, cmsgptr)) { ^~~~~~~~~~~~~~~~~~~~~~~~~~ emsdk/emscripten/1.38.30/system/include/libc/sys/socket.h:286:44: note: expanded from macro 'CMSG_NXTHDR' __CMSG_LEN(cmsg) + sizeof(struct cmsghdr) >= __MHDR_END(mhdr) - (unsigned char *)(cmsg) \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Fix by locally disabling the warning. Change-Id: Ia2ed4318b2ef679b84ac8544835d1e383568ccac Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Use timeout error for TCP timeouts on unixSven Erdem2018-11-111-5/+9
| | | | | | | | | | | | When a TCP connection timed out a QAbstractSocket::NetworkError was set. To enable a more precise error handling for timeouts QAbstractSocket::SocketTimeoutError is now set instead. Separated ETIMEDOUT from other errors in nativeRead() and take over responsibility for setting the error, which was previously handled by read(). Change-Id: Iccd45bdbb3d944cd160ae50c257d3256e05b1ae5 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: David Faure <david.faure@kdab.com>
* QAbstractSocket: Add socketOption for the Path MTUThiago Macieira2017-11-141-0/+30
| | | | | | | | | | | This allow retrieving the value of the known PMTU for the current socket. This works on Linux (IPv6 and IPv4) and FreeBSD (IPv6 only) -- the other OSes don't have the necessary API. Note: do we need add IP_MTU_DISCOVER? Change-Id: I6e9274c1e7444ad48c81fffd14dcaf97a18ce335 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* QNativeSocketEngine: Simplify nativeHasPendingDatagrams()Thiago Macieira2017-09-131-11/+3
| | | | | | | We don't need the sockaddr structure. Change-Id: I6e9274c1e7444ad48c81fffd14da826387d72f83 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* QNativeSocketEngine: reduce memory usage in nativePendingDatagramSize()Thiago Macieira2017-09-131-5/+25
| | | | | | | | | | | | | | | | The Windows implementation had the right idea: by using a chunked read, we can tell the OS to reuse the same buffer over and over, so we don't need to grow a buffer to the size of the datagram when peeking. This commit implements that strategy on Unix and changes both implementations to start at 1500 bytes instead of 8192 (1500 is more than enough for almost all datagrams we're going to receive). Let's also not use a static buffer, but a stack-based one. No need to dedicate 1500 (or, worse, 8192) bytes for something that is only seldom called. Change-Id: I320d9d2f42284a69a4cbfffd14dd92a6775bf28b Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* QUdpSocket: use faster ways to get datagram size on Linux and macOSThiago Macieira2017-08-271-2/+15
| | | | | | | | | | With MSG_TRUNC on Linux, recv/recvfrom/recvmsg will return the full size of the datagram, even if it won't fit the buffer you passed. On Darwin, we have a getsockopt() option to get that value. Change-Id: I6e9274c1e7444ad48c81fffd14da7d5b93815f90 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Merge remote-tracking branch 'origin/5.9' into devLiang Qi2017-04-071-1/+4
|\ | | | | | | | | | | | | | | | | | | Conflicts: mkspecs/linux-icc/qmake.conf mkspecs/macx-icc/qmake.conf mkspecs/win32-icc/qmake.conf src/gui/painting/qgrayraster.c Change-Id: Ib08c45ea3215be05f986ecb3e1f4b37d209aa775
| * Fix GCC warning about dereferencing type-punned pointersThiago Macieira2017-04-061-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | GCC is wrong. Type-punning is when you read something of a given type as something else. We're not doing that, as it's only read as integer. qnativesocketengine_unix.cpp:1011:79: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing] Too bad my plan for a good C++ solution was foiled by glibc developers. Change-Id: I27b55fdf514247549455fffd14b1a27667745e94 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
| * Fix build without features.networkinterfaceTasuku Suzuki2017-04-041-0/+2
| | | | | | | | | | Change-Id: I9fd2a7ec402a1d2d99e30f08554d86f18c6424ff Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* | Merge remote-tracking branch 'origin/5.9' into devLiang Qi2017-03-021-4/+10
|\| | | | | | | Change-Id: I84097f8e7b3b2128028bd7693c913d6968b82bfe
| * Fix multicastMembershipHelper to not assume addresses are IPv4Edward Welbourne2017-02-221-4/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Make it iterate the addresses available looking for an IPv4 address, when that's what it needs, instead of just assuming the first entry in the list (when non-empty) is IPv4. Based on a suggestion by Dmitry Pankratov. Task-number: QTBUG-27641 Change-Id: I1920f68ade44a996ea5c2ed691a87ff3e686f35a Reviewed-by: Marc Mutz <marc.mutz@kdab.com> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Join two else/if lines that were left splitEdward Welbourne2017-02-211-2/+1
|/ | | | | | | Probably after-effects of some #if-ery we removed long ago ... Change-Id: I8bf7a97dc5fda615bf20c37ccd9c1de0ba9194e5 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* Merge remote-tracking branch 'origin/5.7' into devLiang Qi2016-08-161-1/+1
|\ | | | | | | | | | | | | | | | | | | | | | | Conflicts: qmake/doc/src/qmake-manual.qdoc src/corelib/global/qglobal.cpp src/corelib/tools/qstring.cpp src/network/socket/qabstractsocket.cpp src/network/socket/qnativesocketengine_unix.cpp src/plugins/platforms/eglfs/api/qeglfsglobal.h Change-Id: Id5dfdbd30fa996f9b4b66a0b030b7d3b8c0ef288
| * Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-08-101-1/+1
| |\ | | | | | | | | | Change-Id: I1a63523de158757964b6fb5ea026cf69a6c5ddcf
| | * QNativeSocketEngine::option(): return a correct value on invalid callAlex Trotsenko2016-08-051-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Instead of 'true', it should be '-1'. Change-Id: I5e8f99153da68d34b37477ef4cedbc447fba347f Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* | | Fix some syntax issues in SCTP implementationAlex Trotsenko2016-08-031-2/+2
| | | | | | | | | | | | | | | | | | Change-Id: I718fd060e313d544a5470fa20183db04ef89b1ca Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* | | Introduce SCTP sockets supportAlex Trotsenko2016-07-271-22/+160
|/ / | | | | | | | | | | | | Add protocol-specific code and the QSctpServer, QSctpSocket classes. Change-Id: Ie9a1d87bd1fda866a2405043d1c15c12ded5a96e Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Merge remote-tracking branch 'origin/5.6' into 5.7Edward Welbourne2016-07-041-4/+1
|\| | | | | | | Change-Id: Ibd81cd1df4a0650d93fcb556a57be90be2e1f569
| * Replace LLINDEX macro not present on all BSDs with the codeRalf Nolden2016-07-031-4/+1
| | | | | | | | | | | | | | | | | | | | FreeBSD < 10 doesn't have the LLINDEX macro either in net/if_dl.h, so besides OpenBSD yet another condition to declare the LLINDEX macro for systems where it isn't present does make it more complicated than replacing its usage with the actual code. Change-Id: I7e8ef3e265564526e05ec3115f9fa765d399f045 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-06-061-1/+5
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: .qmake.conf config.tests/unix/nis/nis.cpp mkspecs/unsupported/freebsd-g++/qplatformdefs.h src/corelib/tools/qdatetime.cpp src/corelib/tools/qsimd.cpp src/corelib/tools/qsimd_p.h src/network/access/access.pri src/network/access/qnetworkreplynsurlconnectionimpl.mm src/network/access/qnetworkreplynsurlconnectionimpl_p.h src/plugins/platforms/cocoa/qnsview.mm src/plugins/printsupport/windows/qwindowsprintdevice.cpp tests/auto/corelib/kernel/qobject/tst_qobject.cpp tests/auto/network/access/qnetworkreply/BLACKLIST tests/auto/widgets/widgets/qopenglwidget/BLACKLIST Change-Id: I4b32055bbf922392ef0264fd403405416fffee57
| * Compile fix for OpenBSD using Q_OS_OPENBSD definesRalf Nolden2016-05-311-1/+5
| | | | | | | | | | | | | | | | | | OpenBSD does not have EPROTO and LLINDEX.. LLINDEX is only a macro pointing at sdl_index so use the FreeBSD macro from <net/if_dl.h> as a a workaround. Change-Id: Ic3ccecc1b671bb28d14da83ba915ec3fcad2657d Reviewed-by: Richard J. Moore <rich@kde.org>
* | QtNetwork: use const (and const APIs) moreAnton Kudryavtsev2016-04-271-1/+1
| | | | | | | | | | | | | | | | | | | | | | For CoW types, prefer const methods to avoid needless detach()ing. Mark predictNextRequest() as const, because this method does not modify the object. Change-Id: Ic94e2b31445ece46ab1423bf5b5f4e66d9a5b6ca Reviewed-by: Edward Welbourne <edward.welbourne@theqtcompany.com> Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* | Adjust include file for native sockets on INTEGRITY.Rolland Dudemaine2016-03-311-0/+3
| | | | | | | | | | Change-Id: Ibe957eb510fd46d828acedd3e66fa0b49c9a42f0 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
* | Integrate network sockets into the multichannel infrastructureAlex Trotsenko2016-03-011-3/+6
| | | | | | | | | | | | | | Change-Id: I96974a7460c29b46cae8a28aadb3e50cdcdb7beb Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com> Reviewed-by: Allan Sandfeld Jensen <allan.jensen@theqtcompany.com> Reviewed-by: Markus Goetz (Woboq GmbH) <markus@woboq.com>
* | Clean up new poll code slightlyLouai Al-Khanji2016-02-041-13/+2
| | | | | | | | | | Change-Id: I046126ff69a77a50e79efb1b6ebb0fffef67ac8e Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Unix platforms: Use poll in native socket engine instead of selectLouai Al-Khanji2016-02-031-29/+29
| | | | | | | | | | Change-Id: I10fde9f446ee17c921ce9cf356a27daac396321d Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Fix QSocketEngineBackend::nativeBytesAvaible for UDP socketsTimur Pocheptsov2016-01-291-4/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | On OS X ioctl(... FIONREAD) on UDP socket returns more than expected: "SO_NREAD returns the amount of data in the input buffer that is available to be received For datagram oriented sockets, SO_NREAD returns the size of the first packet -- this dif- fers from the ioctl() command FIONREAD that returns the total amount of data available." (man getsockopt). On OS X bytesAvailable for UDP socket seems to include some headers also: for a datagram of size 1 - bytesAvailable == 17, 2 - bytesAvailable == 18 etc. Found in a broken tst_qudpsocket test. Change-Id: I88be827c66208835ed10b010f13d9dc70576fea4 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Updated license headersJani Heikkinen2016-01-211-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | From Qt 5.7 -> tools & applications are lisenced under GPL v3 with some exceptions, see http://blog.qt.io/blog/2016/01/13/new-agreement-with-the-kde-free-qt-foundation/ Updated license headers to use new GPL-EXCEPT header instead of LGPL21 one (in those files which will be under GPL 3 with exceptions) Change-Id: I42a473ddc97101492a60b9287d90979d9eb35ae1 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* | Updated license headersJani Heikkinen2016-01-151-14/+20
| | | | | | | | | | | | | | | | | | | | | | From Qt 5.7 -> LGPL v2.1 isn't an option anymore, see http://blog.qt.io/blog/2016/01/13/new-agreement-with-the-kde-free-qt-foundation/ Updated license headers to use new LGPL header instead of LGPL21 one (in those files which will be under LGPL v3) Change-Id: I046ec3e47b1876cd7b4b0353a576b352e3a946d9 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* | Merge remote-tracking branch 'origin/5.6' into devFrederik Gladhorn2016-01-081-1/+1
|\| | | | | | | | | | | Based on merge done by Liang Qi Change-Id: Id566e5b9f284d29bff2199f13f9417c660f5b26f
| * QNativeSocketEngine: fix undefined variable on FreeBSDDmitry Shachnev2016-01-021-1/+1
| | | | | | | | | | Change-Id: I192e20eef4db27fc19ec9a6e517ae5c8cb88897c Reviewed-by: Marc Mutz <marc.mutz@kdab.com>