summaryrefslogtreecommitdiffstats
path: root/src/network/socket
Commit message (Collapse)AuthorAgeFilesLines
* Fix sporadic hang in QLocalServer::close() in OS X 10.7Robert Knight2011-11-181-4/+4
| | | | | | | | | | | | | | | | | | There is a bug in CFSocket/CFRunLoopSource in OS X 10.7 which can lead to a deadlock in CFRunLoopRemoveSource or CFRunLoopSourceInvalidate if the CFSocket manager thread is concurrently calling CFSocketInvalidate as a result of the socket's file descriptor having been closed. QLocalServer::close() triggers this race by closing the socket fd before unregistering the QSocketNotifier, which internally uses CFSocket. This commit fixes the problem by changing the ordering in close() so that the socket notifier is disabled before closing the file descriptor. This change also makes QLocalServer::close() perform operations in reverse order to QLocalServer::listen(), as would be expected. Task-number: QTBUG-22789 Merge-request: 1470 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
* HTTP proxy engine - accept standard Connection headerShane Kearns2011-11-111-0/+4
| | | | | | | | | | | | | The Proxy-Connection header is a non standard header, but is widely used so forming a de-facto standard. Some proxies use the official Connection header, so we should check for that in responses. Otherwise https connections over http proxy fail in case the proxy sends "Connection: close" with the 407 reply. Task-number: QTBUG-22177 Change-Id: If6cfa4ebb7ac9d97d65b6ddcc8257aee20ac0448 Reviewed-by: Peter Hartmann <peter.hartmann@nokia.com> (cherry picked from commit 0ad18e18d1223b173d4a0d374b70ec08c3b22b11)
* Fix resource leak in symbian socket engineShane Kearns2011-07-081-0/+1
| | | | | | | Timer created when a socket is being used synchronously was not being closed on destruction of the socket engine. Reviewed-by: mread
* Symbian socket engine: remove remaining todo commentsShane Kearns2011-06-302-4/+3
| | | | | | | | | | | | | | | | The writes >16k blocking in the emulator only applies to the winsock connectivity used in S60 SDKs. It doesn't affect the ethernet connectivity used by platform environments. Restarting notifier after error seems like the correct thing to do, and isn't causing any problems. The duplicated code for setting error strings is unfortunate, but a consequence of our decision not to derive from the native socket engine. If symbian ever gets a Qt5 port, we should revisit it there. Task-number: QTBUG-18371 Reviewed-by: Markus Goetz
* Merge branch 'master' of scm.dev.nokia.troll.no:qt/qt-earth-staging into ↵Qt Continuous Integration System2011-06-222-15/+23
|\ | | | | | | | | | | | | master-integration * 'master' of scm.dev.nokia.troll.no:qt/qt-earth-staging: symbian socket engine: resolve some fixme and todo items
| * symbian socket engine: resolve some fixme and todo itemsShane Kearns2011-06-222-15/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | Should be no behaviour changes from this commit, one function is renamed and otherwise it is comment changes. (stuff we were unsure about when creating the code initially but have decided to keep) Multicast is not fully supported by symbian, and out of scope for the QTBUG-7274 task. So the two stub functions are left with the ### comment for the benefit of a future implementor. Task-number: QTBUG-18371 Reviewed-by: Markus Goetz
* | Merge remote-tracking branch 'origin/4.7' into qt-4.8-from-4.7Olivier Goffart2011-05-312-0/+4
|\ \ | |/ |/| | | | | | | | | | | | | | | Conflicts: src/gui/text/qtextengine.cpp src/gui/text/qtextengine_p.h src/gui/text/qtextlayout.cpp src/plugins/phonon/mmf/mmf.pro src/plugins/s60/5_0/5_0.pro tests/auto/qtextlayout/tst_qtextlayout.cpp
| * sockets: limit buffer size of the internal sockets in proxy enginesShane Kearns2011-05-242-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The application can normally control the amount of buffering of a socket or QNetworkReply by using the setReadBufferSize API. This allows the application to flow control the TCP connection, and avoids out of memory errors when the data being downloaded is received faster than the application can process it. However when using a proxy, the proxy socket engine has an internal socket which is used to communicate with the proxy server. It is not visible to the user, and does not have awareness of the buffer size of the external socket. To solve this, we limit the internal sockets' buffer size to 64k bytes. Under normal operation, the data is swiftly copied to the external socket where the buffer can grow (or not) based on the application's set value for read buffer size. Task-number: QT-4966 Reviewed-by: Markus Goetz
| * Merge branch '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-1 into ↵Qt Continuous Integration System2011-05-1733-561/+561
| |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 4.7-integration * '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-1: Updating file with CRLF line endings for the updated header Fix a regression in QList::mid() update gitignore remove -fno-stack-protector Fix make confclean Update licenseheader text in source files
| | * Update licenseheader text in source filesJyri Tahtela2011-05-1333-561/+561
| | | | | | | | | | | | | | | | | | | | | Updated version of LGPL and FDL licenseheaders. Apply release phase licenseheaders for all source files. Reviewed-by: Trust Me
| * | Send User-Agent from the network request in http proxy CONNECT commandShane Kearns2011-05-052-1/+11
| |/ | | | | | | | | | | | | | | | | | | | | | | | | Some proxies can discriminate based on the User-Agent when sent a CONNECT command for establishing a HTTPS connection. With this change, if the User-Agent header is set in the QNetworkRequest then it will be passed to the http socket engine for use in the connect command sent to the proxy. As before, "Mozilla/5.0" will be used by default when no user agent has been set. Task-number: QTBUG-17223 Reviewed-by: Markus Goetz
* | Merge remote-tracking branch 'qt/4.8'Jyri Tahtela2011-05-181-1/+1
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: doc/src/examples/wheel.qdoc src/gui/util/qflickgesture.cpp src/gui/util/qflickgesture_p.h src/gui/util/qscroller.cpp src/gui/util/qscroller.h src/gui/util/qscroller_p.h src/gui/util/qscrollerproperties.cpp src/gui/util/qscrollerproperties.h tests/auto/qscroller/tst_qscroller.cpp
| * | Fix regression that caused waitForXXX(-1) to fail.Thiago Macieira2011-05-161-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Regression was introduced by 8d4cd52b6981a4e6deea7fdb77f56e40c4f3e6ba when it failed to check when msecs == -1. This manifested visibly in KDE failing to connect to any SSL site -- kioslaves are synchronous and use waitForXXX(-1) (in this particular case, waitForEncrypted, which calls waitForReadyRead). Also, take the opportunity to convert these tests in QTcpSocket to use port 80 (a defined service in the test server) instead of port 22. Reviewed-by: Martin Petersson
* | | Update licenseheader text in source files for qt4.8Jyri Tahtela2011-05-1335-595/+595
|/ / | | | | | | | | | | | | Updated version of LGPL and FDL licenseheaders. Apply release phase licenseheaders for all source files. Reviewed-by: Trust Me
* | Merge branch 'symbian-socket-engine' into staging-masterShane Kearns2011-05-106-25/+87
|\ \
| * | Sockets: Fix potential null pointer usagesShane Kearns2011-05-052-8/+13
| | | | | | | | | | | | | | | | | | | | | | | | QAbstractSocketEngine::createSocketEngine can return 0 as well as throw. In two cases the pointer was being used before the null check, in a 3rd case the null check was missing. Reviewed-by: Markus Goetz
| * | Send User-Agent from the network request in http proxy CONNECT commandShane Kearns2011-05-052-1/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some proxies can discriminate based on the User-Agent when sent a CONNECT command for establishing a HTTPS connection. With this change, if the User-Agent header is set in the QNetworkRequest then it will be passed to the http socket engine for use in the connect command sent to the proxy. As before, "Mozilla/5.0" will be used by default when no user agent has been set. Task-number: QTBUG-17223 Reviewed-by: Markus Goetz
| * | Optimisation - buffer packet read in pendingDatagramSizeShane Kearns2011-04-132-9/+56
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In Symbian, the OS function to get the size of a pending datagram also includes the size of the packet header (which is different for IPv4 and IPv6). We were reading the datagram with the "peek" flag set to implement pendingDatagramSize, then reading again normally when the client called read/readDatagram. This change removes the "peek" flag, and buffers the datagram in the socket engine, returning it and clearing the buffer when read or readDatagram is called. If there is no buffered data, the existing code path is followed - it isn't mandatory to call pendingDatagramSize before reading from the socket. Reviewed-by: Markus Goetz
| * | Fix error handling in write for socks socket engineShane Kearns2011-04-121-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | When socks socket engine calls the write function of the native socket engine, it now propagates errors to the abstract socket. Task-number: QTBUG-18713 Reviewed-by: Markus Goetz
| * | Remove warnings when disabling notifications on a closed socketShane Kearns2011-04-121-6/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The generic layer calls setReadNotificationEnabled(false) on sockets after they are closed. This no longer causes a warning from the symbian socket engine. A warning will only be emitted if trying to enable notifications on a closed socket. Task-number: QTBUG-18713 Reviewed-by: Markus Goetz
* | | QAbstractSocket: Fix waitForReadyRead infinite loop.Martin Petersson2011-04-281-2/+2
| | | | | | | | | | | | | | | | | | | | | Make sure that waitForReadyRead times out if the read buffer is full. Task-number: QTBUG-16123 Reviewed-by: Peter Hartmann
* | | Merge branch 'symbian-socket-engine' of scm.dev.troll.no:qt/qt-symbian-networkShane Kearns2011-04-1216-199/+2082
|\ \ \ | |/ / | | | | | | | | | | | | | | | | | | Conflicts: configure.exe src/s60installs/bwins/QtCoreu.def src/s60installs/bwins/QtGuiu.def src/s60installs/eabi/QtCoreu.def
| * | Merge branch 'master' of scm.dev.troll.no:qt/qt-earth-team into ↵Shane Kearns2011-04-1111-2/+42
| |\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | symbian-socket-engine Conflicts: src/s60installs/bwins/QtCoreu.def src/s60installs/bwins/QtGuiu.def src/s60installs/bwins/QtNetworku.def src/s60installs/eabi/QtCoreu.def src/s60installs/eabi/QtGuiu.def src/s60installs/eabi/QtNetworku.def src/s60installs/eabi/QtOpenVGu.def tests/auto/qabstractnetworkcache/tst_qabstractnetworkcache.cpp
| * | | Implement support for sockets started before the event loopShane Kearns2011-04-082-43/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If there is no event loop when a socket notification is enabled, then invoke the method via a queued connection so that it is run again when the event loop is started. This covers sockets created and having an asynchronous API called before calling QCoreApplication::exec(). Reviewed-by: Markus Goetz
| * | | Update address reporting codeShane Kearns2011-04-051-22/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When an IP6 address contains a valid IP4 address, report the address in IP4 format (this is needed for SOCKS5 socket engine) When binding Any or AnyIPv6, create a dual mode socket (KAfUnspec), but report the local address as being the same as what the user requested. (by default, symbian returns ::0 for the dual mode socket, which causes problems for SOCKS and UDP code) The intent is that most applications written for IP4 can work transparently in an IP6 environment. QTcpServer or QUdpSocket can accept either IP4 or IP6 from the same socket. Reviewed-by: Markus Goetz
| * | | Fix multicast group membershipShane Kearns2011-04-051-13/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Although symbian's multicast support is incomplete, this is enough to pass the QUdpSocket test case. (no IGMP/MLD support in the OS) Reviewed-by: Markus Goetz
| * | | Don't reinitialise udp socket when IP versions don't matchShane Kearns2011-04-051-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | An IPv6 socket can send to IPv4 addresses when in a dual mode stack. On symbian, autobinded sockets have the ::0 local address rather than 0.0.0.0 - this check was causing the socket to be destroyed and recreated with every call to writeDatagram. Reviewed-by: Markus Goetz
| * | | Performance: use select poll for timeout of 0msShane Kearns2011-03-291-30/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A timer of 0ms completes on the next kernel tick (up to 0.999ms) There is a poll GetOpt we can use instead that doesn't require using a timer to cancel the select ioctl. Reviewed-by: Markus Goetz
| * | | Merge remote branch 'earth/master' into symbian-socket-engineShane Kearns2011-03-253-1/+13
| |\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/network/access/qhttpnetworkconnectionchannel.cpp src/network/socket/qlocalsocket.cpp src/s60installs/bwins/QtCoreu.def src/s60installs/bwins/QtGuiu.def src/s60installs/bwins/QtTestu.def src/s60installs/eabi/QtCoreu.def src/s60installs/eabi/QtGuiu.def
| * | | | Fix crashing debug messageShane Kearns2011-03-221-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When testing the socks5 socket engine, it closes the socket from within _q_controlSocketError. Frequently a data abort occurs after this when printing the debug message. Moved the debug message before emitting the signal to avoid this. Reviewed-by: Markus Goetz
| * | | | Report correct error from QSymbianSocketEngine::nativeSelectShane Kearns2011-03-221-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Sometimes the error is in the return code from the ioctl, other times it is in the select last error getopt. Treat both error sources the same way and call setError. Return code has higher priority. Reviewed-by: Markus Goetz
| * | | | Implement network session support for synchronous QHostInfoShane Kearns2011-03-221-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Private API, QHostInfoPrivate::fromName, which is called from QAbstractSocket when the network session property is set. Reviewed-by: Markus Goetz
| * | | | Implement QEventLoop::ExcludeSocketNotifiers for symbian socket engineShane Kearns2011-03-172-12/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As the symbian socket engine is driven by an active object in the QtNetwork dll, this needs to hook into the event dispatcher in the QtCore dll. The QActiveObject base class is now a private export from QtCore The method of deferring socket events now works with any kind of QActiveObject, and not only the QSocketActiveObject (which handles "open C" sockets) The base class has a new function, to check if socket events are blocked. If so, it adds the active object to the deferred queue. The derived class should return from it's RunL in this case, which will be called again later. (same usage as the maybeQueueForLater function) reactivateAndComplete function in the event dispatcher is changed to complete the active object again with the same status code as originally. Previously it always used KErrNone, which is not ok for QAsyncSelect as it needs to check the error code from the asynchronous call. Reviewed-by: Markus Goetz Reviewed-by: mread
| * | | | Make creating sockets with an explicit network session thread safeShane Kearns2011-03-151-11/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Added a mutex to QNetworkSessionPrivate Lock the mutex in the symbian bearer plugin for functions that change the validity of the RConnection. Added factory functions to open an RSocket or RHostResolver, which lock the mutex before the esock function calls. If there is no RConnection, then KErrNotReady is returned (the same as when there is an RConnection but it has not been started). Task-number: QTBUG-18143 Reviewed-by: Markus Goetz
| * | | | Remove indirection through fake socket notifier in symbian socket engineShane Kearns2011-03-152-171/+58
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Instead of creating socket notifiers and sending faked events to them, call the engine's notification functions directly. Reviewed-by: Markus Goetz
| * | | | QSymbianSocketEngine: Compile fixMarkus Goetz2011-03-141-1/+1
| | | | |
| * | | | QLocalServer: Fix compilationMarkus Goetz2011-03-141-1/+1
| | | | |
| * | | | QSymbianSocketEngine - return expected error code from bindShane Kearns2011-03-111-1/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In the unix socket engine, EADDRNOTAVAIL is returned by the native call when attempting to bind to a non existant interface. On symbian, the generic KErrNotFound is returned. Specifically for bind() convert KErrNotFound to the expected error code QAbstractSocket::SocketAddressNotAvailableError which is relied on by autotest (and possibly but unlikely, existing applications) Reviewed-by: Markus Goetz
| * | | | Network session support for proxy socket enginesShane Kearns2011-03-102-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The proxy socket engines forward the network session to the "real" socket they use natively. Reviewed-by: Markus Goetz
| * | | | Handle errors returned through select in the waitForXXX socket functionsShane Kearns2011-03-091-0/+13
| | | | | | | | | | | | | | | | | | | | Reviewed-by: Markus Goetz
| * | | | Fix crashShane Kearns2011-03-091-4/+4
| | | | | | | | | | | | | | | | | | | | Reviewed-by: Markus Goetz
| * | | | Thread safety - close RTimer handle when moving threadsShane Kearns2011-03-091-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | RTimer is only usable in the thread it was created. Reviewed-by: Markus Goetz
| * | | | Fix http proxy connections hanging on network errorShane Kearns2011-03-081-4/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The http socket engine was hiding errors other than RemoteHostClosedError. This caused problems, because for other errors, the low level socket is still closed in the native socket engine. By not emitting the read notification, the error was never informed to QAbstractSocket and as a result, the application never gets the disconnected signal. Reviewed-by: Martin Petersson
| * | | | Merge branch 'symbian-socket-engine' of ↵Shane Kearns2011-03-0817-1006/+2139
| |\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | scm.dev.troll.no:qt/qt-symbian-network into symbian-socket-engine Conflicts: src/network/access/qnetworkaccessmanager.cpp tests/auto/qsslsocket/tst_qsslsocket.cpp
| | * | | | Move UDP send length workaround from generic code to symbian engineShane Kearns2011-02-282-11/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Symbian workarounds are better in the symbian socket engine than generic layer, where this is possible. Reviewed-by: Markus Goetz
| | * | | | Do not error socket when writeDatagram would blockShane Kearns2011-02-281-7/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When starting a connection implicitly, datagrams fail with KErrWouldBlock on S60 5.0 and earlier. On symbian 3, they are dropped without error, but the bytes written is set to 0. Due to an apparent bug in symbian, the first packet is failed/dropped on a UDP socket even if the bearer is up due to existing TCP connection. With blocking sockets or explicit RConnection usage, this doesn't happen. Reviewed-by: Markus Goetz
| | * | | | Change an error code for behavioural compatibilityShane Kearns2011-02-281-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | qtcpsocket autotest checks for a specific error Reviewed-by: Markus Goetz
| | * | | | Make socks5 socket engine push session down to real socketsShane Kearns2011-02-251-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This ensures the specified QNetworkSession from the QNetworkAccessManager is used to route the packets, when using a SOCKS proxy. Reviewed-by: Markus Goetz
| | * | | | Fix for read on "connected" UDP socketsShane Kearns2011-02-251-4/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Symbian API RecvOneOrMore only supports stream oriented sockets. So for UDP we use RecvFrom instead and discard the source address. Reviewed-by: Markus Goetz
| | * | | | tst_qnetworkreply: Fix httpProxyCommands() on Windows.Martin Petersson2011-02-221-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | Reviewed-by: Markus Goetz