summaryrefslogtreecommitdiffstats
path: root/src/network/kernel
Commit message (Collapse)AuthorAgeFilesLines
* Tidy nullptr usageAllan Sandfeld Jensen2019-12-069-30/+30
| | | | | | | | | | | 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>
* Avoid initializing QFlags with 0 or nullptr in further casesFriedemann Kleint2019-11-221-1/+1
| | | | | | | | | Amends qtbase/af2daafde72db02454d24b7d691aa6861525ab99. Where applicable, port over to member initialization, thus also fixing nullptr warnings. Change-Id: Iaaf2dbbbcf2952253390b8839fd15a1b17be32c0 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Deprecate constructing QFlags from a pointerAllan Sandfeld Jensen2019-11-202-2/+2
| | | | | | | | | This was used to support QFlags f = 0 initialization, but with 0 used as a pointer literal now considered bad form, it had been changed many places to QFlags f = nullptr, which is meaningless and confusing. Change-Id: I4bc592151c255dc5cab1a232615caecc520f02e8 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Network proxy (macOS) - fix a memory leakTimur Pocheptsov2019-10-271-5/+2
| | | | | | | | | | | there are several conditional statements where we return without releasing a dictionary (which is returned by a function having 'Copy' in its name, thus giving us the ownership == CFRelease is needed). QCFType fixes this issue. Fixes: QTBUG-79524 Change-Id: Id8a8616ad5b6ec21b5e8103bf52b1d9df9ca5c2f Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Remove a new-lineTimur Pocheptsov2019-10-091-1/+0
| | | | | | | that was accidentally introduced this week. Change-Id: I0731c7c64e51b40f230b42694603056d89a05712 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* QAuthenticator - use GSS framework, as Apple requiresTimur Pocheptsov2019-10-091-1/+6
| | | | | | | | | since declarations in gssapi.h are marked as deprecated. Fixes: QTBUG-78810 Change-Id: I241ae4913f362f6e9219438e9bfe7a63dfc91b7c Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* GSSAPI: strengthen configure test and make it a libraryMårten Nordheim2019-10-031-1/+1
| | | | | | | | | | | | | This way we can actually filter out times in sitatuations where it proved to not be available and as a library we can simply "use" it. Added in the pkgConfig source as well to make sure we can pick it up on systems where it has a different name. Fixes: QTBUG-78765 Change-Id: I4754923ddafd9274105e4f93d66a4039872e310c Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> Reviewed-by: André Klitzing <aklitzing@gmail.com>
* Merge remote-tracking branch 'origin/5.13' into 5.14Joerg Bornemann2019-09-201-3/+5
|\ | | | | | | | | | | | | | | Conflicts: qmake/generators/makefile.cpp qmake/generators/makefile.h Change-Id: I4c2deac4f6376c85f5e4fe7fb0ccc9ab9a013cd7
| * Doc: Edit QNetworkProxy::QNetworkProxy() default proxy typeLeena Miettinen2019-09-191-3/+5
| | | | | | | | | | | | Fixes: QTBUG-61771 Change-Id: Ideafe6f8f81c156e941f0548c152021b01b606a1 Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* | qnetconmonitor_win: Mark destructors virtualMårten Nordheim2019-09-131-2/+2
| | | | | | | | | | | | | | | | | | | | | | After these two classes were no longer marked final clang started complaining because their dtor is not marked virtual. Amends 9dc594b2bf3572aa5df3ec3ad2b9842c96e8290d Change-Id: I42b78c0b444935d3e0cb4d476d3881fd5fb5c3cb Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* | Merge remote-tracking branch 'origin/5.13' into 5.14Liang Qi2019-09-041-0/+1
|\| | | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/codecs/qicucodec.cpp src/dbus/qdbusserver.cpp src/gui/painting/qbezier.cpp src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsgbmscreen.cpp src/plugins/printsupport/cups/qppdprintdevice.cpp Change-Id: I2703128bb64baf5580fbc2c2061b55b0f0611d2a
| * Fix reporting the network interface type on macOS 10.14.5 and laterKarsten Heimrich2019-08-281-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | * initialize the structure used as argument to ioctl SIOCGIFMEDIA The ioctl in ifType(...) returned -1 and set errno to EFAULT, thus the code to determine the interface type was not executed. Task-number: QTBUG-76408 Change-Id: Ib69c2c0cd4dda3604d568adf9746e0c9a280e9a0 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Karsten Heimrich <karsten.heimrich@qt.io> Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
| * Merge remote-tracking branch 'origin/5.12' into 5.13Liang Qi2019-08-051-6/+6
| |\ | | | | | | | | | | | | | | | | | | | | | Conflicts: qmake/generators/unix/unixmake2.cpp src/plugins/platforms/cocoa/qcocoawindow.mm Change-Id: Iba7aa7324f35543e0297a3680956420058cd3630
| | * Plug a memory leak introduced in e24a4976bebd7ca90deac2b40c08900625773Volker Hilsheimer2019-07-311-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | While it is correct not to call the functor when the context object has been destroyed, we still need ot clean up the slotObj. It's a low- probability memory leak: the context object has to disappear while waiting for a host resolution, and for repeated requests for the same host the cache takes over anyway. Task-number: QTBUG-76276 Change-Id: Id9daf391353b8252443f3186a7d504d70c553b24 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* | | Fix some qdoc warnings in 5.14Friedemann Kleint2019-09-031-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Mark QCalendarBackend as internal since it is in a private header and fix some issues in the QCalendar related classes. src/corelib/time/qcalendar.cpp:201: (qdoc) warning: clang found diagnostics parsing \fn int QCalendarBackend::daysInMonth(int month, int year) const error: incomplete type 'QCalendarBackend' named in nested name specifier (repeats) src/corelib/time/qdatetime.cpp:1426: (qdoc) warning: Unknown command '\override' (repeats) src/corelib/time/qcalendar.cpp:642: (qdoc) warning: Undocumented enum item 'Last' in QCalendar::System src/corelib/time/qcalendar.cpp:642: (qdoc) warning: Undocumented enum item 'User' in QCalendar::System src/corelib/time/qcalendar.cpp:744: (qdoc) warning: Undocumented parameter 'year' in QCalendar::isLeapYear() src/corelib/time/qcalendar.cpp:923: (qdoc) warning: Can't link to 'dateTimeString()' (repeats) src/corelib/time/qcalendar.cpp:893: (qdoc) warning: No such parameter 'year' in QCalendar::partsFromDate() src/corelib/time/qcalendar.cpp:893: (qdoc) warning: No such parameter 'month' in QCalendar::partsFromDate() src/corelib/time/qcalendar.cpp:893: (qdoc) warning: No such parameter 'day' in QCalendar::partsFromDate() src/corelib/time/qdatetime.cpp:1425: (qdoc) warning: Undocumented parameter 'nmonths' in QDate::addMonths() src/corelib/time/qdatetime.cpp:1467: (qdoc) warning: Undocumented parameter 'nyears' in QDate::addYears() src/corelib/statemachine/qstatemachine.cpp:2522: (qdoc) warning: Undocumented enum item 'StateMachineChildModeSetToParallelError' in QStateMachine::Error src/corelib/kernel/qtimer.cpp:602: (qdoc) warning: Undocumented parameter 'connectionType' in QTimer::callOnTimeout() src/corelib/time/qcalendar.cpp:159: (qdoc) warning: Undocumented parameter 'name' in QCalendarBackend::QCalendarBackend() src/corelib/time/qcalendar.cpp:159: (qdoc) warning: Undocumented parameter 'id' in QCalendarBackend::QCalendarBackend() src/corelib/time/qcalendar.cpp:529: (qdoc) warning: Can't link to 'registerCalendar()' src/corelib/time/qcalendar.cpp:529: (qdoc) warning: Can't link to 'fromName()' src/corelib/time/qcalendar.cpp:178: (qdoc) warning: Can't link to 'QCalendar::fromEnum()' src/corelib/time/qcalendar.cpp:405: (qdoc) warning: Undocumented parameter 'jd' in QCalendarBackend::dayOfWeek() src/corelib/time/qcalendar.cpp:405: (qdoc) warning: Can't link to 'weekDayName()' src/corelib/time/qcalendar.cpp:405: (qdoc) warning: Can't link to 'standaloneWeekDayName()' src/corelib/time/qcalendar.cpp:268: (qdoc) warning: Can't link to 'daysInMonth()' src/corelib/time/qcalendar.cpp:268: (qdoc) warning: Can't link to 'isLeapYear()' src/corelib/time/qcalendar.cpp:295: (qdoc) warning: Can't link to 'daysInMonth()' src/corelib/time/qcalendar.cpp:313: (qdoc) warning: Can't link to 'isLuniSolar()' src/corelib/time/qcalendar.cpp:313: (qdoc) warning: Can't link to 'isSolar()' src/corelib/time/qcalendar.cpp:313: (qdoc) warning: Can't link to 'isLunar()' src/corelib/time/qcalendar.cpp:340: (qdoc) warning: Can't link to 'daysInMonth()' src/corelib/time/qcalendar.cpp:357: (qdoc) warning: Can't link to 'daysInMonth()' src/corelib/time/qcalendar.cpp:544: (qdoc) warning: Can't link to 'fromName()' Change-Id: Ia2fabefb917f8e4cfa361044d9b754717276f4aa Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* | | QNetworkConnectionMonitor(win): Fix memory leakMårten Nordheim2019-08-251-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Through some misconceptions about ComPtr I ended up thinking that it did not call AddRef internally on creation. But it does. This lead to always having > 1 ref-counter. Also stop the monitor on destruction if it hasn't already been stopped. As was already done for QNetworkStatusMonitorPrivate. Change-Id: Ic72a2f5cb3325f86c018f90b497caaec834cb214 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* | | QNetworkConnectionMonitor: Fix compilation with older Windows KitsFriedemann Kleint2019-08-131-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Remove "final" since it has problems with 10.0.15063.0: qnetconmonitor_win.cpp C:\Program Files (x86)\Windows Kits\10\include\10.0.15063.0\winrt\wrl/client.h(61): error C3246: 'Microsoft::WRL::Details::RemoveIUnknownBase<T>': cannot inherit from 'QNetworkConnectionEvents' as it has been declared as 'final' with [ T=QNetworkConnectionEvents ] kernel\qnetconmonitor_win.cpp(102): note: see declaration of 'QNetworkConnectionEvents' kernel\qnetconmonitor_win.cpp(373): note: see reference to class template instantiation 'Microsoft::WRL::Details::RemoveIUnknownBase<T>' being compiled with [ T=QNetworkConnectionEvents ] C:\Program Files (x86)\Windows Kits\10\include\10.0.15063.0\winrt\wrl/client.h(61): error C3246: 'Microsoft::WRL::Details::RemoveIUnknownBase<T>': cannot inherit from 'QNetworkListManagerEvents' as it has been declared as 'final' with [ T=QNetworkListManagerEvents ] kernel\qnetconmonitor_win.cpp(468): note: see declaration of 'QNetworkListManagerEvents' kernel\qnetconmonitor_win.cpp(650): note: see reference to class template instantiation 'Microsoft::WRL::Details::RemoveIUnknownBase<T>' being compiled with [ T=QNetworkListManagerEvents ] Change-Id: Ia35545b65acaebea3fcff194884be8a156974123 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* | | Refactor memory allocation for arguments of QMetaCallEventsVolker Hilsheimer2019-08-101-7/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There are two cases: In a BlockingQueuedConnection, QMetaCallEvent doesn't allocate memory and instead passes already existing pointers through. A QSemaphore is used to serialize data access between threads. So the constructor taking a QSemaphore can be simplified to only accept an existing arg array. In a QueuedConnection, QMetaCallEvent needs to make deep copies of the arguments, and memory needs to be allocated based on the number of arguments. The previous code put the burden of memory allocation on the code generating the event, while the memory was free'd by ~QMetaCallEvent. Instead, make it QMetaCallEvent's responsibility to allocate and free the memory as needed, and adjust the code generating QMetaCallEvents. We can allocate the memory for types and pointers to arguments in a single block, starting with the space for the array of void*, followed by the space for the array of integers to avoid byte alignment issues. By pre-allocating the space that's needed by three arguments, we can avoid all mallocs for the majority of QMetaCallEvents. Until this change has propagated through qt5.git, we need to keep the old API that is still used by QtDeclarative around. Once QtDeclarative has migrated to the new API, it can be removed. Change-Id: Id7359ffc14897237ea9672dabae9ef199a821907 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | | Unify and simplify the QHostInfo::lookupHost overloadsVolker Hilsheimer2019-08-072-127/+92
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The three cases - with classic slot, with functor and context object, and with lambda - are all doing the same work, they just differ in how they signal the application code about the results. The detour through an explicitly posted QMetaCallEvent is needed if we have a functor or lambda; making sure that the temporary QHostInfoResult object lives in the right thread guarantees that the event is received in the correct thread, so we can directly call the functor (as long as the context object is still alive). Since we guarantee that the QHostInfoResult object lives in the thread of the receiver, we can simply emit the signal for old-style signal/slot connections; the regular signal/slot mechanism will do the work for us. Change-Id: I584df17df879af01c653e354490c4691dbedd3fa Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* | | Merge remote-tracking branch 'origin/5.13' into devLiang Qi2019-07-302-10/+49
|\| | | | | | | | | | | | | | | | | | | | Conflicts: qmake/generators/win32/mingw_make.cpp Change-Id: I2f790bc8572bd22fea01edf7ca74595b29f063eb
| * | Merge remote-tracking branch 'origin/5.12' into 5.13Qt Forward Merge Bot2019-07-292-10/+49
| |\| | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/io/qresource.cpp Change-Id: I54917f72444a621bd08aeaa15f5d17415993144d
| | * QHostInfo: Always post results through the event loop to the receiverVolker Hilsheimer2019-07-262-10/+49
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Lookups performed via QHostInfoRunnable must not synchronously call the user-code's receiver objects, as that would execute user-code in the wrong thread. Instead, post a metacall event through the event loop of the receiver object, or the thread that initiated the lookup. This was done correctly for the trivial cases of empty host name or cached results, so the code generally existed. By moving it from a global function into a member function of QHostInfoResult, we can simply access the required data to construct and post the event. As we process that posted event, we need to check that the context object (which is already guarded via QPointer) is still alive, if we had one in the first place. If we had one, and it's deleted, then abort. [ChangeLog][QtNetwork][QHostInfo] Functors used in the lookupHost overloads are now called correctly in the thread of the context object. When used without context object, the thread that initiates the lookup will run the functor, and is required to run an event loop. Change-Id: I9b38d4f9a23cfc4d9e07bc72de2d2cefe5d0d033 Fixes: QTBUG-76276 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* | | QHostInfo: un-QObject-ify QHostInfoLookupManagerMarc Mutz2019-07-192-9/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QObjects are not even reentrant, but this class must be thread-safe, so it's always ... icky ... to have to analyze a "thread-safe QObject", because for all intents and purposes, that's an oxymoron. The QObject-ness isn't even used, except for defining a private slot, connected to QCoreApplication::destroyed(). That slot just calls waitForDone() on QThreadPool, which is a QObject itself, so use it as the context object for the signal-slot connection, using a lambda as slot. So, strip the class of it's base class, convert the private slot to a lambda and connect to that. Finally, remove the moveToThread() call, because this new class can be destroyed from any thread, not just the main one. Change-Id: I0e33983aa7afd0ad621ece4afd10d9e4adad38c1 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* | | QHostInfo: remove unused QAbstractHostInfoLookupManagerMarc Mutz2019-07-192-29/+10
| | | | | | | | | | | | | | | | | | | | | | | | If it was used in the past, it no longer is, and can't be, because it's not exported. Change-Id: Ifb9c353e756add5b57bf0c5706c075bb2eb41d83 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* | | QHostInfo: port from recursive to non-recursive mutexMarc Mutz2019-07-182-7/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It turns out that the only reason a recursive mutex is used was because work() was locking it. But work() was only ever called from functions that already had locked the mutex themselves, and kept it locked across the call to work(). Clearly mark work() as expecting to be called with the mutex held (by renaming the function to rescheduleWithMutexHeld(), then drop the mutex locking from it. After this change, a non-recursive mutex suffices, so save the memory allocation and extra complexity involved with recursive mutexes. Looking at the non-QT_CONFIG(thread) code in rescheduleWithMutexHeld(), one might be tempted to expect a recursive mutex, since that code calls QHostInfoRunnable::run() directly, which, in turn, recurses into QHostInfoLookupManager whence control came, under mutex lock. But in non-QT_CONFIG(thread) builds, QMutex is but an empty shell, all of its operations are no-ops, so no possibility for deadlock, either. Change-Id: Ic01d90c2ed3995b66ccf946d146fdaa6f9af3d8b Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* | | QHostInfo: add nothrow move constructorMarc Mutz2019-07-182-5/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QHostInfo isn't implicitly shared. The more important to optimize away copies by providing a move constructor. Port from QScopedPointer to Q_DECLARE_PRIVATE, as otherwise the move ctor can't be inline, and we don't implement move ctors out-of-line in Qt. [ChangeLog][QtNetwork][QHostInfo] Added move contructor. Change-Id: I6b63a04e36f63e299205830fdc590ff7e2af338b Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* | | Merge "Merge remote-tracking branch 'origin/5.13' into dev"Qt Forward Merge Bot2019-07-172-24/+19
|\ \ \
| * | | Merge remote-tracking branch 'origin/5.13' into devQt Forward Merge Bot2019-07-172-24/+19
| |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/global/qlogging.cpp src/gui/painting/qtextureglyphcache_p.h src/gui/text/qfontengine.cpp src/widgets/widgets/qlineedit.cpp Change-Id: Ic8798538df466b7141caa8bbf1fb7605eb56be37
| | * | Merge remote-tracking branch 'origin/5.12' into 5.13Qt Forward Merge Bot2019-07-122-24/+19
| | |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: configure.pri Also required s/solid\.color/solidColor/ in a couple of places in: src/gui/painting/qpaintengine_raster.cpp Change-Id: I29937f63e9779deb6dac7ae77e2948d06ebc0319
| | | * QHostInfo: fix a race condition on QHostInfoCache::enabledMarc Mutz2019-07-092-17/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In auto-test-enabled builds, QHostInfoCache can be enabled and disabled using qt_qhostinfo_enable_cache() at any time. We cannot rule out that users use this function, or, indeed, that the auto-test never gets a threading stress-test. Under the assumption, then, that QHostInfoCache::enabled can be set by any thread at any time, and is read by any thread using QHostInfo::lookupHost(), we're presented with a data race, thus UB. Fix by making the accesses to QHostInfoCache::enabed atomic. Relaxed operations are suffcient, as the bool is the only data of interest in these situations. In particular, access to the cache itself is protected by the cache's mutex. We use std::atomic<bool> because QAtomicInteger<bool> doesn't exist on all implementations, but std::atomic<bool> must. Commit a0faf9e2366 set the precedent that it works. Change-Id: Ia1766753bb54c5fe8d8447b51a49a96a7a853eef Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
| | | * QHostInfo: fix a race condition on wasDeletedMarc Mutz2019-07-051-7/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The plain bool variable wasDeleted is set to true in the QHostLookupManager dtor before the call to clear(), which calls waitForDone() on the thread pool performing the lookups. All tasks on the thread pool start by checking this variable so as to return early when destruction is in progress. But the check was outside the mutex-protected area, so as a non-atomic load, without a happens-before relation to the write, this is a Data Race, thus UB. Fix by moving the check past the mutex locking into the critical section. This way, tasks that were waiting for the mutex after seeing no wasDeleted before get the message reliably. This does not introduce a dead-lock, since the call to waitForDone() is outside any mutex protection leaving a window for the tasks to obtain the mutex and react on wasDeleted. Change-Id: Ied4b9daa7dc78295b0d36a536839845c4db2fb78 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> Reviewed-by: David Faure <david.faure@kdab.com>
* | | | Win: qnetconmon: Use CoInitialize instead of CoInitializeExMårten Nordheim2019-07-171-2/+2
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | Somehow I didn't test using QNetwork{Status,Connection}Monitor together with Gui. In qwindowstheme.cpp we call CoInitialize and as such we cannot use CoInitializeEx with a different thread mode. Change-Id: If4a4441cc2616371d8b7cda72cfad11187d8f153 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* | | QHostInfoRunnable: make the lookupFinished() call more robustMarc Mutz2019-07-091-8/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | Use a scope guard to reliably mark the runnable as finished with the manager, lest a deleted runnable lingers in the manager's currentLookups for too long/ever. Change-Id: I89eff49931d0428f4e75789a0a1188edb1f66220 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* | | QHostInfo: perform deferred cleanup (std::any_of)Marc Mutz2019-07-081-8/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | The code contained a copy of std::any_of from a time when we couldn't rely it's availability in all compilers. We now can, so remove the copy. Change-Id: I356077f58ae6a48b71f2dd98a2dab4e2acf985c7 Reviewed-by: Anton Kudryavtsev <antkudr@mail.ru> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* | | Add manual test for QNetwork{Connection|Status}MonitorMårten Nordheim2019-07-081-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Simplistic console application with one test for each of the two classes. Simply tests that we receive the signal when the connection is disrupted in some way. This patch also exports the classes for tests/developer builds so that we can actually link with them. Change-Id: I8066312274350984110c3f3ad3e94854adca7c2a Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* | | qnetconmonitor: Fix misspelling of accessibleMårten Nordheim2019-07-084-6/+6
| | | | | | | | | | | | | | | Change-Id: Ia898d305f64abb5d3d1de007c764c143b26c7654 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* | | Introduce QNetwork(Connection|Status)Monitor to WindowsMårten Nordheim2019-07-082-0/+712
| | | | | | | | | | | | | | | | | | | | | | | | Currently not available for mingw because it's missing all the interfaces. But should start working once it has them. Change-Id: I231e8b69e008c5300a83087fe9cd071acd0687cb Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* | | QtNetwork: port remaining uses of QMutex::Recursive to QRecursiveMutexMarc Mutz2019-07-063-5/+4
| | | | | | | | | | | | | | | | | | | | | In one case, added NSDMI to avoid churning the ctor-init-list. Change-Id: I5587d5cb7e393f60ad29cb5186127304d27d1d46 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | Remove unused qmutexpool_p.h includesMarc Mutz2019-06-292-2/+0
| | | | | | | | | | | | | | | Change-Id: Ic5f56b12953f2e42d94f6e6c14fac166c0c75539 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* | | Port from QAtomic::load() to loadRelaxed()Giuseppe D'Angelo2019-06-201-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Semi-automated, just needed ~20 manual fixes: $ find \( -iname \*.cpp -or -iname \*.h \) -exec perl -pe 's/(\.|->)load\(\)/$1loadRelaxed\(\)/g' -i \{\} + $ find \( -iname \*.cpp -or -iname \*.h \) -exec perl -pe 's/(\.|->)store\(/$1storeRelaxed\(/g' -i \{\} + It can be easily improved (e.g. for store check that there are no commas after the opening parens). The most common offender is QLibrary::load, and some code using std::atomic directly. Change-Id: I07c38a3c8ed32c924ef4999e85c7e45cf48f0f6c Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* | | QNetworkStatusMonitor - make it always enabled on DarwinTimur Pocheptsov2019-05-101-16/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | Also undo changes in setNetworkAccessible and setConfiguration since they introduced a change in behavior, which results in auto-test failing. Change-Id: I5d74c47338bff8f964ba2e27256902c79303e00f Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* | | Introduce QNetworkConnection/Status/MonitorTimur Pocheptsov2019-05-024-1/+712
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Private classes to replace broken or even not working at all 'session management' and 'bearer manager' (on at least two major platforms we support). This implementation is macOS/iOS-specific and uses SystemConfiguration framework, or more precisely SCNetworkReachability's part of it. Task-number: QTBUG-40332 Change-Id: Iac5f44c4063c4092b93b8cf2bde3fb2c524855b3 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* | | Remove handling of missing Q_COMPILER_RVALUE_REFSAllan Sandfeld Jensen2019-05-014-21/+0
| | | | | | | | | | | | | | | | | | | | | | | | Remove remaining handling of missing support for rvalue refs. Change-Id: I78bab8bccfeeb9c76f464f345874364a37e4840a Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | Consolidate Unix and Windows implementations of QHostInfo::fromNameVolker Hilsheimer2019-04-304-247/+178
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The implementations were practically identical, so we can just move the code into qhostinfo.cpp, cleaning up things along the way. Since QHostInfoAgent is an internal class, add the shared code as additional static helper functions. And since half the code already used QCoreApplication::translate anyway, we can remove the QObject inheritance which was only added for getting a tr(). Change-Id: I58eafbdc3e7d06d2e898486a1add63cd63d98c96 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | Merge remote-tracking branch 'origin/5.13' into devQt Forward Merge Bot2019-04-291-3/+8
|\| | | | | | | | | | | Change-Id: Ic712e8a84b01b212bb1121d7a2c9b85e0d2da9da
| * | Merge remote-tracking branch 'origin/5.12' into 5.13Qt Forward Merge Bot2019-04-281-3/+8
| |\| | | | | | | | | | Change-Id: Ibce9bfef928ce39070183c488ce86ae32e5ea705
| | * Document that QHostInfo does not guarantee to return all IP addressesVolker Hilsheimer2019-04-251-3/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Using getaddrinfo, which implements RFC 6724, implies that addresses that are not needed will be trimmed. In particular, IPv6 addresses are often not returned. Also move the implementation detail documentation down in the text, it's a detail with little relevance for the usage of the class, but makes for a good opener regarding this behavior. Change-Id: I516a64f0b39a6a06621a63c1d5236544b7758049 Fixes: QTBUG-31865 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | Merge "Merge remote-tracking branch 'origin/5.13' into dev" into ↵Liang Qi2019-04-241-2/+2
|\ \ \ | | | | | | | | | | | | refs/staging/dev
| * | | Merge remote-tracking branch 'origin/5.13' into devLiang Qi2019-04-241-2/+2
| |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/gui/util/qshaderformat.cpp src/gui/util/qshaderformat_p.h src/widgets/graphicsview/qgraphicsitem_p.h Change-Id: Idafd88eb9a0a15b4af29f6143d009c1ec8ceecca
| | * | Merge remote-tracking branch 'origin/5.12' into 5.13Qt Forward Merge Bot2019-04-241-2/+2
| | |\| | | | | | | | | | | | | Change-Id: I26da00aa71b0f0b91c9bfb4a9e8550345ee62875