summaryrefslogtreecommitdiffstats
path: root/src/network/kernel/qhostinfo.cpp
Commit message (Collapse)AuthorAgeFilesLines
* QtNetwork: replace Java-style iteratorsAnton Kudryavtsev2016-04-191-39/+46
| | | | | | | | | | | | | | ... with STL-style iterators or with algorithms. Java-style iterators have overhead. Introduce local template separate_if algorithm from kleopatra project to simplify current code. http://api.kde.org/4.3-api/kdepim-apidocs/kleopatra/html Done-with: Marc Mutz <marc.mutz@kdab.com> Change-Id: Ib154f80f46f8041d9cafd81bed0e1982b21541cf Reviewed-by: Edward Welbourne <edward.welbourne@theqtcompany.com> Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* QHostInfo: optimize container usageAnton Kudryavtsev2016-03-131-24/+38
| | | | | | | | | | | | | | | Replace Java-style iterators with STL-style iterators. Java-style iterators have overhead. Use std::stable_partition with erase() instead of using remove() in a loop, with quadratic complexity. Introduce local template homebrew any_of (analog of std::any_of from C++11) to simplify current code. Also it's needed for following changes in this class. Change-Id: I2b11889ccc7630597c72aa20cdb266ae6ca2471a Reviewed-by: Marc Mutz <marc.mutz@kdab.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 the multiple implementations of getting the local hostnameThiago Macieira2015-08-131-2/+14
| | | | | | | | | | | | | | | | 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>
* Fix bind+connect in both TCP and UDPThiago Macieira2015-03-041-0/+11
| | | | | | | | | | | | | | | | | This has been known to be broken for a while. Now it works: you can bind and you'll retain the port (and the file descriptor) for the connect call. Incidentally, in fixing the binding for more than one IP for the hostname (with event loop), this commit fixes the setSocketDescriptor XFAIL. [ChangeLog][QtNetwork] Fixed a bug that caused both QTcpSocket and QUdpSocket to close the socket and lose any bound ports before connecting. Now bind()/setSocketDescriptor() followed by connect() will retain the original file descriptor. Task-number: QTBUG-26538 Change-Id: I691caed7e8fd16a9cf687b5995afbf3006bf453a Reviewed-by: Richard J. Moore <rich@kde.org>
* Pass params of shareable type by const-ref rather than by valueKonstantin Ritt2015-02-131-1/+1
| | | | | | | | ...where passing them by value was not intentional. Change-Id: Ifd5036d57b41fddeeacfbd3f5890881605b80647 Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Update copyright headersJani Heikkinen2015-02-111-7/+7
| | | | | | | | | | | | | | | | | | Qt copyrights are now in The Qt Company, so we could update the source code headers accordingly. In the same go we should also fix the links to point to qt.io. Outdated header.LGPL removed (use header.LGPL21 instead) Old header.LGPL3 renamed to header.LGPL3-COMM to match actual licensing combination. New header.LGPL-COMM taken in the use file which were using old header.LGPL3 (src/plugins/platforms/android/extract.cpp) Added new header.LGPL3 containing Commercial + LGPLv3 + GPLv2 license combination Change-Id: I6f49b819a8a20cc4f88b794a8f6726d975e8ffbe Reviewed-by: Matti Paaso <matti.paaso@theqtcompany.com>
* Avoid double cache lookup in QHostInfoCacheJędrzej Nowacki2015-01-131-2/+1
| | | | | Change-Id: If5ef2d2f117fe8c1abdf361f1122e32075e14385 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Update license headers and add new license filesMatti Paaso2014-09-241-19/+11
| | | | | | | | | - Renamed LICENSE.LGPL to LICENSE.LGPLv21 - Added LICENSE.LGPLv3 - Removed LICENSE.GPL Change-Id: Iec3406e3eb3f133be549092015cefe33d259a3f2 Reviewed-by: Iikka Eklund <iikka.eklund@digia.com>
* Replace Note: with \note in documentationKurt Pattyn2014-03-131-1/+1
| | | | | | Change-Id: I213ac1fb2733e675f3641441fe6c621bab06c1f0 Reviewed-by: Peter Hartmann <phartmann@blackberry.com> Reviewed-by: Richard J. Moore <rich@kde.org>
* Increase the number of concurrent DNS lookups.Richard J. Moore2014-02-161-1/+1
| | | | | | | | | | Modern websites use around 15 hosts on average so the limit of 5 DNS looks meant that most non-trivial sites have to wait for at least one unneeded round trip. Task-number: QTBUG-30866 Change-Id: I584dd46c247e0413b2ed88dd66f111cff08ff987 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Allow QHostInfo::lookupHost() with no receiver to warm the DNS cache.Richard Moore2013-02-201-1/+8
| | | | | | | | | This change lets you call QHostInfo::lookupHost() with a null receiver in order to warm up the DNS cache. This allows you to try to get the DNS request in flight early. Change-Id: Icfdd28146479aa534ae9ceb472f75e08aaa39cd2 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Increase the size of the QHostInfo cache.Richard Moore2013-02-061-2/+2
| | | | | | | | | | This change increases the size of the DNS cache in QHostInfo from 64 entries to 128. Given the figures in the google chrome performance paper http://www.igvita.com/posa/high-performance-networking-in-google-chrome/ this should mean we can cache enough entries to handle 4 tabs at once. Change-Id: I34e32e9e0966473591c59ca5f222623a354650d2 Reviewed-by: Peter Hartmann <phartmann@rim.com>
* Update copyright year in Digia's license headersSergio Ahumada2013-01-181-1/+1
| | | | | Change-Id: Ic804938fc352291d011800d21e549c10acac66fb Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Change copyrights from Nokia to DigiaIikka Eklund2012-09-221-24/+24
| | | | | | | | Change copyrights and license headers from Nokia to Digia Change-Id: If1cc974286d29fd01ec6c19dd4719a67f4c3f00e Reviewed-by: Lars Knoll <lars.knoll@digia.com> Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
* QtNetwork: use nullary version of qRegisterMetaType<T>("T")Marc Mutz2012-07-251-1/+1
| | | | | | | | | | | | | | | | | Using the nullary version has the advantage that multiple calls during a program run are much more efficient, since an inlined atomic is used to store the result. It also ensures that Q_DECLARE_METATYPE(T) has been used, whereas qRegisterMetaType<T>("T") will happily register anything. So I've added the macro where it was missing, or moved it to a central place when it existed hidden. In tst_qnetworkreply, this became a bit tricky, because a private header is conditionally included, so moved the Q_DECLARE_METATYPE() into a conditional section, too. Change-Id: I71484523e4277f4697b7d4b2ddc3505375162727 Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
* Doc: Modularize QtNetwork documentation.Casper van Donderen2012-05-091-6/+6
| | | | | | | This change moves the snippets and imagesto the modularized directories. Change-Id: If14912692a7f72d7de345eaf88d9ec9752310fca Reviewed-by: Marius Storm-Olsen <marius.storm-olsen@nokia.com>
* Remove "All rights reserved" line from license headers.Jason McDonald2012-01-301-1/+1
| | | | | | | | | | As in the past, to avoid rewriting various autotests that contain line-number information, an extra blank line has been inserted at the end of the license text to ensure that this commit does not change the total number of lines in the license header. Change-Id: I311e001373776812699d6efc045b5f742890c689 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Update contact information in license headers.Jason McDonald2012-01-231-1/+1
| | | | | | | Replace Nokia contact email address with Qt Project website. Change-Id: I431bbbf76d7c27d8b502f87947675c116994c415 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Fixed build break when bearer is disabled.Xizhi Zhu2012-01-161-0/+2
| | | | | Change-Id: I29e88b046f6502c84acc9c6f566ecc328cf24e38 Reviewed-by: Peter Hartmann <peter.hartmann@nokia.com>
* Update copyright year in license headers.Jason McDonald2012-01-051-1/+1
| | | | | Change-Id: I02f2c620296fcd91d4967d58767ea33fc4e1e7dc Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* network: remove Symbian specific codePeter Hartmann2011-11-141-43/+0
| | | | | | | | removes several files and cleans up the code, removing all Symbian specific #ifdef's etc. Change-Id: Ie457e54cb4b3a992f251383320d47822259c38f1 Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Fix memory leak in QHostInfoShane Kearns2011-07-081-0/+1
| | | | | | | | | | | | | | QHostInfo was leaking in the code path where it removes duplicate name lookups after one has completed. Task-number: QT-5121 Reviewed-by: Markus Goetz (cherry picked from commit 73df7890923f377f19147466d9317fe1ec064b1d) Change-Id: I26cc6a168ef8ea6cc18940300ca2eddd6777071d Reviewed-on: http://codereview.qt.nokia.com/1363 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Markus Goetz
* Update licenseheader text in source files for qtbase Qt moduleJyri Tahtela2011-05-241-17/+17
| | | | | | | Updated version of LGPL and FDL licenseheaders. Apply release phase licenseheaders for all source files. Reviewed-by: Trust Me
* Fix compilationOlivier Goffart2011-05-101-1/+0
| | | | | Conflicts between 61c6d66b7efd8de4a83b021e7c4ef2b1a803ece2 and 940f16babab76b328b7c9bfdb5435102c689b76b (cherry picked from commit 7a20cf9d4419cf1a5a9a4ed450b03caa8716fd58)
* Fixes warnings about unused variablesOlivier Goffart2011-05-101-0/+1
| | | | | Reviewed-by: Peter Hartmann (cherry picked from commit 61c6d66b7efd8de4a83b021e7c4ef2b1a803ece2)
* Fix warnings on unused parameters and variablesThiago Macieira2011-05-101-1/+1
| | | | (cherry picked from commit 940f16babab76b328b7c9bfdb5435102c689b76b)
* Initial import from the monolithic Qt.Qt by Nokia2011-04-271-0/+808
This is the beginning of revision history for this module. If you want to look at revision history older than this, please refer to the Qt Git wiki for how to use Git history grafting. At the time of writing, this wiki is located here: http://qt.gitorious.org/qt/pages/GitIntroductionWithQt If you have already performed the grafting and you don't see any history beyond this commit, try running "git log" with the "--follow" argument. Branched from the monolithic repo, Qt master branch, at commit 896db169ea224deb96c59ce8af800d019de63f12