From 3511aad188d8eb069465f47b5007da13ca1715c5 Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Tue, 5 May 2009 03:27:45 +0000 Subject: [PATCH] 2009-05-05 Tatsuhiro Tsujikawa Applied Pascal Bleser's patch: increases MAX_RECV_BUFFER for ftp from 4096 to 65536 (for insanely large ftp login banners) * src/FtpConnection.h * test/FtpConnectionTest.cc --- ChangeLog | 7 +++++++ src/FtpConnection.h | 3 ++- test/FtpConnectionTest.cc | 2 +- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 87eeb653..636a3b3f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2009-05-05 Tatsuhiro Tsujikawa + + Applied Pascal Bleser's patch: increases MAX_RECV_BUFFER for ftp + from 4096 to 65536 (for insanely large ftp login banners) + * src/FtpConnection.h + * test/FtpConnectionTest.cc + 2009-05-05 Tatsuhiro Tsujikawa In DefaultBtContext::getActualBasePath(), return first diff --git a/src/FtpConnection.h b/src/FtpConnection.h index bc8395ec..604f2447 100644 --- a/src/FtpConnection.h +++ b/src/FtpConnection.h @@ -79,7 +79,8 @@ private: static const std::string I; - static const size_t MAX_RECV_BUFFER = 4096; + //prepare for large banners + static const size_t MAX_RECV_BUFFER = 65536; public: FtpConnection(int32_t cuid, const SharedHandle& socket, const SharedHandle& req, diff --git a/test/FtpConnectionTest.cc b/test/FtpConnectionTest.cc index a86dcd5b..bbbfab4f 100644 --- a/test/FtpConnectionTest.cc +++ b/test/FtpConnectionTest.cc @@ -195,7 +195,7 @@ void FtpConnectionTest::testReceiveResponse_overflow() char data[1024]; memset(data, 0, sizeof(data)); memcpy(data, "213 ", 4); - for(int i = 0; i < 4; ++i) { + for(int i = 0; i < 64; ++i) { _serverSocket->writeData(data, sizeof(data)); waitRead(_clientSocket); CPPUNIT_ASSERT_EQUAL((unsigned int)0, _ftp->receiveResponse());