summaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
...
| | * | | | Add explicit network session support for async QHostInfoShane Kearns2011-03-183-5/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Pass the shared network session pointer into the QSymbianHostResolver (which maintains a reference for its lifetime). This is used to open the RHostResolver handle, in order to get a host resolver which is associated with a particular session. The session is obtained from the _q_networksession property of the QAbstractSocket, as in the symbian socket engine Reviewed-by: Markus Goetz
| | * | | | handle errors in QSymbianHostResolver::requestHostLookupShane Kearns2011-03-182-31/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It was hanging because although the error flags were set, the callback was not emitted and nothing was done with the return value from the function. Now, it sets the state to error, and self completes - so that the completion through RunL is used as normal. Because the state is error, the processing of name/address is skipped and the error string is not rewritten. Note, error being detected at this point is only common when using an explicit network session (as RHostResolver::Open can fail if the RConnection is in the wrong state) Reviewed-by: Markus Goetz
| | * | | | Fix "wrong lookup id" warning from QAbstractSocketShane Kearns2011-03-182-7/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Symbian host info implementation was using default constructor for the results, which sets the id to -1, and storing the id seperately. Changed this to use the constructor that specifies the id, and use the id inside the results instead of storing it separately (just a change to the accessor function) Reviewed-by: Markus Goetz
| | * | | | QHostInfo: Compile fix for non-SymbianMarkus Goetz2011-03-171-1/+1
| | | | | |
| | * | | | Implement QEventLoop::ExcludeSocketNotifiers for symbian socket engineShane Kearns2011-03-174-47/+77
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| | * | | | Implementation of async DNS lookup.Aaron Tunney2011-03-173-18/+473
| | | | | | | | | | | | | | | | | | | | | | | | Reviewed-by: Shane Kearns
| | * | | | Implement IPv6 in symbian QNetworkInterfaceShane Kearns2011-03-161-45/+83
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For IPv6 interfaces, the network mask is reported correctly, so we use that. For IPv4 interfaces, the network mask is reported as 0.0.0.0 so the existing workaround to get the netmask from routes is used. For loopback interfaces, the mask can be statically determined. Skip checking the routes if proper masks were reported for all the interfaces. Added a helper function for converting TInetAddr -> QHostAddress using the constructors that take binary data. (better than conversion to/from strings) Task-number: QTBUG-18137 Reviewed-by: Markus Goetz
| | * | | | Make creating sockets with an explicit network session thread safeShane Kearns2011-03-154-11/+46
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| | * | | | SSL: fix compilation on WindowsMartin Petersson2011-03-151-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | 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
| | * | | | Fix network session use with the localhost optimisation in QNABShane Kearns2011-03-101-5/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QNetworkAccessBackend has an optimisation to not start the bearer when the destination is localhost. On symbian, if the bearer is specified but not started, then socket creation will fail. To fix this, delay pushing the network session until start() is called, at which point we know if the localhost optmisation will be applied or not. When using localhost, don't specify any network session - symbian socket engine will create the socket successfully in thie case. Reviewed-by: Markus Goetz
| | * | | | Bearer support for threaded http backendShane Kearns2011-03-103-0/+18
| | | | | | | | | | | | | | | | | | | | | | | | Reviewed-by: Markus Goetz
| | * | | | Fix synchronous http deadlock when aborted by internal timeoutShane Kearns2011-03-101-2/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QHttpThreadDelegate::abortRequest was deleting itself, but not exiting the event loop. For the synchronous usage, both these are incorrect. Without exiting the event loop, the main thread waits forever. If it deletes itself, then the main thread will access the deleted memory on return (the delegate->incomingErrorCode class member) which can crash with frequency depending on heap implementation. With this change, abort acts more like the synchronousFinishedWithErrorSlot. Reviewed-by: Markus Goetz
| | * | | | Add debug logging to QHttpThreadDelegateShane Kearns2011-03-101-0/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Activated by defining QHTTPTHREADDELEGATE_DEBUG 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
| | * | | | Fix compile error introduced by mergeShane Kearns2011-03-081-3/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Basically the same as f86e014bb6f2754bfed33106021a809ca8c2ce73. The declarations were appearing twice in the header file after merging Reviewed-by: Trust Me
| | * | | | Merge branch 'symbian-socket-engine' of ↵Shane Kearns2011-03-0843-1180/+2756
| | |\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| | | * | | | bugfix: QDir::entryList(Files|Readable) not listing writable filesShane Kearns2011-02-241-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Mistake in the qfilesystemiterator_symbian implementation. Readable without Writable was thought to mean show only read-only files, but this isn't the expected behaviour of QDir[Iterator] Added an autotest, as this was only covered by ssl tests in the network layer. Reviewed-by: joao
| | | * | | | tst_qnetworkreply: Fix httpProxyCommands() on Windows.Martin Petersson2011-02-221-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Reviewed-by: Markus Goetz
| | | * | | | Fix duplicate calls to _q_startOperationShane Kearns2011-02-223-6/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Because of the shared QNetworkSession, we need to disconnect the signals before detaching from the session. Otherwise we may receive signals from an old session after switching configurations. Also, when a session is connected, we get both the state change (connected) and the opened signals from the session. This needs to be distinguished from the roaming->connected state change to avoid getting the networkSessionConnected signal twice. Reviewed-by: Markus Goetz Task-Number: QTBUG-16901
| | | * | | | Implement network session for HTTP backendShane Kearns2011-02-214-0/+45
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Reviewed-by: Markus Goetz
| | | * | | | Refactor dangerous multiple inheritanceShane Kearns2011-02-212-25/+86
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QObject and CBase both expect to be the root class of the object hierarchy so it can cause problems if they are used in multiple inheritance. Refactored the CActive used for starting RConnection into a helper class. Reviewed-by: Markus Goetz
| | | * | | | Fix RConnection handle leak in symbian bearer pluginShane Kearns2011-02-212-56/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The implementation was opening RConnection handles on top of previous instances, and not closing RConnection handles. Both of these cause a resource leak in the socket server which cannot clean up the connection until the Qt process has exited. After a lot of this (which could be triggered by the QNetworkReply auto test), the socket server may run out of memory resulting in all socket operations failing. Reviewed-by: Markus Goetz
| | | * | | | Remove open C setdefaultif support from symbian QNetworkSessionShane Kearns2011-02-212-68/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Qt no longer uses open C sockets Reviewed-by: Markus Goetz
| | | * | | | Explicit network session for QNetworkAccessManagerShane Kearns2011-02-1712-11/+101
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Implemented a tunnel to get the QNetworkSession from QNetworkAccessManager down to the socket engine. This is currently a private API for QNAM. This patch only implements the FTP backend - the other backends are to follow. On Symbian, the native socket engine will extract the native session (RConnection) from the QNetworkSession implementation, and use that to open sockets using the explicitly specified session. When no session is specified on the socket (default for networking usage outside of QNAM) then the socket is opened with no RConnection specified, which allows the IP stack to find any route via an open interface. The QFtp autotest is enhanced to test QFtp with an explicit session as well as implicit connectivity (where a QNetworkSession is opened by the user, and then QFtp is used without a specified connection). This autotest gives better coverage than the FTP test cases in QNetworkReply. Reviewed-by: Markus Goetz
| | | * | | | Fix thread starvation when processEvents() is called in a tight loopShane Kearns2011-02-161-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | One of the qftp test cases calls processEvents() in a tight loop instead of using an event loop. This was causing the application to hang on symbian as it blocked a lower priority system thread and the WLAN connection never completed. Although calling processEvents in a tight loop is bad practice, it works on other OS where thread priorities are dynamic. Reviewed-by: mread
| | | * | | | Merge remote branch 'qt/master' into symbian-socket-engineShane Kearns2011-02-073977-9776/+25715
| | | |\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/network/access/qnetworkaccessmanager.cpp src/network/bearer/qnetworksession.cpp src/network/kernel/qnetworkproxy_symbian.cpp src/network/socket/qnativesocketengine_unix.cpp tests/auto/platformsocketengine/tst_platformsocketengine.cpp
| | | * | | | | Fix GCC compiler warningShane Kearns2011-02-071-1/+1
| | | | | | | |
| | | * | | | | Fix random crashes when bearer suddenly goes downShane Kearns2011-02-044-6/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1. QNetworkSession being deleted from the closed signal caused data abort or E32User-CBase 49 panics. (both observed) 2. Potential E32User-CBase 46 panic in ConnectionProgressNotifier::StartNotifications() Reviewed-by: Aaron Tunney Reviewed-By: Markus Goetz Task-Number: QTBUG-17196
| | | * | | | | Fix for using search paths with a dirty pathShane Kearns2011-02-031-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Opening "searchpath:/file" and other non clean paths was failing Reviewed-by: joao
| | | * | | | | Add precondition checks to symbian socket engine entry pointsShane Kearns2011-02-031-37/+75
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Reviewed-by: Markus Goetz
| | | * | | | | Clean up TODO and FIXME that are doneShane Kearns2011-02-032-21/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Reviewed-by: Markus Goetz
| | | * | | | | Unification of error handling in symbian socket engineShane Kearns2011-02-031-55/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Reviewed-by: Markus Goetz
| | | * | | | | Change default type for http POST to application/octet-streamShane Kearns2011-02-031-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When the application did not set the mandatory content-type header for POST requests, Qt was putting in application/x-www-urlencoded. While this is the default for HTML forms, it isn't valid because Qt was not also encoding the data. Reviewed-by: Markus Goetz
| | | * | | | | Fix for pendingDatagramSize() in symbian socket engineShane Kearns2011-02-031-0/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The low level socket option returns the size including IP headers, as there is an option in receive to include headers in the datagram. This is OK for a "size will not exceed" metric for buffer allocation, but Qt relies on it being an accurate size. Open C did this by subtracting 28, but that isn't valid for IPv6 which has a 40 byte header. (we can't tell whether the buffered datagram was received over IPv4 or IPv6) To fix this, do a read with the peek option set, and only care about the size. In future it would be good to not peek, but rather return this buffer to a following call to readDatagram. Reviewed-by: Aaron Tunney
| | | * | | | | Implement multicast functionsShane Kearns2011-02-032-48/+69
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Reviewed-by: Aaron Tunney Reviewed-by: Markus Goetz
| | | * | | | | Enable QT_LOCALSOCKET_TCP for symbianShane Kearns2011-02-011-3/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Reviewed-by: Markus Goetz
| | | * | | | | Fix compile errors when TCP local sockets configured on symbianShane Kearns2011-02-012-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Reviewed-by: Markus Goetz