Commit 1f9c2e8a authored by Marco De Marco's avatar Marco De Marco
Browse files

File transfer minor fix

parent 523493c3
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -163,7 +163,7 @@ void PlainSession::startWriteResponse()
//==============================================================================
void PlainSession::startWriteData()
{
    DEBUG_STREAM << "PlainSession::startWriteData()" << endl;
    //DEBUG_STREAM << "PlainSession::startWriteData()" << endl;

    try
    {
@@ -173,7 +173,7 @@ void PlainSession::startWriteData()
            {
                int leftToRead = m_inputStreamSize - m_inputStream.tellg();

                DEBUG_STREAM << "PlainSession::startWriteData() left to read " << leftToRead << endl;
                //DEBUG_STREAM << "PlainSession::startWriteData() left to read " << leftToRead << endl;

                int bufferSize = 0;

@@ -182,7 +182,7 @@ void PlainSession::startWriteData()
                else
                        bufferSize = BUFFER_SIZE;

                DEBUG_STREAM << "PlainSession::startWriteData() buffer size " << bufferSize << endl;
                //DEBUG_STREAM << "PlainSession::startWriteData() buffer size " << bufferSize << endl;

                std::vector<char> writeBuff;
                writeBuff.resize(bufferSize);
+6 −0
Original line number Diff line number Diff line
@@ -354,6 +354,12 @@ ResponseSP ProtocolManager::prepareKeepAlive(RequestSP request_sp)

    response_sp->set_type(Response::KEEPALIVE);

    m_isTransferRequest = false;

    m_filePath.clear();

    m_fileSize = 0;

    return response_sp;
}

+3 −3
Original line number Diff line number Diff line
@@ -198,7 +198,7 @@ void SSLSession::startWriteResponse()
//==============================================================================
void SSLSession::startWriteData()
{
    DEBUG_STREAM << "SSLSession::startWriteData()" << endl;
    //DEBUG_STREAM << "SSLSession::startWriteData()" << endl;

    try
    {
@@ -208,7 +208,7 @@ void SSLSession::startWriteData()
            {
                int leftToRead = m_inputStreamSize - m_inputStream.tellg();

                DEBUG_STREAM << "SSLSession::startWriteData() left to read " << leftToRead << endl;
                //DEBUG_STREAM << "SSLSession::startWriteData() left to read " << leftToRead << endl;

                int bufferSize = 0;

@@ -217,7 +217,7 @@ void SSLSession::startWriteData()
                else
                        bufferSize = BUFFER_SIZE;

                DEBUG_STREAM << "SSLSession::startWriteData() buffer size " << bufferSize << endl;
                //DEBUG_STREAM << "SSLSession::startWriteData() buffer size " << bufferSize << endl;

                std::vector<char> writeBuff;
                writeBuff.resize(bufferSize);
+3 −3
Original line number Diff line number Diff line
@@ -130,7 +130,7 @@ void Session::handleWriteResponse(const boost::system::error_code& errorCode)
//==============================================================================
void Session::handleWriteData(const boost::system::error_code& errorCode)
{
    DEBUG_STREAM << "Session::handleWriteData()" << endl;
    //DEBUG_STREAM << "Session::handleWriteData()" << endl;

    if(!errorCode)
    {
@@ -138,12 +138,12 @@ void Session::handleWriteData(const boost::system::error_code& errorCode)
    }
    else if(errorCode == boost::asio::error::eof)
    {
        DEBUG_STREAM << "Session::handleWriteResponse() end of file from "
        DEBUG_STREAM << "Session::handleWriteData() end of file from "
            << m_remoteEndpoint << endl;
    }
    else
    {
        ERROR_STREAM << "Session::handleWriteResponse() "
        ERROR_STREAM << "Session::handleWriteData() "
            << errorCode.message() << " from " << m_remoteEndpoint << endl;
    }
}