summaryrefslogtreecommitdiffstats
path: root/src/network
Commit message (Collapse)AuthorAgeFilesLines
* Fix compilation with QT_NO_*Tasuku Suzuki2011-05-022-0/+7
| | | | | Merge-request: 1206 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
* Fix warnings on unused parameters and variablesThiago Macieira2011-04-262-2/+1
|
* Merge remote-tracking branch 'earth-team/master' into earth-staging-masterOlivier Goffart2011-04-2043-294/+3218
|\
| * QNetworkCookie: do not access date string out of boundsPeter Hartmann2011-04-201-1/+1
| |
| * QSslConfiguration: fix equals operatorPeter Hartmann2011-04-151-1/+1
| |
| * HTTP+SSL: use default SSL configuration, and avoid setting it explctlyPeter Hartmann2011-04-142-2/+2
| | | | | | | | | | | | | | | | | | | | do not use a null configuration, but a default configuration in QNetworkRequest by default. In addition, setting an SSL configuration explicitly will cause the on-demand loading of root certs to be disabled (because it could be that the user has set the CA certificates explicitly). Reviewed-by: Markus Goetz
| * Merge branch 'symbian-socket-engine' of scm.dev.troll.no:qt/qt-symbian-networkShane Kearns2011-04-1240-290/+3214
| |\ | | | | | | | | | | | | | | | | | | | | | Conflicts: configure.exe src/s60installs/bwins/QtCoreu.def src/s60installs/bwins/QtGuiu.def src/s60installs/eabi/QtCoreu.def
| | * Merge remote branch 'earth/master' into symbian-socket-engineShane Kearns2011-04-111-6/+1
| | |\ | | | | | | | | | | | | | | | | Conflicts: tests/auto/qabstractnetworkcache/tst_qabstractnetworkcache.cpp
| | * \ Merge branch 'master' of scm.dev.troll.no:qt/qt-earth-team into ↵Shane Kearns2011-04-1126-86/+209
| | |\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| | * | | QHostInfo symbian backend finalisationShane Kearns2011-04-051-13/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For reverse lookups, don't report errors, instead just return the IP address as a string for the host name (for behavioural compability with the windows and unix backends) Don't sort IP4 addresses before IP6 addresses for the same host. The symbian host resolver internally sorts the list so the usable addresses are returned first. (usable means has a valid route) Task-number: QTBUG-18135 Reviewed-by: Markus Goetz
| | * | | Updating comment in QHostInfo::localDomainNameAaron Tunney2011-04-051-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Updating comment to indicate that the feature isn't supported on Symbian. Reviewed-by: Shane Kearns
| | * | | Thread safety for QHostInfo symbian implementationShane Kearns2011-04-052-10/+46
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Each thread needs at least one current request if it has any queued requests, this is to stop the queue stalling. When starting a queued request, start it in the same thread it belongs to When aborting a request from the wrong thread, just detach it (it will complete normally but the slot isn't connected, and then delete itself) Reviewed-by: Markus Goetz
| | * | | Fix typo in class nameShane Kearns2011-04-053-36/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Manger -> Manager Reviewed-by: Markus Goetz
| | * | | Implement cache support for the async resolverShane Kearns2011-04-052-3/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add additional check when starting a queued request, as the cache may have been populated while the request was queued. Put completed requests in the cache (note cache code internally discards errored results and only caches successful results) Reviewed-by: Aaron Tunney 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
| | * | | Fix assert fail when debug log is enabledShane Kearns2011-04-051-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Enough debug logging allows time for the proxy server to close the http connection after sending a 407 response. This errors the connection, but then the queued _q_startNextRequest is immediately run, causing an assertion failure. Changed this to a soft failure which allows the error to propagate rather than crashing. Test case is tst_qnetworkreply::ioPostToHttpFromSocket 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
| | * | | Fix deadlock in QNetworkSession::stopShane Kearns2011-03-311-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The mutex added needs to be recursive, as stop calls close internally, which also needs to lock the mutex. Reviewed-by: Markus Goetz
| | * | | Fix error handling in qhostinfo_symbianShane Kearns2011-03-311-54/+42
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | De-duplicate error handling into a helper function. RHostResolver can return a few different errors at the end of the list, so treat these benign ones the same. When Next() gives an error, return any results we already obtained. Reviewed-by: Aaron Tunney
| | * | | Ayschronous Next() change for DNS resolution.Aaron Tunney2011-03-312-51/+77
| | | | | | | | | | | | | | | | | | | | Reviewed-By: Shane Kearns
| | * | | Ensure shared network session deleted from correct threadShane Kearns2011-03-291-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Due to threaded http, the shared QNetworkSession can have its last reference removed from a http delegate thread. To avoid this deadlocking use a deleteLater custom deleter so that the QNS is deleted from the thread it has affinity for. 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-2536-68/+1153
| | |\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| | * | | | QHostInfo: Don't mess with addr family orderingMarkus Goetz2011-03-251-14/+2
| | | | | | | | | | | | | | | | | | | | | | | | Reviewed-by: Aaron Tunney
| | * | | | use QList instead of RPointerArrayShane Kearns2011-03-232-27/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For maintainability, it's better to use Qt's container classes Reviewed-by: Markus Goetz
| | * | | | Ensure QSymbianHostResolver::DoCancel does correct thing based on stateShane Kearns2011-03-231-1/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If a host resolver async call in progress, cancel it. Otherwise don't. Reviewed-by: Markus Goetz
| | * | | | Ensure parameters of async function calls stay in scopeShane Kearns2011-03-232-2/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Calling symbian asynchronous functions with parameters on the stack, even "in" parameters is unsafe. If the server is blocked on another operation, then it will not read the parameters until later (at which time the stack is invalid) Reviewed-by: Markus Goetz
| | * | | | Fix event loop hangs caused by async QHostInfoShane Kearns2011-03-231-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Declaring iStatus in a derived class hides the iStatus in CActive. This confuses the active scheduler (which is using CActive::iStatus) and would in a normal symbian application have caused a stray signal panic. However as Qt's event loop integration uses CActiveScheduler::RunIfReady instead of the normal CActiveScheduler::Start the panic does not happen. Instead the thread semaphore gets messed up and causes problems. Reviewed-by: Markus Goetz
| | * | | | QHostInfo: Fix compilation with non-symbianMarkus Goetz2011-03-221-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | Reviewed-by: Shane Kearns
| | * | | | 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
| | * | | | Fix a deadlock in symbian QHostInfo when abortingShane Kearns2011-03-221-3/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | DoCancel was calling lookupFinished, which tries to acquire a mutex again that was already acquired in abortLookup (causing a deadlock). This call is un-necessary, as Cancel was only called from the destructor and from abortLookup - in neither case is this wanted. The run and RunError functions explicitly call lookupFinished. This fixes hang in autotests when attempting to lookup a bad host name. Reviewed-by: Markus Goetz
| | * | | | Fix SetActive being called twiceShane Kearns2011-03-221-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | Reviewed-by: Markus Goetz
| | * | | | Implement network session support for synchronous QHostInfoShane Kearns2011-03-224-10/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Private API, QHostInfoPrivate::fromName, which is called from QAbstractSocket when the network session property is set. Reviewed-by: Markus Goetz
| | * | | | Fix bugs where = used instead of ==Shane Kearns2011-03-211-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | Reviewed-by: Aaron Tunney
| | * | | | 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-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
| | * | | | 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-153-11/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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