X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/4846abaf45a5a1b2ba4392fab7fdc45f1518f4d7..25a2a4b05ee3b0f457ac89db2c93c0b11af5955a:/src/common/ftp.cpp diff --git a/src/common/ftp.cpp b/src/common/ftp.cpp index 9ef749df6f..b513f7e404 100644 --- a/src/common/ftp.cpp +++ b/src/common/ftp.cpp @@ -10,14 +10,14 @@ ///////////////////////////////////////////////////////////////////////////// #ifdef __GNUG__ -#pragma implementation "ftp.h" + #pragma implementation "ftp.h" #endif // For compilers that support precompilation, includes "wx.h". #include "wx/wxprec.h" #ifdef __BORLANDC__ -#pragma hdrstop + #pragma hdrstop #endif #if wxUSE_SOCKETS @@ -60,16 +60,13 @@ IMPLEMENT_PROTOCOL(wxFTP, _T("ftp"), _T("ftp"), TRUE) wxFTP::wxFTP() : wxProtocol() { - wxChar tmp[256]; - m_lastError = wxPROTO_NOERR; m_streaming = FALSE; m_user = _T("anonymous"); - wxGetUserName(tmp, 256); - m_passwd.sprintf(_T("%s@"),tmp); - wxGetHostName(tmp, 256); - m_passwd += tmp; + m_passwd = wxGetUserId(); + m_passwd += '@'; + m_passwd += wxGetHostName(); SetNotify(0); } @@ -155,7 +152,7 @@ bool wxFTP::SendCommand(const wxString& command, char exp_ret) return FALSE; } tmp_str = command + _T("\r\n"); - wxWX2MBbuf tmp_buf = tmp_str.mb_str(); + const wxWX2MBbuf tmp_buf = tmp_str.mb_str(); if (Write(MBSTRINGCAST tmp_buf, strlen(tmp_buf)).Error()) { m_lastError = wxPROTO_NETERR; return FALSE; @@ -358,6 +355,7 @@ wxInputStream *wxFTP::GetInputStream(const wxString& path) in_stream->m_ftpsize = wxAtoi(WXSTRINGCAST str_size); } + sock->SetFlags(WAITALL); return in_stream; } @@ -404,10 +402,6 @@ wxList *wxFTP::GetList(const wxString& wildcard) return NULL; } - sock->SetEventHandler(*GetNextHandler(), m_id); - sock->Notify(m_notifyme); - sock->SetNotify(m_neededreq); - return file_list; } #endif