]> WPIA git - cassiopeia.git/commitdiff
fix: also send chunks, when body is empty
authorFelix Dörre <felix@dogcraft.de>
Tue, 26 Jan 2016 21:29:05 +0000 (22:29 +0100)
committerFelix Dörre <felix@dogcraft.de>
Tue, 26 Jan 2016 21:29:05 +0000 (22:29 +0100)
src/io/record.cpp

index 422244e0021e2d06216df0f31e2ea7f626ee914b..eed2e8f37da9e58ffed738767f7e93a89e34263b 100644 (file)
@@ -31,7 +31,7 @@ void sendCommand( RecordHeader& head, const std::string& data, std::shared_ptr<O
     size_t pos = 0;
     head.offset = 0;
     head.totalLength = data.size();
-    while(pos < data.size()){
+    do {
         size_t toTransfer = std::min(static_cast<size_t>(0xF000), data.size() - pos);
         head.payloadLength = toTransfer;
 
@@ -47,7 +47,7 @@ void sendCommand( RecordHeader& head, const std::string& data, std::shared_ptr<O
 
         pos += toTransfer;
         head.offset += 1;
-    }
+    } while(pos < data.size());
 }
 
 int32_t fromHexDigit( char c ) {