~ubuntu-branches/ubuntu/saucy/filezilla/saucy-proposed

« back to all changes in this revision

Viewing changes to src/engine/transfersocket.cpp

  • Committer: Package Import Robot
  • Author(s): Adrien Cunin
  • Date: 2012-12-07 17:17:17 UTC
  • mfrom: (1.1.31)
  • Revision ID: package-import@ubuntu.com-20121207171717-nt6as62u4pa1uv11
Tags: 3.6.0.2-1ubuntu1
* Merge from Debian experimental. Remaining Ubuntu change:
   - Added debian/patches/11_use-decimal-si-by-default.patch in order to
     comply with UnitsPolicy

Show diffs side-by-side

added added

removed removed

Lines of Context:
66
66
        {
67
67
                if (m_transferMode == upload || m_transferMode == download)
68
68
                {
69
 
                        CFtpFileTransferOpData *pData = static_cast<CFtpFileTransferOpData *>(static_cast<CRawTransferOpData *>(m_pControlSocket->m_pCurOpData)->pOldData);;
 
69
                        CFtpFileTransferOpData *pData = static_cast<CFtpFileTransferOpData *>(static_cast<CRawTransferOpData *>(m_pControlSocket->m_pCurOpData)->pOldData);
70
70
                        if (pData && pData->pIOThread)
71
71
                        {
72
72
                                if (m_transferMode == download)
83
83
        delete m_pSocket;
84
84
        m_pSocket = 0;
85
85
        delete m_pSocketServer;
86
 
        m_pSocketServer = 0;
87
 
 
88
86
        m_pSocketServer = CreateSocketServer();
 
87
 
89
88
        if (!m_pSocketServer)
90
89
        {
91
90
                m_pControlSocket->LogMessage(::Debug_Warning, _T("CreateSocketServer failed"));
266
265
 
267
266
        if (m_transferMode == list)
268
267
        {
269
 
                while (true)
 
268
                for (;;)
270
269
                {
271
270
                        char *pBuffer = new char[4096];
272
271
                        int error;
311
310
        }
312
311
        else if (m_transferMode == download)
313
312
        {
314
 
                while (true)
 
313
                for (;;)
315
314
                {
316
315
                        if (!CheckGetNextWriteBuffer())
317
316
                                return;
355
354
        }
356
355
        else if (m_transferMode == resumetest)
357
356
        {
358
 
                while (true)
 
357
                for (;;)
359
358
                {
360
359
                        char buffer[2];
361
360
                        int error;
406
405
void CTransferSocket::OnSend()
407
406
{
408
407
        if (!m_pBackend)
 
408
        {
 
409
                m_pControlSocket->LogMessage(::Debug_Verbose, _T("OnSend called without backend. Ignoring event."));
409
410
                return;
 
411
        }
410
412
 
411
413
        if (!m_bActive)
412
414
        {
539
541
{
540
542
        // Void all previous attempts to createt a socket
541
543
        delete m_pSocket;
542
 
        m_pSocket = 0;
543
544
        delete m_pSocketServer;
544
545
        m_pSocketServer = 0;
545
546
 
587
588
                return;
588
589
        if (m_transferMode == download || m_transferMode == upload)
589
590
        {
590
 
                CFtpFileTransferOpData *pData = static_cast<CFtpFileTransferOpData *>(static_cast<CRawTransferOpData *>(m_pControlSocket->m_pCurOpData)->pOldData);;
 
591
                CFtpFileTransferOpData *pData = static_cast<CFtpFileTransferOpData *>(static_cast<CRawTransferOpData *>(m_pControlSocket->m_pCurOpData)->pOldData);
591
592
                if (pData && pData->pIOThread)
592
593
                        pData->pIOThread->SetEventHandler(this);
593
594
        }
595
596
        m_bActive = true;
596
597
        if (!m_pSocket)
597
598
                return;
598
 
        
 
599
 
599
600
        if (m_pSocket->GetState() == CSocket::connected || m_pSocket->GetState() == CSocket::closing)
600
601
                TriggerPostponedEvents();
601
602
}
618
619
        {
619
620
                if (m_pBackend == m_pTlsSocket)
620
621
                        m_pBackend = 0;
621
 
        delete m_pTlsSocket;
 
622
                delete m_pTlsSocket;
622
623
                m_pTlsSocket = 0;
623
624
        }
624
625
 
696
697
 
697
698
bool CTransferSocket::CheckGetNextWriteBuffer()
698
699
{
699
 
        CFtpFileTransferOpData *pData = static_cast<CFtpFileTransferOpData *>(static_cast<CRawTransferOpData *>(m_pControlSocket->m_pCurOpData)->pOldData);;
 
700
        CFtpFileTransferOpData *pData = static_cast<CFtpFileTransferOpData *>(static_cast<CRawTransferOpData *>(m_pControlSocket->m_pCurOpData)->pOldData);
700
701
        if (!m_transferBufferLen)
701
702
        {
702
703
                int res = pData->pIOThread->GetNextWriteBuffer(&m_pTransferBuffer);
722
723
 
723
724
bool CTransferSocket::CheckGetNextReadBuffer()
724
725
{
725
 
        CFtpFileTransferOpData *pData = static_cast<CFtpFileTransferOpData *>(static_cast<CRawTransferOpData *>(m_pControlSocket->m_pCurOpData)->pOldData);;
 
726
        CFtpFileTransferOpData *pData = static_cast<CFtpFileTransferOpData *>(static_cast<CRawTransferOpData *>(m_pControlSocket->m_pCurOpData)->pOldData);
726
727
        if (!m_transferBufferLen)
727
728
        {
728
729
                int res = pData->pIOThread->GetNextReadBuffer(&m_pTransferBuffer);
739
740
                        if (m_pTlsSocket)
740
741
                        {
741
742
                                m_shutdown = true;
742
 
                                
 
743
 
743
744
                                int error = m_pTlsSocket->Shutdown();
744
745
                                if (error != 0)
745
746
                                {