- EncodeFullString(buffer, answer.c_str() + pos, chunkLength, ctx);
- if (send(sock, buffer, chunkLength, 0) < 0)
+ EncryptString(buffer, answer.c_str() + pos, chunkLength, &ctx);
+ if (send(sock, buffer, (chunkLength & ~7) < chunkLength ? chunkLength + 8 : chunkLength, 0) < 0) // Need to send data adjusted to the 8-byte boundary.