diff options
author | Shane Kearns <shane.kearns@accenture.com> | 2011-02-25 18:22:06 (GMT) |
---|---|---|
committer | Shane Kearns <shane.kearns@accenture.com> | 2011-02-28 12:27:05 (GMT) |
commit | 45531aceba4d0b2114942c49f4c256b70af58cf8 (patch) | |
tree | 54086d2d97728998bdda91b725c5de5af93cc662 | |
parent | 8d74ddeba364785bf3d0d0659e5bb91ab950540d (diff) | |
download | Qt-45531aceba4d0b2114942c49f4c256b70af58cf8.zip Qt-45531aceba4d0b2114942c49f4c256b70af58cf8.tar.gz Qt-45531aceba4d0b2114942c49f4c256b70af58cf8.tar.bz2 |
Move UDP send length workaround from generic code to symbian engine
Symbian workarounds are better in the symbian socket engine than
generic layer, where this is possible.
Reviewed-by: Markus Goetz
-rw-r--r-- | src/network/socket/qsymbiansocketengine.cpp | 9 | ||||
-rw-r--r-- | src/network/socket/qudpsocket.cpp | 10 |
2 files changed, 8 insertions, 11 deletions
diff --git a/src/network/socket/qsymbiansocketengine.cpp b/src/network/socket/qsymbiansocketengine.cpp index 18ce5e0..dac50d4 100644 --- a/src/network/socket/qsymbiansocketengine.cpp +++ b/src/network/socket/qsymbiansocketengine.cpp @@ -864,9 +864,16 @@ qint64 QSymbianSocketEngine::writeDatagram(const char *data, qint64 len, default: d->setError(QAbstractSocket::NetworkError, d->SendDatagramErrorString); } + return -1; } - return (err < 0) ? -1 : len; + if (QSysInfo::s60Version() <= QSysInfo::SV_S60_5_0) { + // This is evil hack, but for some reason native RSocket::SendTo returns 0, + // for large datagrams (such as 600 bytes). Based on comments from Open C team + // this should happen only in platforms <= S60 5.0. + return len; + } + return sentBytes(); } // FIXME check where the native socket engine called that.. diff --git a/src/network/socket/qudpsocket.cpp b/src/network/socket/qudpsocket.cpp index 6a62b12..4334f68 100644 --- a/src/network/socket/qudpsocket.cpp +++ b/src/network/socket/qudpsocket.cpp @@ -504,16 +504,6 @@ qint64 QUdpSocket::writeDatagram(const char *data, qint64 size, const QHostAddre return -1; qint64 sent = d->socketEngine->writeDatagram(data, size, address, port); -#ifdef Q_OS_SYMBIAN - if( QSysInfo::s60Version() <= QSysInfo::SV_S60_5_0 ) { - // This is evil hack, but for some reason native RSocket::SendTo returns 0, - // for large datagrams (such as 600 bytes). Based on comments from Open C team - // this should happen only in platforms <= S60 5.0. - // As an workaround, we just set sent = size - if( sent == 0 ) - sent = size; - } -#endif d->cachedSocketDescriptor = d->socketEngine->socketDescriptor(); if (sent >= 0) { |