[telepathy-qt4/master] OutgoingFileTransferChannel: Define FT_BLOCK_SIZE and use it as the read buffer size.
Andre Moreira Magalhaes (andrunko)
andre.magalhaes at collabora.co.uk
Tue Sep 22 18:37:43 PDT 2009
---
TelepathyQt4/outgoing-file-transfer-channel.cpp | 8 +++++---
1 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/TelepathyQt4/outgoing-file-transfer-channel.cpp b/TelepathyQt4/outgoing-file-transfer-channel.cpp
index 773a2e1..4b67172 100644
--- a/TelepathyQt4/outgoing-file-transfer-channel.cpp
+++ b/TelepathyQt4/outgoing-file-transfer-channel.cpp
@@ -36,6 +36,8 @@
namespace Tp
{
+static const int FT_BLOCK_SIZE = 16 * 1024;
+
struct OutgoingFileTransferChannel::Private
{
Private(OutgoingFileTransferChannel *parent);
@@ -260,9 +262,9 @@ void OutgoingFileTransferChannel::onInputAboutToClose()
void OutgoingFileTransferChannel::doTransfer()
{
- // read 16k each time, as input can be a QFile, we don't want to block
- // reading the whole file
- char buffer[16 * 1024];
+ // read FT_BLOCK_SIZE each time, as input can be a QFile, we don't want to
+ // block reading the whole file
+ char buffer[FT_BLOCK_SIZE];
char *p = buffer;
memset(buffer, 0, sizeof(buffer));
--
1.5.6.5
More information about the telepathy-commits
mailing list