summaryrefslogtreecommitdiffstats
path: root/src/network/kernel
Commit message (Collapse)AuthorAgeFilesLines
* Merge remote-tracking branch 'origin/5.6' into devFrederik Gladhorn2016-01-085-176/+40
|\ | | | | | | | | | | Based on merge done by Liang Qi Change-Id: Id566e5b9f284d29bff2199f13f9417c660f5b26f
| * winrt: Use "await" with its timeout for dns queriesOliver Wolff2016-01-051-17/+28
| | | | | | | | | | | | | | | | | | | | By using await instead of using a custom wait function we get rid of a lot of "function was called at an unexpected time" warnings and use the default way of waiting for an asynchronous function to complete. Change-Id: I6c5bf73ccf68a219b8f3facd3531873d7e8d4c67 Reviewed-by: Maurice Kalinowski <maurice.kalinowski@theqtcompany.com>
| * winrt: Use winsock2 API for hostname resolution on WinRT/WinPhoneOliver Wolff2016-01-053-158/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | That API has been available for WinRT and Windows Phone for some time now. By using it to get the machine name and for hostname resolution we can get rid of some winrt-only code and use qhostinfo_win.cpp on WinRT and Windows phone as well. Additionally the required capability was added to tst_qhostinfo so that this auto test can be run without any manual editing. Change-Id: I63fa5521bf8cdb0c919bd5a0100ea977c865622a Reviewed-by: Maurice Kalinowski <maurice.kalinowski@theqtcompany.com>
| * Docu: fix documentation of QHostAddress() default constructor.David Faure2015-12-221-1/+1
| | | | | | | | | | | | | | | | | | In Qt3 this would indeed be equivalent to QHostAddress("0.0.0.0"). But since Qt4, it creates an address of type Null, and QHostAddress()==QHostAddress("0.0.0.0") is no longer true. Change-Id: I28025421e77c861783c612c2225be345dad5615a Reviewed-by: Martin Smith <martin.smith@theqtcompany.com>
* | Merge remote-tracking branch 'origin/5.6' into devLiang Qi2015-12-185-11/+40
|\| | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/gui/painting/painting.pri src/plugins/platforms/xcb/qxcbconnection.cpp tests/auto/corelib/thread/qthreadstorage/qthreadstorage.pro tests/auto/corelib/tools/qlocale/test/test.pro tests/auto/gui/kernel/qwindow/tst_qwindow.cpp tools/configure/environment.cpp Change-Id: I9c40f458b89b2c206de2d2c24e90b5f679c93495
| * QtNetwork: Standardize error message about IPv6 addresses for nameservers.v5.6.0-beta1Friedemann Kleint2015-12-144-4/+9
| | | | | | | | | | | | | | | | Add a const char * message with QDnsLookupRunnable's translation context and use that for untranslated warnings and errorString. Change-Id: I1b6c9fb259fb9ff824a0c3829b2c00c36aaecdfa Reviewed-by: Richard J. Moore <rich@kde.org>
| * QNetworkInterface: fix support for address labels on Linux interfacesThiago Macieira2015-12-081-7/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit 64a1448d87727878d9789906b2f4f5b9e3d74e38 (Qt 5.2) caused QNetworkInterface to report address labels (a.k.a. interface aliases) as separate interfaces. This is caused by the fact that glibc, uClibc and MUSL copy the address label (netlink address attribute IFA_LABEL) to the ifa_name field, which made QNetworkInterfaceManager think that it was an interface it hadn't yet seen. Address labels are the old way to add more than one IP address to an interface on Linux, for example: ifconfig eth0:1 192.0.2.2 Those do not create a new interface, so the "eth0:1" label maps to the same interface index as the parent interface. This has been deprecated for 10 years, but there are still tools out there that add addresses in this manner. This commit restores behavior compatibility with Qt 4.2-5.1. The Qt 5.2-5.5 behavior is incorrect because it reports more than one interface with the same index. On systems configured like the above, the tst_QNetworkInterface::interfaceFromXXX test was failing. Change-Id: I8de47ed6c7be4847b99bffff141c2d9de8cf7329 Reviewed-by: Richard J. Moore <rich@kde.org>
* | Haiku: Fix compilation of network libraryTobias Koenig2015-12-081-0/+4
| | | | | | | | | | | | | | | | | | Like on some BSD systems, the member of the ifreq structure is called ifr_index and not ifr_ifindex on Haiku OS. Change-Id: I273de0c703b1c89dbac537c68e52db219d2da50e Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Properly set (sa|sin|sin6)_len on Unix systems that need itThiago Macieira2015-12-051-0/+2
| | | | | | | | | | Change-Id: I7de033f80b0e4431b7f1ffff13f90288a50606e7 Reviewed-by: Richard J. Moore <rich@kde.org>
* | Merge remote-tracking branch 'origin/5.6' into devLiang Qi2015-12-023-4/+4
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/kernel/qcoreapplication.cpp src/corelib/kernel/qeventdispatcher_blackberry.cpp src/network/bearer/qnetworkconfiguration.cpp src/plugins/bearer/blackberry/qbbengine.cpp src/plugins/platforms/android/androidjnimain.cpp src/plugins/platforms/android/qandroidplatformtheme.cpp src/plugins/platforms/qnx/qqnxbpseventfilter.cpp src/plugins/platforms/qnx/qqnxfiledialoghelper_bb10.cpp src/plugins/platforms/qnx/qqnxinputcontext_imf.cpp src/plugins/platforms/qnx/qqnxintegration.cpp src/plugins/platforms/qnx/qqnxnavigatorbps.cpp src/plugins/platforms/qnx/qqnxvirtualkeyboardbps.cpp src/plugins/platforms/qnx/qqnxwindow.cpp src/widgets/kernel/qwidgetwindow.cpp src/widgets/styles/qwindowsvistastyle.cpp src/widgets/styles/qwindowsxpstyle.cpp src/widgets/widgets/qtoolbararealayout.cpp tests/auto/corelib/global/qflags/qflags.pro tests/auto/corelib/itemmodels/qitemmodel/modelstotest.cpp tests/auto/corelib/tools/qversionnumber/qversionnumber.pro tests/auto/widgets/dialogs/qfilesystemmodel/tst_qfilesystemmodel.cpp Change-Id: I37be88c6c185bb85404823353e027a0a6acdbce4
| * QDnsLookup: fix grammar in a user-visible stringMarc Mutz2015-11-281-2/+2
| | | | | | | | | | Change-Id: I6bda83c750d2e2c0a2325aae259836bb96d92a11 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
| * QtBase: remove explicit function info from qWarning() etcMarc Mutz2015-11-283-3/+3
| | | | | | | | | | | | | | | | | | | | | | This information is already registered by the QMessageLogger ctor. Where, by dropping the << Q_FUNC_INFO in ostream-style qDebug(), only a string literal remained, converted to printf-style qDebug() on the go. Change-Id: I3f261c98fd7bcfa1fead381a75a82713bb75e6f3 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* | Merge remote-tracking branch 'origin/5.6' into devLiang Qi2015-11-232-10/+28
|\| | | | | | | | | | | | | | | Conflicts: src/corelib/kernel/qcoreapplication.cpp src/corelib/thread/qthread_unix.cpp Change-Id: Ia08d613c3f0bd08cb6dc3e3a57257207dfd4a099
| * Use standard error handling in qhostinfo_winrt.cppOliver Wolff2015-11-191-9/+19
| | | | | | | | | | Change-Id: I83555bf9952c01c68fb270a7e1f88ac0ee6ed373 Reviewed-by: Andrew Knight <andrew.knight@intopalo.com>
| * winrt: Set error if host cannot be found in QHostInfoAgent::fromNameOliver Wolff2015-11-191-1/+6
| | | | | | | | | | | | Task-number: QTBUG-49478 Change-Id: Iab745100621db51219a42d575020783f6e9f310a Reviewed-by: Andrew Knight <andrew.knight@intopalo.com>
| * winrt: no assert when device is in airplane mode/has no internet connectionOliver Wolff2015-11-191-0/+3
| | | | | | | | | | | | Task-number: QTBUG-49478 Change-Id: I1b95ca736d454f82f84374554e6cdec2555d29de Reviewed-by: Andrew Knight <andrew.knight@intopalo.com>
* | Remove remaining support for BlackberryLouai Al-Khanji2015-11-213-179/+0
| | | | | | | | | | | | | | | | | | The platform is no longer supported or actively maintained, and is in the way for improvements to the Unix event dispatcher and QProcess implementations. Change-Id: I3935488ca12e2139ea5f46068d7665a453e20526 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* | Merge remote-tracking branch 'origin/5.6' into devLiang Qi2015-11-181-52/+93
|\| | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/io/qprocess.cpp src/corelib/io/qprocess_unix.cpp src/network/kernel/qnetworkinterface_winrt.cpp tools/configure/configureapp.cpp Change-Id: I47df00a01597d2e63b334b492b3b4221b29f58ea
| * winrt: Also list current profile in QNetworkInterface::allInterfacesOliver Wolff2015-11-091-52/+94
| | | | | | | | | | | | | | | | | | | | GetConnectionProfiles does not list the current profile, so "allInterfaces" also has to use GetInternetConnectionProfile. Task-number: QTBUG-49121 Change-Id: I80a3ea1bfddfe502c84376ca90a7e1fe5d3020c3 Reviewed-by: Samuel Nevala <samuel.nevala@intopalo.com> Reviewed-by: Andrew Knight <andrew.knight@intopalo.com>
* | Add QNetworkInterface::interface{IndexFromName,NameFromIndex}Thiago Macieira2015-10-156-9/+157
|/ | | | | | | | | | These are for faster lookups between ID and name when one doesn't need the full information set about the interface. Change-Id: I7de033f80b0e4431b7f1ffff13f98d448a705c3e Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> Reviewed-by: Oliver Wolff <oliver.wolff@theqtcompany.com> Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com>
* Libraries: Fix single-character string literals.Friedemann Kleint2015-10-133-5/+5
| | | | | | | Use character literals where applicable. Change-Id: I8e198774c2247c1cc1d852a41b59b301199b7878 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* Merge remote-tracking branch 'origin/5.5' into 5.6Liang Qi2015-10-021-17/+22
|\ | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: qmake/doc/src/qmake-manual.qdoc src/corelib/tools/qstring.h src/gui/image/qimagereader.cpp src/network/access/qnetworkaccessmanager.cpp src/tools/qdoc/doc/examples/examples.qdoc src/widgets/accessible/qaccessiblewidgetfactory_p.h src/widgets/doc/qtwidgets.qdocconf Change-Id: I8fae62283aebefe24e5ca4b4abd97386560c0fcb
| * Doc: Improve documentation for QAuthenticatorKai Koehne2015-09-011-17/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Make it explicit what 'isNull()' is really about. and mention which data type is in the QVariant stored in the options. Fix the links to the Options section in the summary: So far they where pointing to the options() method. Fix capitalization and trailing dots. Change-Id: I030c0a273e784b28d642ae40b28e36b0d406c920 Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
* | Mark QHostAddress relocatableThiago Macieira2015-09-221-0/+1
| | | | | | | | | | Change-Id: Iee8cbc07c4434ce9b560ffff13ca3fb80be56be6 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* | Clean up some Apple-related includes and declarations.Jake Petroules2015-09-221-0/+1
| | | | | | | | | | Change-Id: I92db9691c2243ae72ecd4e11dd4640afaf4bf822 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
* | QNetworkInterface: get a friendlier (but not too friendly) nameThiago Macieira2015-09-132-1/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Since Windows Vista, the OS keeps an extra set of names for each interface, which are identifier-like and more friendly than previously, but not the user-description. For example: previous name: "{2B09D370-A032-4478-8444-495AD9301D67}" new name: "wireless_6" friendly name: "Local Area Connection* 12" Change-Id: I7de033f80b0e4431b7f1ffff13f995f983689f06 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
* | Use the actual iphlpapi.dll and its headersThiago Macieira2015-09-133-293/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | The has been present since Windows 2000 and most functions we need have been present since Windows XP and Windows CE 5.0. There's no need to do runtime detection anymore. This was necessary in Qt 4.2, when this code was introduced, because we still supported Windows 98 and Me, including Windows platform SDKs that lacked the necessary header definitions. Change-Id: I076d1e8bbd53469a24fad72cf58b1905e737f52a Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
* | Declare QNetworkAddressEntry and QNetworkInterface as metatypesThiago Macieira2015-09-131-0/+3
| | | | | | | | | | Change-Id: I7de033f80b0e4431b7f1ffff13f98c092ea3ba3e Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* | Remove vestiges of Qt's own sockaddr_in6 and sockaddr_storageThiago Macieira2015-08-223-16/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We weren't using qt_sockaddr_storage, so it's not a problem. But since we're not using it anyway, we don't really need it. The storage is only needed if we needed to get a bigger socket address and that only happens with Unix sockets (paths). sockaddr_in6, however, was just wrong. Some systems derived from BSD, like OS X, have a sXX_len field containing the length of the socket address structure and our qt_sockaddr_in6 was missing sin6_len. As a result, setting sin6_family was just plain wrong on little-endian systems. Like all modern systems running BSDs and OS X... Change-Id: I7de033f80b0e4431b7f1ffff13f900f004c55443 Reviewed-by: Richard J. Moore <rich@kde.org>
* | QHostAddress: Improve code generationThiago Macieira2015-08-191-47/+52
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Mostly related to IPv6, because Q_IPV6ADDR is an array of char, so the compilers were generating byte access to each value. Instead, force access as 32- and 64-bit in most places that make sense (64-bit access decays to 32-bit on 32-bit machines). In one isLoopback(), this is now a 128-bit access for best improvement. Some smaller improvements relating to SpecialAddress by combining the three IPv4 special addresses. Change-Id: I7de033f80b0e4431b7f1ffff13f932b1cd7b5d21 Reviewed-by: Richard J. Moore <rich@kde.org>
* | QHostAddress hashing: use qHashBitsThiago Macieira2015-08-161-1/+1
| | | | | | | | | | | | | | | | Instead of constructing a temporary QByteArray, which could conceivably fail, to hash those bits. Change-Id: I7de033f80b0e4431b7f1ffff13fa376302d9720f Reviewed-by: Richard J. Moore <rich@kde.org>
* | QNetworkInterface: remove fallback code for Windows pre-XP and CE pre-4Thiago Macieira2015-08-161-56/+0
| | | | | | | | | | | | | | | | All versions we support have support for the WinXP-style functions we need, so we don't need the Win2k fallback. Change-Id: I7de033f80b0e4431b7f1ffff13f99175a507a2ed Reviewed-by: Richard J. Moore <rich@kde.org>
* | Fix thread-safety of qnetworkinterface_win.cpp:resolveLibsThiago Macieira2015-08-161-3/+4
| | | | | | | | | | Change-Id: Ia4b5103c9c590c24de9a43c5c7097b0c7b83e679 Reviewed-by: Richard J. Moore <rich@kde.org>
* | QNetworkInterface: make the name lookup search numbers in string formsThiago Macieira2015-08-162-5/+21
| | | | | | | | | | | | | | | | That's how QHostAddress::scopeId() stores them, so we ought to look them up the same way. Change-Id: I7de033f80b0e4431b7f1ffff13f98cf87d45ebc6 Reviewed-by: Richard J. Moore <rich@kde.org>
* | QNetworkInterface: Merge the two sections of code that do SIOCGIFxxxThiago Macieira2015-08-161-21/+21
| | | | | | | | | | | | | | | | The separation was accidental due to refactoring. It does not need to exist. Change-Id: I7de033f80b0e4431b7f1ffff13f988adc47d57d5 Reviewed-by: Richard J. Moore <rich@kde.org>
* | QNetworkInterface: prefer SIOCGIFINDEX over if_nametoindexThiago Macieira2015-08-161-1/+6
| | | | | | | | | | | | | | | | | | | | On Linux (on a bad system without getifaddrs), the ioctl for SIOCGIFINDEX should be faster than if_nametoindex. The ioctl on the already open socket will require one syscall, while if_nametoindex will require at least one more (to open the socket), probably more. Change-Id: I7de033f80b0e4431b7f1ffff13f9888bf2044105 Reviewed-by: Richard J. Moore <rich@kde.org>
* | Add QHostAddress::isMulticastThiago Macieira2015-08-152-0/+17
| | | | | | | | | | | | | | | | This complements QHostAddress::isLoopback. The only missing check now is for the "Any" address types, though operator== is quite fast nowadays. Change-Id: Iee8cbc07c4434ce9b560ffff13cc2691e15014b6 Reviewed-by: Richard J. Moore <rich@kde.org>
* | Fix warning of unused variableThiago Macieira2015-08-151-2/+1
| | | | | | | | | | | | | | | | Only happens on systems without getifaddrs, which we aren't usually testing. Change-Id: I7de033f80b0e4431b7f1ffff13f9889f5cfdea5b Reviewed-by: Richard J. Moore <rich@kde.org>
* | QHostAddress: don't inline the parse() functionThiago Macieira2015-08-141-1/+1
| | | | | | | | | | | | | | | | It's called everywhere due to QT_ENSURE_PARSED and it's big. There's no need to duplicate it everywhere. Change-Id: I7de033f80b0e4431b7f1ffff13fa383f29114712 Reviewed-by: Richard J. Moore <rich@kde.org>
* | Doc: Remove the section about IPv6 site-local addressesThiago Macieira2015-08-131-5/+0
| | | | | | | | | | | | | | | | | | | | Site-local addresses were deprecated in RFC 3879 (September 2004) and RFC 4193 (October 2005) replaced them with Unique Local Address. ULAs are part of the global range but supposedly unique to an organization. Change-Id: I7de033f80b0e4431b7f1ffff13f98d2124c5cffc Reviewed-by: Martin Smith <martin.smith@digia.com> Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
* | Merge the multiple implementations of getting the local hostnameThiago Macieira2015-08-134-62/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit moves the functionality from QtNetwork's QHostInfo to QtCore. Note that due to Windows ws2_32.dll's quirky behavior of requiring WSAStartup before calling gethostname, this change required moving the initialization to QtCore too. On Linux systems, gethostname() gets the name from uname(), so we bypass the middle man and save one memcpy. Change-Id: I27eaacb532114dd188c4ffff13d32655a6301346 Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com> Reviewed-by: Oliver Wolff <oliver.wolff@theqtcompany.com> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | QtNetwork: Use Q_NULLPTR instead of 0 in all public headersMarc Mutz2015-07-191-3/+3
| | | | | | | | | | | | | | | | | | This is in preparation of adding -Wzero-as-null-pointer-constant (or similar) to the headers check. Task-number: QTBUG-45291 Change-Id: I9a05d375d2d9d3ed56079ad024c89a08a290619b Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | QtNetwork: make all Q_DECLARE_SHARED types nothrow move-assignableMarc Mutz2015-06-304-21/+50
| | | | | | | | | | Change-Id: Ib29ec4b73a4cdc51074997f7d167c289cf5af7a4 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* | network: Use QList::reserve(), reduces reallocations.Sérgio Martins2015-06-271-0/+2
| | | | | | | | | | | | Change-Id: Ie0e8cbd28802826206d7e92584b5d56bb844fb09 Reviewed-by: Marc Mutz <marc.mutz@kdab.com> Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* | Merge remote-tracking branch 'origin/5.5' into devSimon Hausmann2015-06-031-1/+0
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/global/qnamespace.qdoc src/corelib/io/qwindowspipereader.cpp src/corelib/io/qwindowspipereader_p.h src/corelib/statemachine/qstatemachine.cpp src/corelib/statemachine/qstatemachine_p.h src/plugins/platforms/xcb/qxcbconnection.h tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp tests/auto/tools/qmake/tst_qmake.cpp tests/manual/touch/main.cpp Change-Id: I917d694890e79ee3da7d65134b5b085e23e0dd62
| * WinRT/Winphone: Fix warnings in qtbaseOliver Wolff2015-05-181-1/+0
| | | | | | | | | | | | Change-Id: I41725bcfeee0124b259e96f1e3a261e30f14350a Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com> Reviewed-by: Maurice Kalinowski <maurice.kalinowski@theqtcompany.com>
* | Remove <qhash.h> where it's not usedMarc Mutz2015-04-201-1/+0
|/ | | | | | | | To avoid source-incompatibilites, wrap in QT_DEPRECATED_SINCE(5, 5) in public headers. Change-Id: I6117e8a6b11200d2f1a0a94a0e87d5c27538218e Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* IPv6 scope IDs are unsignedThiago Macieira2015-03-141-1/+1
| | | | | | | | We need to make sure that a large scope ID saved in a QString does get converted properly back to an integer. Change-Id: Iee8cbc07c4434ce9b560ffff13c9bd0e9008bd9c Reviewed-by: Richard J. Moore <rich@kde.org>
* QHostAddress: add IPv6 address overloads that take const dataThiago Macieira2015-03-122-6/+35
| | | | | | | | It has been a historical mistake that there wasn't a const overload. Change-Id: Ia0aac2f09e9245339951ffff13c8d8b70f206a99 Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> Reviewed-by: Richard J. Moore <rich@kde.org>
* Fix NTLM possible data corruptionThiago Macieira2015-03-071-1/+1
| | | | | | | | | A mistake in const correctness resulted in the incoming QByteArray getting modified when it shouldn't. I have no ldea if this could result in user-visible effects. Change-Id: Ia0aac2f09e9245339951ffff13c8d8c6b4f909bd Reviewed-by: Richard J. Moore <rich@kde.org>