summaryrefslogtreecommitdiffstats
path: root/src/network
Commit message (Collapse)AuthorAgeFilesLines
* sockets: limit buffer size of the internal sockets in proxy enginesShane Kearns2011-06-012-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 (cherry picked from commit c4727a85eed57a4db698326a1bed4aa75b6e5284) Change-Id: I29e6628e38b79b41c4464ba8cb772a0f03717043 Reviewed-on: http://codereview.qt.nokia.com/153 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Markus Goetz
* Fix thread safety regression of QNetworkConfigurationManagerShane Kearns2011-05-262-2/+2
| | | | | | | | | | | | | Changes in 4.8 led to a timer being created in the wrong thread. I have restored the invokeMethod used to call startPolling() to solve this problem. Reviewed-By: mread (cherry picked from commit e9e95f75e7c1e8325c2acce0087ff8677d773779) Change-Id: I8b89fa89766679beb2d469f9bbd1f5e2233f061b Reviewed-on: http://codereview.qt.nokia.com/138 Reviewed-by: Markus Goetz
* fix "Host" header of ipv6 URLs in QNAMshiroki2011-05-261-1/+11
| | | | | | Change-Id: I6bf3320e5ab285e3d1f4d72bd1ef0a0e42813e5b Reviewed-on: http://codereview.qt.nokia.com/115 Reviewed-by: Markus Goetz
* Merge branch 'master' of git://scm.dev.nokia.troll.no/qt/qtbase-stagingQt Continuous Integration System2011-05-25166-2830/+2834
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 'master' of git://scm.dev.nokia.troll.no/qt/qtbase-staging: (21 commits) Fixed line endings. Update licenseheader text in source files for qtbase Qt module New configure.exe binary Add -qpa option on Windows Use qglobal.h's VERSION number instead of hardcoded current version More examples adjusted to Symbian and Maemo5. (cherry picked from commit a97b9620a584c9b1a2e006873183526b3d7e001e) Doc: Added some details to the accessibility events API documentation. Doc: Fixed qdoc warnings. Doc: Fixed qdoc warnings. Doc: Made an additional change for clarity. Doc: Noted that the example will not work as expected with a mouse. Doc: Fixed qdoc warnings. Doc: Applying a pending change from previous merges. Doc: Fixed qdoc warning. Doc: Fixed qdoc warnings. Doc: Applied pending fixes to API documentation. Doc: Various fixes to documentation, some based on changes in master. Doc: Added missing project and desktop files. Doc: Documented the value returned when no field can be found. Squashed commit of changes from the 4.8-temp branch. ...
| * Update licenseheader text in source files for qtbase Qt moduleJyri Tahtela2011-05-24166-2826/+2826
| | | | | | | | | | | | | | Updated version of LGPL and FDL licenseheaders. Apply release phase licenseheaders for all source files. Reviewed-by: Trust Me
| * Doc: Applying a pending change from previous merges.David Boddie2011-05-231-0/+4
| |
| * Doc: Fixed qdoc warning.David Boddie2011-05-231-1/+1
| |
| * Doc: Fixed qdoc warnings.David Boddie2011-05-232-3/+3
| |
* | Merge branch 'master' of git://scm.dev.nokia.troll.no/qt/qtbase-earth-stagingQt Continuous Integration System2011-05-245-6543/+2
|\ \ | | | | | | | | | | | | | | | | | | * 'master' of git://scm.dev.nokia.troll.no/qt/qtbase-earth-staging: QUrl auto test: include core-private headers QUrl TLD: fix documentation file for "Add QUrl::topLevelDomain() ..." Add QUrl::topLevelDomain() and move TLD table from QtNetwork to QtCore
| * | Add QUrl::topLevelDomain() and move TLD table from QtNetwork to QtCoreRobert Hogan2011-05-245-6543/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Move Qt's copy of the Mozilla public suffix list from QtNetwork to QtCore and use it to expose a new API function QUrl::topLevelDomain(). This function returns the section of the url that is a registrar-controlled top level domain. QtCore now exports a couple of functions to the other Qt modules: qTopLevelDomain, a helper function for QUrl::topLevelDomain(); and qIsEffectiveTLD(), a helper function for QNetworkCookeieJar. The motivation for this new API is to allow QtWebKit implement a Third-Party Cookie blocking policy. For this QtWebKit needs to know the element of the url that is the registry-controlled TLD. Without this knowledge it would end up blocking third-party cookies per host rather than per registry-controlled domain. See also https://bugs.webkit.org/show_bug.cgi?id=45455 Merge-request: 1205 Task-number: QTBUG-13601 Reviewed-by: Peter Hartmann <peter.hartmann@nokia.com> (cherry picked from commit 154402f56dcf8303a6ce601a52215226af8d31ba)
* | | Merge branch 'master' of git://scm.dev.nokia.troll.no/qt/qtbase-earth-stagingQt Continuous Integration System2011-05-241-1/+5
|\| | | | | | | | | | | | | | * 'master' of git://scm.dev.nokia.troll.no/qt/qtbase-earth-staging: fix Symbian ordinals for merge request re. utf8 characters in SSL certs
| * | fix Symbian ordinals for merge request re. utf8 characters in SSL certsPeter Hartmann2011-05-241-1/+5
| | | | | | | | | | | | | | | Task-number: QTBUG-7912 (cherry picked from commit 83c37059df7f23be482d4ecb2c54603a3665a33d)
* | | Merge branch 'master' of git://scm.dev.nokia.troll.no/qt/qtbase-earth-stagingQt Continuous Integration System2011-05-243-36/+28
|\| | | |/ |/| | | | | | | | | * 'master' of git://scm.dev.nokia.troll.no/qt/qtbase-earth-staging: add auto test for SSL certificates containing utf8 characters fix coding style for merge request re. utf8 characters in SSL certs Use OpenSSL X509_NAME_ENTRY API to parse UTF8 subjectName/issuerName
| * fix coding style for merge request re. utf8 characters in SSL certsPierre Rossi2011-05-231-7/+6
| | | | | | | | | | | | | | | | | | fixes minor coding issues for "Use OpenSSL X509_NAME_ENTRY API to parse UTF8 subjectName/issuerName" Task-number: QTBUG-7912 Reviewed-by: Peter Hartmann <peter.hartmann@nokia.com> (cherry picked from commit 2e8d206fd9f656cd88b797c059ef83ed3df32881)
| * Use OpenSSL X509_NAME_ENTRY API to parse UTF8 subjectName/issuerNameRaul Metsma2011-05-233-36/+29
| | | | | | | | | | | | | | | | | | ... to be able to display non-ASCII names from subject and issuerInfo. Task-number: QTBUG-7912 Merge-request: 922 Reviewed-by: Peter Hartmann <peter.hartmann@nokia.com> (cherry picked from commit e5d94256be2525c24a8b61edd771662b7f2b8be3)
* | Fix incorrect hardware address on systems without getifaddrs()Craig Scott2011-05-201-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | On unix systems for which QT_NO_GETIFADDRS is defined, the way that the hardware address field is extracted from the result of a call to qt_safe_ioctl() is incorrect. The address of the ifreq.ifr_addr struct is taken rather than the appropriate member within that struct, sa_data, resulting in a memory offset and subsequently the hardware address has garbage in the first two of six fields. This commit modifies the code to pass the sa_data member instead of the address of the struct as a whole. Task-number: QTBUG-19165 Merge-request: 2614 Reviewed-by: Martin Petersson (cherry picked from commit 004ad12669ef696eeba70fd57d1eb0c67c806d1d)
* | Make QHostAddress.toString() follow RFC-5952 for IPv6 address format.Martin Petersson2011-05-201-3/+28
|/ | | | | | Task-number: QTBUG-18426 Reviewed-by: Peter Hartmann (cherry picked from commit ebc134db484eee31491836b619aad1ee86e3070e)
* emit QNetWorkAccessManager::finished on QNetworkReply::abort()Martin Petersson2011-05-111-0/+2
| | | | | | | | | | | | If we can not get online when the request is made then we are in the WaitingForSession state. This will happen for example if the device is in flight mode. This fix follows the same logic as in _q_networkSessionFailed, but we should look into why we have the WaitingForSession check in finished(). Task-number: QT-4747 Reviewed-by: Markus Goetz (cherry picked from commit 0c9cb9a34d6b472cb53bf1af4616af55b593b616)
* Sockets: Fix potential null pointer usagesShane Kearns2011-05-112-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 (cherry picked from commit 19edac88af53eea7f733cabbaee77f9b725b7ea9)
* QNAM: Re-order checks in migrateBackend()Markus Goetz2011-05-111-4/+4
| | | | | | | | | Do the easy checks first, will avoid a crash in the HTTP code if request is serviced from the cache. Task-number: QTBUG-18770 Reviewed-by: Peter Hartmann (cherry picked from commit d03a28a289cf0665290e6ea0375b31cbb2d6649e)
* Optimisation - buffer packet read in pendingDatagramSizeShane Kearns2011-05-112-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 (cherry picked from commit dd8de4c2437397748daba49569cbc7f89a8bfbee)
* Remove warnings when disabling notifications on a closed socketShane Kearns2011-05-111-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 (cherry picked from commit 0aa780235c24ed724fcf6a9095a6467e34b9346e)
* Merge branch 'master' of git://scm.dev.nokia.troll.no/qt/qtbase-earth-stagingQt Continuous Integration System2011-05-111-0/+3
|\ | | | | | | | | * 'master' of git://scm.dev.nokia.troll.no/qt/qtbase-earth-staging: Add QT_xxx_VERSION macros for each library in qtbase
| * Add QT_xxx_VERSION macros for each library in qtbaseLiang Qi2011-05-101-0/+3
| | | | | | | | | | | | | | Provide version info for each library like QTCORE_VERSION and etc. Task-number: QTMODULARIZATION-44 Reviewed-by: axis
* | HTTP backend: do not load resources from cache that must be revalidatedPeter Hartmann2011-05-101-7/+5
| | | | | | | | | | | | | | | | | | | | | | | | The header field "Cache-Control: must-revalidate" is a strict requirement for loading the resource from the server, and not reading it from the cache without revalidating first. With this patch, PreferCache will load such from the network instead of loading them from the cache, and AlwaysCache will throw a ContentNotFound error. Reviewed-by: Markus Goetz Task-number: QTBUG-18983 (cherry picked from commit 0e449f38894b1bd2dbb2f14206a011424679f063)
* | Clarified sendCustomRequest documentation to include HTTPSJanne Anttila2011-05-101-1/+1
| | | | | | | | | | Reviewed-By: mgoetz (cherry picked from commit 16b8c940dac02ec77e6ff9fe4150c32db1811e74)
* | Fix compilationOlivier Goffart2011-05-101-1/+0
| | | | | | | | | | Conflicts between 61c6d66b7efd8de4a83b021e7c4ef2b1a803ece2 and 940f16babab76b328b7c9bfdb5435102c689b76b (cherry picked from commit 7a20cf9d4419cf1a5a9a4ed450b03caa8716fd58)
* | Fixes warnings about unused variablesOlivier Goffart2011-05-101-0/+1
| | | | | | | | | | Reviewed-by: Peter Hartmann (cherry picked from commit 61c6d66b7efd8de4a83b021e7c4ef2b1a803ece2)
* | Fix warnings on unused parameters and variablesThiago Macieira2011-05-102-2/+1
|/ | | | (cherry picked from commit 940f16babab76b328b7c9bfdb5435102c689b76b)
* Fix QNetworkConfigurationManager usage outside main thread firstShane Kearns2011-05-091-3/+12
| | | | | | | | | | | | | | | | | | | | | | | | QNetworkConfigurationManager creates the engines loaded from plugins as objects in the main thread. If a QNetworkConfigurationManager instance is created in a worker thread without any instance previously existing in the main thread, then it is uninitialised until the main thread has run. This causes allConfigurations() to return an empty list if called immediately after instantiation, for example. This fix initialises the plugins using blocking queued connections, which causes the worker thread to block until the initialisation function has been called in the context of the main thread. Deadlock is possible if the main thread is for some reason waiting on the worker thread, but it will not deadlock on QNetworkConfigurationManager's mutex. If this is a problem for an application, it should use QNetworkConfigurationManager from the main thread first to preload the plugins. Task-number: QTBUG-18795 Task-number: QTBUG-18799 Reviewed-by: Cristiano Di Flora
* Update QTBUG-17223 for Qt 4.8Shane Kearns2011-05-093-1/+16
| | | | | | | | | | | | | | | In Qt 4.7, http network requests are assigned to http connection channels before connecting the channel. In Qt 4.8, channels are connected "blind" as this gives a performance improvement in certain circumstances. On the assumption that User-Agent should be the same for all the requests being sent to the server in a given burst, we use the first queued request to set the user agent for a http proxy. Task-number: QTBUG-17223 Reviewed-by: Markus Goetz Reviewed-by: Martin Petersson
* Send User-Agent from the network request in http proxy CONNECT commandShane Kearns2011-05-094-1/+19
| | | | | | | | | | | | | 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
* Fix QNetworkReplyImpl error handlingShane Kearns2011-05-091-4/+13
| | | | | | | | | The backend was never started when compiled without bearer management, now it is. Now emits the error signal in case of startup errors which would leave the state machine hanging. Previously it just printed a warning. Reviewed-by: Peter Hartmann
* Enable per network configuration proxy settings in QNetworkAccessManagerShane Kearns2011-05-092-27/+53
| | | | | | | | | | | | | | Delayed the resolving of the proxy until the backend is being started. This is because the proxy settings are not known until after QNetworkAccessManager has brought the network online using QNetworkSession. On Nokia's symbian3 phones, the default network configuration is a service network containing a list of access points in priority order. For a typical user, this will include one or more WLAN networks and a cellular network - each of which can have different proxy settings. Task-number: QTBUG-18618 Reviewed-by: Peter Hartmann
* Allow a network configuration to be included in a proxy queryShane Kearns2011-05-093-4/+123
| | | | | | | | | | | | | When Qt is compiled with bearer management support, the network configuration can be included as a parameter in QNetworkProxyQuery. This allows QNetworkProxyFactory::systemProxyForQuery to get the right proxy setting for a specific network. For example a mobile phone could have network configurations for home WLAN, work WLAN and 3G data access points, each with different proxy configurations. Task-number: QTBUG-18618 Reviewed-by: Peter Hartmann
* Fix error handling in write for socks socket engineShane Kearns2011-05-091-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
* Merge remote-tracking branch 'mainline/master' into earthOlivier Goffart2011-05-064-6/+21
|\
| * Move private headers into versioned subdirectoryMarius Storm-Olsen2011-05-021-1/+1
| | | | | | | | | | | | | | This will allow us to expose private headers in a controlled manner, and ensure that they are not used by accident. This also means that we internally will have to enable the private headers for the modules we wish to use in the project.
| * Add module.prf, and install MODULE_PRI for each moduleMarius Storm-Olsen2011-05-021-1/+4
| | | | | | | | Output warning if not present
| * QNetworkConfigurationManager: Fix network polling.Martin Petersson2011-05-022-2/+14
| | | | | | | | | | | | | | | | | | | | | | | | startPolling() is called by each engine, so before it would start multiple singleshot timers. So I moved the timer to the class and check if it has already been started before it is activated again. So that we just use one timer. Task-number: QTBUG-17219 Reviewed-by: Iiro Kause Reviewed-by: Kranthi Kuntala (cherry picked from commit 2506b86828ca8140c2f22d85a4378df40899b132)
| * QAbstractSocket: Fix waitForReadyRead infinite loop.Martin Petersson2011-05-021-2/+2
| | | | | | | | | | | | | | | | Make sure that waitForReadyRead times out if the read buffer is full. Task-number: QTBUG-16123 Reviewed-by: Peter Hartmann (cherry picked from commit 8d4cd52b6981a4e6deea7fdb77f56e40c4f3e6ba)
* | QSslConfiguration documentation fixTaito Silvola2011-05-051-2/+2
| | | | | | | | | | | | | | setPeerVerifyMode() and peerVerifyMode() comments fix Merge-request: 1220 Reviewed-by: Peter Hartmann
* | HTTP cache backend: do not load resources that must be revalidatedPeter Hartmann2011-05-041-2/+7
| | | | | | | | | | | | | | | | | | | | | | The header field "Cache-Control: must-revalidate" is a strict requirement for loading the resource from the server, and not reading it from the cache without revalidating first. With this patch, PreferCache will load such from the network instead of loading them from the cache, and AlwaysCache will throw a ContentNotFound error. Reviewed-by: Markus Goetz Task-number: QTBUG-18983
* | HTTP reply: do not load resources from cache that must be revalidatedPeter Hartmann2011-05-041-7/+5
| | | | | | | | | | | | | | | | | | | | | | The header field "Cache-Control: must-revalidate" is a strict requirement for loading the resource from the server, and not reading it from the cache without revalidating first. With this patch, PreferCache will load such from the network instead of loading them from the cache, and AlwaysCache will throw a ContentNotFound error. Reviewed-by: Markus Goetz Task-number: QTBUG-18983
* | QNetworkCookie: allow spaces in unquoted valuesPeter Hartmann2011-05-041-4/+5
| | | | | | | | | | | | | | | | | | | | We should follow http://tools.ietf.org/html/draft-ietf-httpstate-cookie-23 , which says parse the value until reaching the next ';' or the end of the line. Other cookie implementations allow spaces in unquoted values as well. Reviewed-by: Martin Petersson Task-number: QTBUG-18876
* | QNAM HTTP: Removes some commentsMarkus Goetz2011-05-031-17/+4
| |
* | QNAM HTTP: More commentsMarkus Goetz2011-05-031-23/+14
| |
* | QNAM HTTP: Implement abort() and close()Markus Goetz2011-05-031-6/+35
| |
* | QNAM HTTP: CommentsMarkus Goetz2011-05-031-11/+7
| |
* | QNAM: Function re-orderingMarkus Goetz2011-05-032-39/+36
| |