summaryrefslogtreecommitdiffstats
path: root/src/network/socket
Commit message (Collapse)AuthorAgeFilesLines
* Merge remote-tracking branch 'origin/5.5' into devSimon Hausmann2015-06-031-0/+1
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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: Windows 10 compilation fixMaurice Kalinowski2015-05-221-0/+1
| | | | | | | | | | | | | | Header is required for successful compilation. Change-Id: I401b7c6fbc594b3cd0c9a4b25afc8ff918d8bddd Reviewed-by: Andrew Knight <andrew.knight@intopalo.com>
* | QAbstractSocket: remove unused memberAlex Trotsenko2015-05-262-2/+0
| | | | | | | | | | | | Change-Id: I0fa3d9e1b00f38a1b04dddd09ec8c04199ad1f34 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> Reviewed-by: Allan Sandfeld Jensen <allan.jensen@theqtcompany.com>
* | QNativeSocketEngine: add sendmsg(), recvmsg() wrappers on unixAlex Trotsenko2015-04-281-0/+26
| | | | | | | | | | | | | | | | These functions are useful to pass ancillary data such as extended errors, IP options, protocol control information. Change-Id: I27574f73a60909c7199027160ca4689511e56b72 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | QTcpSocket: add an internal c'torAlex Trotsenko2015-04-232-0/+11
| | | | | | | | | | | | | | | | | | This allows further QTcpSocket inheritance in library. Using of this c'tor is applicable to different socket types that makes them consistent with existing TCP socket API. Change-Id: Iafa25c365b88f52d8a3e816a296ee888ceaeb16b Reviewed-by: Richard J. Moore <rich@kde.org>
* | QAbstractSocket: virtualize options settingAlex Trotsenko2015-04-132-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | Some kinds of socket options can be applied only to newly created descriptors. However, a current QAbstractSocket implementation proceeds to actions immediately after the socket layer initialization. This disallows a socket tuning in further inheritance. Add a private virtual configureCreatedSocket() method that gives an ability to set the socket options before binding or connecting. Change-Id: I2d858a400cd46ae7fe5bf0b8900220f6121d0132 Reviewed-by: Richard J. Moore <rich@kde.org>
* | QTcpServer: add debug messages to c'tors and d'torAlex Trotsenko2015-04-131-0/+9
| | | | | | | | | | Change-Id: I257098967a18daf4f9ccd10641fe11c654cc3549 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Merge remote-tracking branch 'origin/5.5' into devLiang Qi2015-04-081-8/+8
|\| | | | | | | Change-Id: I04f9f2749f68c0cb5a427b8d84e43b44bb143e4d
| * QAbstractSocket: fix some 64-bit issues in debug codeAlex Trotsenko2015-04-071-8/+8
| | | | | | | | | | Change-Id: I78b307b2841353f84b033a815035436ec3eef3b0 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Merge remote-tracking branch 'origin/5.5' into devLiang Qi2015-04-063-55/+17
|\| | | | | | | Change-Id: If9fd98525b6b4ca07e5e006fc98bf372a73b8a21
| * Merge remote-tracking branch 'origin/5.4' into 5.5Liang Qi2015-03-313-55/+17
| |\ | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: mkspecs/android-g++/qmake.conf qmake/generators/unix/unixmake2.cpp src/gui/image/qimage_conversions.cpp Change-Id: Ib76264b8c2d29a0228438ec02bd97d4b97545be0
| | * Introduce qt_subtract_from_timeout to reduce code duplication.Daniel Teske2015-03-093-55/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The same qt_timeout_value function was copied 5 times in qtbase's code, so provide a common implementation in QIoDevice that can be used by everyone. This commit also corrects the remaining time calculation in QProcess::waitForBytesWritten and QProcess::waitForFinished by using this new function. For QProcess::waitForFinished, if the process started within almost exactly the timeout time passed to waitForFinished, msecs - stopWatch.elapsed() would be -1, which is a special value. Change-Id: I7b76ee6bae695eafdd02e3db03e2ff1e23a7f40c Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
* | | Virtualize options setting on TCP server socketAlex Trotsenko2015-04-052-11/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently, socket options setting is hardcoded in QTcpServer::listen() function after the engine initialization and before a binding to the address. This disallows a socket tuning in further QTcpServer inheritance. Add a private virtual configureCreatedSocket() method that gives an ability to set the socket options before listening. Change-Id: Ice9b477e64f21daee96c0ec6d27a8408f9e1aa93 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | Merge remote-tracking branch 'origin/5.5' into devLiang Qi2015-04-011-43/+38
|\| | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/testlib/qtestblacklist.cpp src/widgets/accessible/qaccessiblewidgets.cpp Change-Id: If032adb9296428f62384ed835dbf41ee7a0b886c
| * | winrt: Fix UDP socket writeDatagramPeng Wu2015-03-271-43/+38
| | | | | | | | | | | | | | | | | | | | | | | | Remove DataWriter usage and share the write implementation with the rest of the class. Change-Id: I87734d1bf65ad2e602279317c625885d6f829b6a Task-number: QTBUG-44051 Reviewed-by: Oliver Wolff <oliver.wolff@theqtcompany.com>
* | | Merge remote-tracking branch 'origin/5.5' into devSimon Hausmann2015-03-162-243/+176
|\| | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/plugins/platforms/xcb/qxcbnativeinterface.cpp src/plugins/platforms/xcb/qxcbnativeinterface.h Change-Id: I31b38ba439b9341d51a01c0fd54bea33f7410076
| * | QNativeSocketEngine: merge the get/setsockopt level constantsThiago Macieira2015-03-152-207/+151
| | | | | | | | | | | | | | | | | | | | | No point in having them separate, as that's a recipe for mistakes. Change-Id: Iee8cbc07c4434ce9b560ffff13ca4132cd1879ed Reviewed-by: Richard J. Moore <rich@kde.org>
| * | IPv6 scope IDs are unsignedThiago Macieira2015-03-142-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | 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>
| * | QNativeSocketEngine: merge duplicated code for sin6_scope_idThiago Macieira2015-03-141-29/+18
| | | | | | | | | | | | | | | | | | | | | | | | Let's make sure we don't accidentally have it wrong in one of the three versions. Change-Id: Iee8cbc07c4434ce9b560ffff13c9bcf75ba66a66 Reviewed-by: Richard J. Moore <rich@kde.org>
| * | Make sure we also treat QAbstractSocket::AnyIPProtocol as IPv6Thiago Macieira2015-03-122-14/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The native socket engine sets the socketProtocol to that when it means it's using IPv6 with v4 compatibility on (v6only = false). We mustn't have faced problems so far because the multicast tests set don't test v6only = false. Change-Id: Iee8cbc07c4434ce9b560ffff13ca0aff60673940 Reviewed-by: Richard J. Moore <rich@kde.org>
* | | Make QRingBuffer a 64-bit safeAlex Trotsenko2015-03-121-4/+4
|/ / | | | | | | | | | | | | | | | | | | | | According to I/O API, QIODevice and its inherited classes should be able to process a full 64-bit offsets and lengths. This requires 64-bit parameters in operations with internal buffers. Rework QRingBuffer to avoid implicit truncation of numbers and fix some 64-bit issues in code. Change-Id: Iadd6fd5fefd2d64e6c084e2feebb4dc2d6df66de Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Adjust the socket address family before bind()/connect()/sendto()Thiago Macieira2015-03-042-3/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If our socket is already of a given type (probably due to a previous call to bind()), then constrain the incoming target address to be of the same family. On some OSs, trying to send or connect to an IPv4 address from an IPv6 socket will fail with EINVAL, even if the socket is not in "v6only" mode. bind() can't be called after already being bound, but the function can still be called on a socket created by the user and passed on with setSocketDescriptor(). Change-Id: I209a1f8d0c782c6b6de2b39ea4cfad74d63f3293 Reviewed-by: Richard J. Moore <rich@kde.org>
* | Fix bind+connect in both TCP and UDPThiago Macieira2015-03-044-33/+48
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | Merge remote-tracking branch 'origin/5.4' into 5.5Frederik Gladhorn2015-02-245-23/+22
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: examples/xml/htmlinfo/simpleexample.html examples/xml/rsslisting/rsslisting.cpp qmake/generators/win32/msbuild_objectmodel.cpp src/3rdparty/harfbuzz-ng/src/hb-private.hh src/corelib/global/qlogging.cpp src/corelib/io/qstorageinfo_unix.cpp src/corelib/thread/qwaitcondition_unix.cpp src/gui/kernel/qguiapplication.cpp src/plugins/platforms/linuxfb/qlinuxfbintegration.cpp src/testlib/doc/src/qt-webpages.qdoc tests/auto/other/qaccessibility/tst_qaccessibility.cpp Change-Id: Ib272ff0bc30a1a5d51275eb3cd2f201dc82c11ff
| * Save two system calls for setting a socket non-blocking on LinuxThiago Macieira2015-02-155-23/+22
| | | | | | | | | | | | | | | | Linux's socket(2) system call can take SOCK_NONBLOCK and let us avoid the extra two fcntl(2) to change the setting after it's created. Change-Id: Ie0d7a2d51acc21acd850cbee6d0f76e27b1ae859 Reviewed-by: Richard J. Moore <rich@kde.org>
* | Fixed license headersJani Heikkinen2015-02-171-1/+1
| | | | | | | | | | Change-Id: Ibebe1318d1c2de97601aa07269705c87737083ee Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
* | LocalSocket: Do not return early in waitForReadyReadKai Koehne2015-02-161-3/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Do not return early on Windows if bytes are still in the buffer. This is not in line with the behavior on other platforms, and also breaks apps where the caller knows that the bytes available are insufficient. [ChangeLog][Network][QLocalSocket] On Windows, waitForReadyRead now always waits for more data, even if bytes are still in the buffer. Task-number: QTBUG-16688 Change-Id: I1425a5780c7707295374934a6b5446ff8e148cc8 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
* | Pass params of shareable type by const-ref rather than by valueKonstantin Ritt2015-02-132-4/+4
| | | | | | | | | | | | | | | | ...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>
* | Network: Fix operator<<(QDebug, ...) operationsKai Koehne2015-02-122-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | Use the QDebugStateSaver saver(debug); debug.resetFormat().nospace(); idiom to unify the formatting and whitespace handling. Change-Id: Id346d63b3f589b60ca19e4459271d587f1a0c003 Reviewed-by: Richard J. Moore <rich@kde.org>
* | QAbstractSocket: remove unneeded cleanup calls and private memberAlex Trotsenko2015-02-112-14/+2
| | | | | | | | | | | | | | | | | | | | QAbstractSocket::close() always calls QIODevice::close(), which resets QIODevice's internal read buffer. So it makes no sense to make same calls from disconnectFromHost(). This made the closeCalled private member superfluous. Change-Id: I4ec64e9711490e44e737763e4ed7fb41bffe2556 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Update copyright headersJani Heikkinen2015-02-1136-267/+259
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | Merge remote-tracking branch 'origin/5.4' into devFrederik Gladhorn2015-02-102-5/+9
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/3rdparty/harfbuzz-ng/harfbuzz-ng.pro src/gui/image/qimage_conversions.cpp src/gui/opengl/qopenglextensions_p.h src/gui/text/qtextengine.cpp src/network/ssl/qsslsocket_openssl.cpp src/plugins/platforms/eglfs/qeglfshooks_stub.cpp src/plugins/platforms/eglfs/qeglfsscreen.cpp src/plugins/platforms/eglfs/qeglfswindow.cpp src/plugins/platforms/windows/qwindowsfontdatabase.cpp src/plugins/platforms/windows/qwindowsfontdatabase_ft.cpp src/plugins/platforms/windows/qwindowsnativeinterface.cpp src/plugins/platforms/windows/qwindowsscreen.cpp src/plugins/platforms/windows/qwindowswindow.cpp src/plugins/platforms/windows/qwindowswindow.h src/plugins/platforms/xcb/qxcbdrag.h src/widgets/itemviews/qabstractitemview.cpp src/widgets/kernel/qwidget.cpp src/widgets/util/qsystemtrayicon_p.h tests/auto/corelib/itemmodels/qsortfilterproxymodel/tst_qsortfilterproxymodel.cpp Thanks to Friedemann Kleint for resolving the qwindowsfontdatabase.cpp conflicts. Change-Id: I937232c30523d5121c195d947d92aec6f129b03e
| * Do not specifically mention features supported since XPKai Koehne2015-02-041-3/+0
| | | | | | | | | | | | | | We do not support Windows older versions in the first place ... Change-Id: I2cd3135f1b7f2dac6929c07624ea9373f4ac0ff1 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
| * Fix QUdpSocket's emission of readyRead()Thiago Macieira2015-01-221-2/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The documentation says that QUdpSocket emits readyRead() only for one datagram and that if you don't read it, the class will not emit again. That should be implemented by disabling of the socket notifier once we have the datagram already read, but was broken. In turn, that breakage caused a live-lock of the event loop: since we didn't disable the notifier nor read the pending datagram, the event loop would fire every time for the same datagram. The re-enabling of the notifier was already working. Task-number: QTBUG-43857 Change-Id: Ic5d393bfd36e48a193fcffff13bb32ad390b5fe8 Reviewed-by: Peter Hartmann <phartmann@blackberry.com> Reviewed-by: Richard J. Moore <rich@kde.org>
* | QtNetwork: use Q_ENUM instead of Q_ENUMSOlivier Goffart2015-02-081-1/+5
| | | | | | | | | | Change-Id: I531191fae910354abd2e5ceb7c8ecf0519ccad97 Reviewed-by: Peter Hartmann <peter-qt@hartmann.tk>
* | Fix 1700 override warnings [-Winconsistent-missing-override]Sérgio Martins2015-02-031-4/+4
| | | | | | | | | | | | | | | | | | | | | | Classes should either use or not use override, otherwise it hurts code readability. Some inline keywords were removed because of an error with MSVC2010: error C2216: 'override' cannot be used with 'inline' Change-Id: I7276d5525a92281bd0d743beb11d0dc73441443b Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* | Merge remote-tracking branch 'origin/5.4' into devFrederik Gladhorn2015-01-212-6/+0
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/global/global.pri src/corelib/global/qcompilerdetection.h src/corelib/global/qglobal.h src/corelib/tools/qdatetime.cpp src/plugins/platforms/xcb/qxcbscreen.h src/plugins/platforms/xcb/qxcbwindow.h src/widgets/dialogs/qcolordialog.cpp src/widgets/dialogs/qcolordialog_p.h tools/configure/configureapp.cpp Change-Id: Ie9d6e9df13e570da0a90a67745a0d05f46c532af
| * Don't unnecessariy set localAddress in QNativeSocketEngine's nativeBindThiago Macieira2015-01-112-6/+0
| | | | | | | | | | | | | | | | | | The outer QNativeSocketEngine::bind() function will call fetchConnectionParameters() as soon as nativeBind() returns, so don't bother copying localAddress. Change-Id: Ice13e507ccb9c575a7d3bdf0b41394f35230b746 Reviewed-by: Richard J. Moore <rich@kde.org>
* | QTcpServerPrivate: move class definition to the separate headerAlex Trotsenko2015-01-184-39/+118
| | | | | | | | | | | | | | | | This allows further QTcpServer inheritance in library. Also, add protected c'tor for this purpose. Change-Id: I1a5c0cdedd64bcd41b028e09d7752248506296c7 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Merge remote-tracking branch 'origin/5.4' into devFrederik Gladhorn2014-12-292-3/+3
|\| | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/tools/qbytearray.cpp src/gui/kernel/qplatformsystemtrayicon.cpp src/gui/kernel/qplatformsystemtrayicon.h src/plugins/platforms/xcb/xcb-plugin.pro Change-Id: I00355d3908b678af8a61c38f9e814a63df808c79
| * Silence warning in tst_QUdpSocket::multicast for Any+IPv4Thiago Macieira2014-12-241-2/+2
| | | | | | | | | | | | | | | | | | | | QUdpSocket doesn't support binding to QHostAddress::Any and then joining an IPv4 multicat group since QHostAddress::Any is really an IPv6 socket with v6only = false. The test did check this case, but failed to ignore the warning. Change-Id: I62d782408319a6e566e0ff1a6081b706ac1f669c Reviewed-by: Richard J. Moore <rich@kde.org>
| * Fix silly mistake: 0 is a valid file descriptorThiago Macieira2014-12-241-1/+1
| | | | | | | | | | Change-Id: I60baa01f0ef9419a73535c761c4722c5abd6f26e Reviewed-by: Richard J. Moore <rich@kde.org>
* | Merge remote-tracking branch 'origin/5.4' into devSimon Hausmann2014-12-102-1/+5
|\| | | | | | | | | | | | | | | Conflicts: doc/global/template/style/online.css mkspecs/android-g++/qmake.conf Change-Id: Ib39ea7bd42f5ae12e82a3bc59a66787a16bdfc61
| * WinRT: Only set keepalive socket option in certain socket statesOliver Wolff2014-12-052-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | The keepalive socket can only be set if the socket is not connected (see http://msdn.microsoft.com/en-us/library/ie/windows.networking.sockets.streamsocketcontrol.keepalive) Task-number: QTBUG-38623 Change-Id: Ia40dc66f071a8109538e4be7a8f420de81d5be8d Reviewed-by: Alex Trotsenko <alex1973tr@gmail.com> Reviewed-by: Leena Miettinen <riitta-leena.miettinen@theqtcompany.com> Reviewed-by: Andrew Knight <andrew.knight@theqtcompany.com>
* | Add Q_DECL_OVERRIDE in the src subdirectoryOlivier Goffart2014-12-037-131/+131
|/ | | | | | | | | | Done automatically with clang-modernize on linux (But does not add Q_DECL_OVERRIDE to the function that are marked as inline because it a compilation error with MSVC2010) Change-Id: I2196ee26e3e6fe20816834ecea5ea389eeab3171 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* WinRT: Fill data in QUdpSocket::readDatagramOliver Wolff2014-11-162-45/+56
| | | | | | | | | | There was still a TODO left in there and the data was never filled. In addition to filling the data, some pointer checks for addr and port were added. Task-number: QTBUG-42244 Change-Id: I8e358b5544edcdb4077a52f433e4bc17d92014ce Reviewed-by: Andrew Knight <andrew.knight@theqtcompany.com>
* Fix QLocalServer, create a temp path as small as possible.BogDan Vatra2014-10-281-2/+3
| | | | | | | | | If requestedServerName is a full path e.g. "/tmp/some/long/path" the temp path will end up "/tmp/some/long/path.balblabla/tmp/some/long/path" and it might fail because it doesn't fit in addr.sun_path. Change-Id: I6a138fd92be9e0b3b432ab9ac977d04cb330f3fd Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
* Remove redundant permission set.BogDan Vatra2014-10-281-7/+0
| | | | | | | | The temp socket is in a safe place. There is no need to set any permissions at this point. Change-Id: I18ea4b71b7c20db65dc46c57ddc5d34d8b93f577 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
* Removed pointless conditional.BogDan Vatra2014-10-281-6/+4
| | | | | | | | | Mode is always != 0 at this point (QLocalServer::WorldAccessOption is a combination of the bits tested later). Change-Id: I5abfb4e49fdc7903e21398525af05989f40d7f94 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com> Reviewed-by: BogDan Vatra <bogdan@kde.org>
* Fix indentation & coding style.BogDan Vatra2014-10-281-18/+18
| | | | | Change-Id: Id974abca3ee2be9cb70c380a842e76c0ba1520bd Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>