summaryrefslogtreecommitdiffstats
path: root/src/network
diff options
context:
space:
mode:
authorShane Kearns <shane.kearns@accenture.com>2011-01-25 13:30:58 (GMT)
committerShane Kearns <shane.kearns@accenture.com>2011-01-25 14:12:58 (GMT)
commitb36097693f9be745e8da550ea872fd1cda8d7d3a (patch)
tree4caaed24db7e35d537b612cd5a62bd3b7688486f /src/network
parent00553adc2ab5c38f1870b036d4bec881acb77511 (diff)
downloadQt-b36097693f9be745e8da550ea872fd1cda8d7d3a.zip
Qt-b36097693f9be745e8da550ea872fd1cda8d7d3a.tar.gz
Qt-b36097693f9be745e8da550ea872fd1cda8d7d3a.tar.bz2
Handle KErrBadName when connecting to broadcast address
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
Diffstat (limited to 'src/network')
-rw-r--r--src/network/socket/qsymbiansocketengine.cpp7
-rw-r--r--src/network/socket/qsymbiansocketengine_p.h2
2 files changed, 9 insertions, 0 deletions
diff --git a/src/network/socket/qsymbiansocketengine.cpp b/src/network/socket/qsymbiansocketengine.cpp
index 487f45c..8ded9ac 100644
--- a/src/network/socket/qsymbiansocketengine.cpp
+++ b/src/network/socket/qsymbiansocketengine.cpp
@@ -626,6 +626,10 @@ bool QSymbianSocketEngine::connectToHost(const QHostAddress &addr, quint16 port)
d->setError(QAbstractSocket::SocketAccessError, d->AccessErrorString);
d->socketState = QAbstractSocket::UnconnectedState;
break;
+ case KErrBadName:
+ d->setError(QAbstractSocket::NetworkError, d->InvalidAddressError);
+ d->socketState = QAbstractSocket::UnconnectedState;
+ break;
case KErrNotSupported:
case KErrBadDescriptor:
default:
@@ -1306,6 +1310,9 @@ void QSymbianSocketEnginePrivate::setError(QAbstractSocket::SocketError error, E
case InvalidProxyTypeString:
socketErrorString = QSymbianSocketEngine::tr("The proxy type is invalid for this operation");
break;
+ case InvalidAddressError:
+ socketErrorString = QSymbianSocketEngine::tr("The address is invalid for this operation");
+ break;
case UnknownSocketErrorString:
socketErrorString = QSymbianSocketEngine::tr("Unknown error");
break;
diff --git a/src/network/socket/qsymbiansocketengine_p.h b/src/network/socket/qsymbiansocketengine_p.h
index 8a0b8df..fb64dba 100644
--- a/src/network/socket/qsymbiansocketengine_p.h
+++ b/src/network/socket/qsymbiansocketengine_p.h
@@ -233,6 +233,8 @@ public:
PortInuseErrorString,
NotSocketErrorString,
InvalidProxyTypeString,
+ //symbian specific
+ InvalidAddressError,
UnknownSocketErrorString = -1
};