summaryrefslogtreecommitdiffstats
path: root/src/network/socket
Commit message (Collapse)AuthorAgeFilesLines
...
| * | | | 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
| | * | | | Explicit network session for QNetworkAccessManagerShane Kearns2011-02-174-9/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| | * | | | Merge remote branch 'qt/master' into symbian-socket-engineShane Kearns2011-02-0733-53/+46
| | |\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| | * | | | | 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
| | * | | | | 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
| | * | | | | Suppress warning for an expected errorShane Kearns2011-02-011-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QTcpServer calls accept repeatedly until it fails. So the KErrWouldBlock is an expected error - ignore this so warnings are only emitted for unexpected errors. Reviewed-by: Markus Goetz
| | * | | | | Handle KErrBadName when connecting to broadcast addressShane Kearns2011-01-252-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Symbian uses KErrBadName to indicate a badly formed socket address. It also returns this error if the address is invalid for the attempted operation, for example calling connect() with a broadcast address. Now handle this error explicitly rather than returning unknown error. Reviewed-by: Markus Goetz
| | * | | | | Implement moveToThread in the symbian socket engineShane Kearns2011-01-212-3/+45
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The active object used for socket notifications (QAsyncSelect) is thread specific, so it needs to be deleted and recreated in the new thread. Reviewed-by: Markus Goetz
| | * | | | | Fix IPv6 server connectionsShane Kearns2011-01-211-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Symbian treats listening on "0.0.0.0" to mean "accept any IPv4" and listening on "::" to mean "accept any IPv6". To accept any connection, you must listen with an unspecified address As the Qt documentation explicitly says QHostAddress::Any means to accept any connection, this is converted to an unspecified address (KAfUnspec) by the symbian socket engine. Reviewed-by: Markus Goetz
| | * | | | | Fix error connecting to IPv6 addressesShane Kearns2011-01-211-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Incorrect usage of KAfInet6 in the symbian socket engine. KAfInet is used for both IPv4 and IPv6 as a protocol family. KAfInet6 is used as the address family for IPv6 addresses. Reviewed-by: Markus Goetz
| | * | | | | Fix some issues with socket handle allocationShane Kearns2011-01-181-4/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QAbstractSocket requires a handle of -1 to be returned when accept fails. This is a common case, as it calls accept() in a loop to get all incoming connections. Also the blank socket wasn't being closed properly on failure so that is also fixed. Fixed a possible race condition in QSymbianSocketEngine::close - the socket descriptor is now deregistered before closing the symbian socket to avoid another thread getting the symbian handle reused in open and asserting when trying to register it. This patch also adds debug around socket handle allocation when socket engine debug is enabled. Reviewed-by: Markus Goetz
| | * | | | | Fix uncaught exception crash when socket ready read signal throwsShane Kearns2011-01-173-10/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When the application (in this case, an autotest) ran out of memory by calling readAll() in a slot, the exception propagated to the symbian active scheduler where it caused an assertion failure. Additionally, QAbstractSocket was left in a bad state because its member variables that guard against re-entrancy were left set. 1. Catch exceptions and convert to leaves in QAsyncSelect 2. Implement RunError function to set the socket engine error state 3. Use QScopedValueRollback in QAbstractSocket to ensure the reentrancy guards are reverted if an exception is thrown. Reviewed-by: Markus Goetz Reviewed-by: mread
| | * | | | | Fix non blocking connect on symbian devicesShane Kearns2011-01-121-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The socket server returns KErrAlreadyExists rather than KErrNone when connect is called as second time after the select ioctl completes. Reviewed-by: Markus Goetz Reviewed-by: Aaron Tunney
| | * | | | | Fix compile errorShane Kearns2011-01-041-1/+1
| | | | | | |
| | * | | | | Merge remote branch 'qt/master' into symbian-socket-engineShane Kearns2010-12-151-2/+2
| | |\ \ \ \ \
| | * | | | | | Platform socket engine test fixes & update TODOsShane Kearns2010-12-101-5/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Reviewed-by: Markus Goetz
| | * | | | | | Fixes for socket engine autotest failuresShane Kearns2010-12-102-4/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Reviewed-by: Markus Goetz
| | * | | | | | Fix some issues in symbian socket engineShane Kearns2010-12-091-22/+75
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Reviewed-by: Markus Goetz
| | * | | | | | Fix some crashes in the symbian socket engineShane Kearns2010-12-091-25/+88
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Reviewed-by: Markus Goetz
| | * | | | | | QSymbianSocketEngine: Some missing functionsMarkus Goetz2010-12-091-0/+20
| | | | | | | |
| | * | | | | | Fix bug in selectShane Kearns2010-12-091-3/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When waitForRead was called, it was selecting for read and write, because we were checking the pointers instead of the bools. Reviewed-by: Markus Goetz
| | * | | | | | QSymbianSocketEngine: Fix wrong debug messageMarkus Goetz2010-12-081-1/+1
| | | | | | | |
| | * | | | | | QSymbianSocketEngine: Unify a callMarkus Goetz2010-12-081-1/+1
| | | | | | | |
| | * | | | | | Fix handling of select ioctl resultsShane Kearns2010-12-081-4/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The select ioctl report everything not just the flags we asked for. So mask off the results to only look at the requested flags. Reviewed-by: Markus Goetz
| | * | | | | | Whitespace fixesShane Kearns2010-12-082-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Reviewed-by: Trust Me
| | * | | | | | Implement sync & async select for symbian socket engineShane Kearns2010-12-082-45/+244
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Async select is implemented with an active object rather than using the event dispatcher. Sync select is implemented using User::WaitForRequest to block the thread without requiring an event loop. In both cases, RSocket's KIoctlSelect is used to query the socket state. Reviewed-by: Markus Goetz
| | * | | | | | Remove more Q_OS_SYMBIAN stuff from network codeMarkus Goetz2010-12-082-60/+6
| | | | | | | |
| | * | | | | | Fix compile errorsShane Kearns2010-12-086-7/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | including qnativesocketengine_p.h causes link errors Reviewed-by: Markus Goetz
| | * | | | | | QNativeSocketEngine: Remove symbian codeMarkus Goetz2010-12-082-111/+1
| | | | | | | |
| | * | | | | | QSymbianSocketEngine: Always support IPv6Markus Goetz2010-12-081-36/+1
| | | | | | | |