summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@nokia.com>2009-11-20 08:30:24 (GMT)
committerSimon Hausmann <simon.hausmann@nokia.com>2009-11-20 08:30:31 (GMT)
commit3e5d4bcbcd6a4bdf0bfd6ae5933a61293720656a (patch)
tree3c19344f403677d43f495f879acc648089e68492 /src
parentea0f526ac3a7daef5d4ebff2373a01d4088e28c3 (diff)
parentb345b96dc14cc0da3a9ff44216d447e6f2c8ad97 (diff)
downloadQt-3e5d4bcbcd6a4bdf0bfd6ae5933a61293720656a.zip
Qt-3e5d4bcbcd6a4bdf0bfd6ae5933a61293720656a.tar.gz
Qt-3e5d4bcbcd6a4bdf0bfd6ae5933a61293720656a.tar.bz2
Merge commit 'b345b96dc14cc0da3a9ff44216d447e6f2c8ad97' from oslo-staging-1 into 4.6
Diffstat (limited to 'src')
-rw-r--r--src/3rdparty/javascriptcore/JavaScriptCore/JavaScriptCore.pri2
-rw-r--r--src/3rdparty/webkit/JavaScriptCore/JavaScriptCore.pri2
-rw-r--r--src/corelib/global/global.pri2
-rw-r--r--src/dbus/qdbusconnection.cpp3
-rw-r--r--src/dbus/qdbusconnection_p.h1
-rw-r--r--src/dbus/qdbusconnectioninterface.cpp5
-rw-r--r--src/dbus/qdbusintegrator.cpp19
-rw-r--r--src/network/access/qhttpnetworkconnectionchannel.cpp2
-rw-r--r--src/network/socket/qnativesocketengine.cpp40
-rw-r--r--src/network/socket/qnativesocketengine_win.cpp34
-rw-r--r--src/qbase.pri2
11 files changed, 95 insertions, 17 deletions
diff --git a/src/3rdparty/javascriptcore/JavaScriptCore/JavaScriptCore.pri b/src/3rdparty/javascriptcore/JavaScriptCore/JavaScriptCore.pri
index ea6e5ab..28328e7 100644
--- a/src/3rdparty/javascriptcore/JavaScriptCore/JavaScriptCore.pri
+++ b/src/3rdparty/javascriptcore/JavaScriptCore/JavaScriptCore.pri
@@ -52,7 +52,7 @@ win32-* {
# Rules when JIT enabled (not disabled)
!contains(DEFINES, ENABLE_JIT=0) {
- linux-g++*:greaterThan(QT_GCC_MAJOR_VERSION,3):greaterThan(QT_GCC_MINOR_VERSION,0) {
+ linux*-g++*:greaterThan(QT_GCC_MAJOR_VERSION,3):greaterThan(QT_GCC_MINOR_VERSION,0) {
QMAKE_CXXFLAGS += -fno-stack-protector
QMAKE_CFLAGS += -fno-stack-protector
}
diff --git a/src/3rdparty/webkit/JavaScriptCore/JavaScriptCore.pri b/src/3rdparty/webkit/JavaScriptCore/JavaScriptCore.pri
index 8bd4225..bb531e5 100644
--- a/src/3rdparty/webkit/JavaScriptCore/JavaScriptCore.pri
+++ b/src/3rdparty/webkit/JavaScriptCore/JavaScriptCore.pri
@@ -54,7 +54,7 @@ win32-* {
# Rules when JIT enabled (not disabled)
!contains(DEFINES, ENABLE_JIT=0) {
- linux-g++*:greaterThan(QT_GCC_MAJOR_VERSION,3):greaterThan(QT_GCC_MINOR_VERSION,0) {
+ linux*-g++*:greaterThan(QT_GCC_MAJOR_VERSION,3):greaterThan(QT_GCC_MINOR_VERSION,0) {
QMAKE_CXXFLAGS += -fno-stack-protector
QMAKE_CFLAGS += -fno-stack-protector
}
diff --git a/src/corelib/global/global.pri b/src/corelib/global/global.pri
index 0fe757d..b916b4d 100644
--- a/src/corelib/global/global.pri
+++ b/src/corelib/global/global.pri
@@ -19,7 +19,7 @@ INCLUDEPATH += $$QT_BUILD_TREE/src/corelib/global
# Only used on platforms with CONFIG += precompile_header
PRECOMPILED_HEADER = global/qt_pch.h
-linux-g++*:!static {
+linux*-g++*:!static {
QMAKE_LFLAGS += -Wl,-e,qt_core_boilerplate
prog=$$quote(if (/program interpreter: (.*)]/) { print $1; })
DEFINES += ELF_INTERPRETER=\\\"$$system(readelf -l /bin/ls | perl -n -e \'$$prog\')\\\"
diff --git a/src/dbus/qdbusconnection.cpp b/src/dbus/qdbusconnection.cpp
index d7088ff..d3aff6d 100644
--- a/src/dbus/qdbusconnection.cpp
+++ b/src/dbus/qdbusconnection.cpp
@@ -1005,6 +1005,9 @@ void QDBusConnectionPrivate::setBusService(const QDBusConnection &connection)
busService = new QDBusConnectionInterface(connection, this);
ref.deref(); // busService has increased the refcounting to us
// avoid cyclic refcounting
+// if (mode != PeerMode)
+ QObject::connect(busService, SIGNAL(serviceOwnerChanged(QString,QString,QString)),
+ this, SIGNAL(serviceOwnerChanged(QString,QString,QString)));
QObject::connect(this, SIGNAL(callWithCallbackFailed(QDBusError,QDBusMessage)),
busService, SIGNAL(callWithCallbackFailed(QDBusError,QDBusMessage)),
diff --git a/src/dbus/qdbusconnection_p.h b/src/dbus/qdbusconnection_p.h
index ed29e4e..830dac3 100644
--- a/src/dbus/qdbusconnection_p.h
+++ b/src/dbus/qdbusconnection_p.h
@@ -123,6 +123,7 @@ public:
QObject* obj;
int midx;
QList<int> params;
+ QStringList argumentMatch;
QByteArray matchRule;
};
diff --git a/src/dbus/qdbusconnectioninterface.cpp b/src/dbus/qdbusconnectioninterface.cpp
index 414d318..3b38432 100644
--- a/src/dbus/qdbusconnectioninterface.cpp
+++ b/src/dbus/qdbusconnectioninterface.cpp
@@ -337,11 +337,6 @@ void QDBusConnectionInterface::connectNotify(const char *signalName)
QDBusAbstractInterface::connectNotify(SIGNAL(NameLost(QString)));
else if (qstrcmp(signalName, SIGNAL(serviceOwnerChanged(QString,QString,QString))) == 0) {
- static bool warningPrinted = false;
- if (!warningPrinted) {
- qWarning("Connecting to deprecated signal QDBusConnectionInterface::serviceOwnerChanged(QString,QString,QString)");
- warningPrinted = true;
- }
QDBusAbstractInterface::connectNotify(SIGNAL(NameOwnerChanged(QString,QString,QString)));
}
}
diff --git a/src/dbus/qdbusintegrator.cpp b/src/dbus/qdbusintegrator.cpp
index 2d27668..870ddd0 100644
--- a/src/dbus/qdbusintegrator.cpp
+++ b/src/dbus/qdbusintegrator.cpp
@@ -1230,6 +1230,7 @@ bool QDBusConnectionPrivate::prepareHook(QDBusConnectionPrivate::SignalHook &hoo
hook.owner = owner; // we don't care if the service has an owner yet
hook.path = path;
hook.obj = receiver;
+ hook.argumentMatch = argMatch;
// build the D-Bus signal name and signature
// This should not happen for QDBusConnection::connect, use buildSignature here, since
@@ -1502,6 +1503,24 @@ void QDBusConnectionPrivate::handleSignal(const QString &key, const QDBusMessage
continue;
if (hook.signature.isEmpty() && !hook.signature.isNull() && !msg.signature().isEmpty())
continue;
+ if (!hook.argumentMatch.isEmpty()) {
+ const QVariantList arguments = msg.arguments();
+ if (hook.argumentMatch.size() > arguments.size())
+ continue;
+
+ bool matched = true;
+ for (int i = 0; i < hook.argumentMatch.size(); ++i) {
+ const QString &param = hook.argumentMatch.at(i);
+ if (param.isNull())
+ continue; // don't try to match against this
+ if (param == arguments.at(i).toString())
+ continue; // matched
+ matched = false;
+ break;
+ }
+ if (!matched)
+ continue;
+ }
activateSignal(hook, msg);
}
diff --git a/src/network/access/qhttpnetworkconnectionchannel.cpp b/src/network/access/qhttpnetworkconnectionchannel.cpp
index 852f41f..fa89fcc 100644
--- a/src/network/access/qhttpnetworkconnectionchannel.cpp
+++ b/src/network/access/qhttpnetworkconnectionchannel.cpp
@@ -774,6 +774,8 @@ void QHttpNetworkConnectionChannel::_q_connected()
{
// improve performance since we get the request sent by the kernel ASAP
socket->setSocketOption(QAbstractSocket::LowDelayOption, 1);
+ // not sure yet if it helps, but it makes sense
+ socket->setSocketOption(QAbstractSocket::KeepAliveOption, 1);
pipeliningSupported = QHttpNetworkConnectionChannel::PipeliningSupportUnknown;
diff --git a/src/network/socket/qnativesocketengine.cpp b/src/network/socket/qnativesocketengine.cpp
index ecf5ad9..5d17022 100644
--- a/src/network/socket/qnativesocketengine.cpp
+++ b/src/network/socket/qnativesocketengine.cpp
@@ -876,7 +876,7 @@ bool QNativeSocketEngine::waitForRead(int msecs, bool *timedOut)
*/
bool QNativeSocketEngine::waitForWrite(int msecs, bool *timedOut)
{
- Q_D(const QNativeSocketEngine);
+ Q_D(QNativeSocketEngine);
Q_CHECK_VALID_SOCKETLAYER(QNativeSocketEngine::waitForWrite(), false);
Q_CHECK_NOT_STATE(QNativeSocketEngine::waitForWrite(),
QAbstractSocket::UnconnectedState, false);
@@ -893,6 +893,24 @@ bool QNativeSocketEngine::waitForWrite(int msecs, bool *timedOut)
setState(QAbstractSocket::ConnectedState);
d_func()->fetchConnectionParameters();
return true;
+ } else {
+ int value = 0;
+ int valueSize = sizeof(value);
+ if (::getsockopt(d->socketDescriptor, SOL_SOCKET, SO_ERROR, (char *) &value, &valueSize) == 0) {
+ if (value == WSAECONNREFUSED) {
+ d->setError(QAbstractSocket::ConnectionRefusedError, QNativeSocketEnginePrivate::ConnectionRefusedErrorString);
+ d->socketState = QAbstractSocket::UnconnectedState;
+ return false;
+ } else if (value == WSAETIMEDOUT) {
+ d->setError(QAbstractSocket::NetworkError, QNativeSocketEnginePrivate::ConnectionTimeOutErrorString);
+ d->socketState = QAbstractSocket::UnconnectedState;
+ return false;
+ } else if (value == WSAEHOSTUNREACH) {
+ d->setError(QAbstractSocket::NetworkError, QNativeSocketEnginePrivate::HostUnreachableErrorString);
+ d->socketState = QAbstractSocket::UnconnectedState;
+ return false;
+ }
+ }
}
#endif
@@ -913,7 +931,7 @@ bool QNativeSocketEngine::waitForReadOrWrite(bool *readyToRead, bool *readyToWri
bool checkRead, bool checkWrite,
int msecs, bool *timedOut)
{
- Q_D(const QNativeSocketEngine);
+ Q_D(QNativeSocketEngine);
Q_CHECK_VALID_SOCKETLAYER(QNativeSocketEngine::waitForWrite(), false);
Q_CHECK_NOT_STATE(QNativeSocketEngine::waitForReadOrWrite(),
QAbstractSocket::UnconnectedState, false);
@@ -927,6 +945,24 @@ bool QNativeSocketEngine::waitForReadOrWrite(bool *readyToRead, bool *readyToWri
setState(QAbstractSocket::ConnectedState);
d_func()->fetchConnectionParameters();
return true;
+ } else {
+ int value = 0;
+ int valueSize = sizeof(value);
+ if (::getsockopt(d->socketDescriptor, SOL_SOCKET, SO_ERROR, (char *) &value, &valueSize) == 0) {
+ if (value == WSAECONNREFUSED) {
+ d->setError(QAbstractSocket::ConnectionRefusedError, QNativeSocketEnginePrivate::ConnectionRefusedErrorString);
+ d->socketState = QAbstractSocket::UnconnectedState;
+ return false;
+ } else if (value == WSAETIMEDOUT) {
+ d->setError(QAbstractSocket::NetworkError, QNativeSocketEnginePrivate::ConnectionTimeOutErrorString);
+ d->socketState = QAbstractSocket::UnconnectedState;
+ return false;
+ } else if (value == WSAEHOSTUNREACH) {
+ d->setError(QAbstractSocket::NetworkError, QNativeSocketEnginePrivate::HostUnreachableErrorString);
+ d->socketState = QAbstractSocket::UnconnectedState;
+ return false;
+ }
+ }
}
#endif
if (ret == 0) {
diff --git a/src/network/socket/qnativesocketengine_win.cpp b/src/network/socket/qnativesocketengine_win.cpp
index 63fe78e..91f930a 100644
--- a/src/network/socket/qnativesocketengine_win.cpp
+++ b/src/network/socket/qnativesocketengine_win.cpp
@@ -1107,10 +1107,22 @@ int QNativeSocketEnginePrivate::nativeSelect(int timeout, bool selectForRead) co
tv.tv_sec = timeout / 1000;
tv.tv_usec = (timeout % 1000) * 1000;
- if (selectForRead)
+ if (selectForRead) {
ret = select(0, &fds, 0, 0, timeout < 0 ? 0 : &tv);
- else
- ret = select(0, 0, &fds, 0, timeout < 0 ? 0 : &tv);
+ } else {
+ // select for write
+
+ // Windows needs this to report errors when connecting a socket ...
+ fd_set fdexception;
+ FD_ZERO(&fdexception);
+ FD_SET(socketDescriptor, &fdexception);
+
+ ret = select(0, 0, &fds, &fdexception, timeout < 0 ? 0 : &tv);
+
+ // ... but if it is actually set, pretend it did not happen
+ if (ret > 0 && FD_ISSET(socketDescriptor, &fdexception))
+ ret--;
+ }
if (readEnabled)
readNotifier->setEnabled(true);
@@ -1125,9 +1137,10 @@ int QNativeSocketEnginePrivate::nativeSelect(int timeout,
bool readEnabled = checkRead && readNotifier && readNotifier->isEnabled();
if (readEnabled)
readNotifier->setEnabled(false);
-
+
fd_set fdread;
fd_set fdwrite;
+ fd_set fdexception;
int ret = 0;
@@ -1137,9 +1150,13 @@ int QNativeSocketEnginePrivate::nativeSelect(int timeout,
fdread.fd_array[0] = socketDescriptor;
}
memset(&fdwrite, 0, sizeof(fd_set));
+ FD_ZERO(&fdexception);
if (checkWrite) {
fdwrite.fd_count = 1;
fdwrite.fd_array[0] = socketDescriptor;
+
+ // Windows needs this to report errors when connecting a socket
+ FD_SET(socketDescriptor, &fdexception);
}
struct timeval tv;
@@ -1147,10 +1164,15 @@ int QNativeSocketEnginePrivate::nativeSelect(int timeout,
tv.tv_usec = (timeout % 1000) * 1000;
#if !defined(Q_OS_WINCE)
- ret = select(socketDescriptor + 1, &fdread, &fdwrite, 0, timeout < 0 ? 0 : &tv);
+ ret = select(socketDescriptor + 1, &fdread, &fdwrite, &fdexception, timeout < 0 ? 0 : &tv);
#else
- ret = select(1, &fdread, &fdwrite, 0, timeout < 0 ? 0 : &tv);
+ ret = select(1, &fdread, &fdwrite, &fdexception, timeout < 0 ? 0 : &tv);
#endif
+
+ //... but if it is actually set, pretend it did not happen
+ if (ret > 0 && FD_ISSET(socketDescriptor, &fdexception))
+ ret--;
+
if (readEnabled)
readNotifier->setEnabled(true);
diff --git a/src/qbase.pri b/src/qbase.pri
index 6428130..0aae24d 100644
--- a/src/qbase.pri
+++ b/src/qbase.pri
@@ -36,7 +36,7 @@ CONFIG += qt warn_on depend_includepath
CONFIG += qmake_cache target_qt
CONFIG -= fix_output_dirs
win32|mac:!macx-xcode:CONFIG += debug_and_release
-linux-g++*:QMAKE_LFLAGS += $$QMAKE_LFLAGS_NOUNDEF
+linux*-g++*:QMAKE_LFLAGS += $$QMAKE_LFLAGS_NOUNDEF
contains(QT_CONFIG, reduce_exports):CONFIG += hide_symbols
unix:contains(QT_CONFIG, reduce_relocations):CONFIG += bsymbolic_functions