mirror of
https://gitea.msk.dinamika-avia.ru/Constanta-Design/RRJServer.git
synced 2026-03-28 19:55:48 +03:00
bugFix Блочная передача больших данных
This commit is contained in:
@@ -85,7 +85,7 @@ void SendSystem::sendFileBlockByteArray(QByteArray array, PacketType packetType)
|
||||
QDataStream stream(socket);
|
||||
stream.setVersion(QDataStream::Qt_DefaultCompiledVersion);
|
||||
|
||||
quint64 size = array.size();
|
||||
qint64 size = array.size();
|
||||
qint64 bytesSended = 0;
|
||||
|
||||
if (size == 0)
|
||||
@@ -97,19 +97,20 @@ void SendSystem::sendFileBlockByteArray(QByteArray array, PacketType packetType)
|
||||
stream << packetType; //Отправляем тип блока
|
||||
stream << size;
|
||||
|
||||
while (size > 0)
|
||||
//while (size > 0)
|
||||
while (bytesSended < size)
|
||||
{
|
||||
QByteArray chunk = array.mid(bytesSended,sendFileBlockSize);
|
||||
stream << chunk;
|
||||
|
||||
bytesSended += chunk.length();
|
||||
size -= bytesSended;
|
||||
//size -= bytesSended;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
sendPacketType(packetType);
|
||||
quint64 size = array.size();
|
||||
qint64 size = array.size();
|
||||
qint64 bytesSended = 0;
|
||||
|
||||
if (size == 0)
|
||||
|
||||
Reference in New Issue
Block a user