- if (_blockSize == 0) {
- if (socket()->bytesAvailable() < 4)
- return false;
- _stream >> _blockSize;
- }
-
- if (_blockSize > 1 << 22) {
- close("Peer tried to send package larger than max package size!");
- return false;
- }
-
- if (_blockSize == 0) {
- close("Peer tried to send 0 byte package!");
- return false;
- }
-
- if (socket()->bytesAvailable() < _blockSize) {
- emit transferProgress(socket()->bytesAvailable(), _blockSize);
- return false;
- }
-
- emit transferProgress(_blockSize, _blockSize);
-
- _stream >> item;
- _blockSize = 0;
-
- if (!item.isValid()) {
- close("Peer sent corrupt data: unable to load QVariant!");
- return false;
+ QVariantList list;
+ QVariantMap::const_iterator it = handshakeMsg.begin();
+ while (it != handshakeMsg.end()) {
+ list << it.key().toUtf8() << it.value();
+ ++it;